Closed
Description
How can we help?
In my app i have a switch to enable and disable notifications the following is the listner on the switch:
switch.setOnCheckedChangeListener { _, isChecked ->
if (OneSignal.Notifications.permission) {
if (isChecked) OneSignal.User.pushSubscription.optIn() else OneSignal.User.pushSubscription.optOut()
} else CoroutineScope(Dispatchers.IO).launch { OneSignal.Notifications.requestPermission(true) }
}
The problem is that when i call OneSignal.User.pushSubscription.optIn()
, even if OneSignal.Notifications.permission
is true the OneSignal console tells me thet the user hasn't granted the permission.
The OneSignal.User.pushSubscription.optOut()
work as expected.
Code of Conduct
- I agree to follow this project's Code of Conduct