How to disable OneSignal on android?

OneSignal has something called segments... (flags).

You can set a flag with OneSignal. If the user is logged in, they belong to a flag that logged out users don't.

For example, if logged in, set a flag for OneSignal as loggedin. If logged out, set the flag for OneSignal for this user as loggedout. When you send out notifications, you only send it to the loggedin flag.


You can call the following method in the logout process.

OneSignal.setSubscription(false);

https://documentation.onesignal.com/docs/android-native-sdk#section--setsubscription-