offGyroscopeChange(listener: Function)

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

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

Description

Stop listening for gyroscope data changes.

Parameters

ParameterTypeRequiredDescription
Yes

Return Value

None

Examples

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

// Stop listening to the gyroscope: set up with onGyroscopeChange + startGyroscope, then cancel via offGyroscopeChange
onGyroscopeChange(e => console.log(e));
startGyroscope({
  interval: "normal",
  success: () => {},
  fail: error => console.error(error),
});
offGyroscopeChange(
  () => console.log("Stopped listening to gyroscope"),
  error => console.error(error)
);