stopGyroscope(params: Object)

Requires:
BaseKit≥2.3.2@ray-js/ray≥0.3.23
Platforms:
iOSAndroid
import { stopGyroscope } from '@ray-js/ray';

// Promise usage
try {
  const res = await stopGyroscope();
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Stop listening to gyroscope data

Parameters

PropertyTypeRequiredDescription
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { startGyroscope, stopGyroscope } from '@ray-js/ray'

// Stop gyroscope: first call startGyroscope to establish a session, then call stopGyroscope after success
startGyroscope({
  interval: "normal",
  success: () => {
    stopGyroscope({
      success: () => console.log("Stopped gyroscope"),
      fail: error => console.error(error),
    });
  },
  fail: error => console.error(error),
});