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:
https://documentation.onesignal.com/docs/android-sdk-setup
OneSignal.startInit(this)
.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
.unsubscribeWhenNotificationsAreDisabled(true)
.init();
Run Code Online (Sandbox Code Playgroud)
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 …