Skip to content

[Bug]: OneSignal subscription list shows "Permission is not granted" even the permission is already granted #2106

@softsan

Description

@softsan

What happened?

For few of my users in production, can't get subscribed to Onesignal. It shows the record in subscription list but it shows as "Permission is not granted" I double / triple checked with the users and they all have given permission for Notification. They also did cache and data clear, logout, uninstall and fresh install several times but it doesn't make any difference. I am using the very latest version of OneSignal SDK. Here are some screenshots:

subscription_list

When i open that subscription, there is no "Externalid" and i am pretty sure I use that in my code:
details

Steps to reproduce?

In my MainApplication.kt I init OneSignal like this:
OneSignal.initWithContext(applicationContext, oneSignalAppId)

this is how i asked permission:
CoroutineScope(Dispatchers.IO).launch {
                OneSignal.Notifications.requestPermission(true)
            }

And after login, i use this:
 OneSignal.login(userIdx)

and register the tags like this:
 OneSignal.User.addTag(key, value)

and on logout from my app i clear all the tags and also sign out from OneSignal
fun unregisterTag(key: String) {
        OneSignal.User.removeTag(key)
    }

fun removeExternalUserId() {
        OneSignal.logout()
    }

Also i created in-app Push prompt for those users and they received that and they always click on "Allow" button but it never get subscribed or if subscribed it shows as "Permission is not granted"

What did you expect to happen?

It should subscribed to Onesignal and should receive push notifications.

OneSignal Android SDK version

5.1.13

Android version

13, 12, 11

Specific Android models

Android 14 Samsung/ pixel device

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions