OneSignal/react-onesignal

[Question]: turn off notifications on certain device if logout

captain-avocado opened this issue · 1 comments

How can we help?

I have several apps connected to one OneSignal account: Android, iOS and Web.
If the user logout, for example, from web app, I want him to continue receiving notifications on Android and iOS (if he's still logged in there). But at the same time user don't need notifications from Web app. How can I achive this? Should I just use logOut method?

@captain-avocado I would recommend using OneSignal.logout() as you noted. Logout removes the push subscription from User that was logged in.

If you also want the browser to stop receiving all OneSignal notifications, then you will also need to disable them with OneSignal.User.PushSubscription.optOut().