How to disable OneSignal on android?

I want to use OneSignal on my app to send notifications to my users, and it is well documented and good, you should just act like this:


The problem is, I want to just send notification to my logged in users, so if a user logged out, I dont want him to receive notification, how can I disable OneSignal after it's inited?

I don't want to handle this on server, it should be some way to stop OneSignal service, I think.


  • You can call the following method in the logout process.


    EDIT 2022:

    // RN SDK version 4.x.x