INNER CODE UNIT · TypeScript
optOut
OneSignal/react-native-onesignal · src/index.ts:393
export function optOut() {
if (!isNativeModuleLoaded(RNOneSignal)) return;
RNOneSignal.optOut();
}
/** Enable the push notification subscription to OneSignal. */
export function optIn() {
if (!isNativeModuleLoaded(RNOneSignal)) return;
RNOneSignal.optIn();
}
}
/**
* Add a callback that fires when the OneSignal user state changes.
* Important: When using the observer to retrieve the onesignalId, check the externalId as well to confirm the values are associated with the expected user.
*/