Skip to content

[question]: Permission not granted after optIn #1824

Closed
@MarianoManzi

Description

@MarianoManzi

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions