0

OneSignal has a OneSignal.disablePush(boolean) method to toggle push notifications globally in app. How can I read the current value of it so that I can sync it with the app state?

In other words, I'm looking for a method like OneSignal.isPushDisabled() : boolean.

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389

1 Answers1

0

The OneSignal React Native SDK includes the method getDeviceState which includes the isPushDisabled key in the response.

OneSignal.getDeviceState().then(deviceState => console.log(deviceState.isPushDisabled));