Skip to content

[Bug]: Android "Permission Not Granted" in OneSignal dashboard despite being shown as "Subscribed" in application #861

@jaggerharness

Description

@jaggerharness

What happened?

In the latest version of the SDK, I am unable to properly Opt In to notifications only on Android, iOS is working without issue. After requestPermission and granting notification access, the application displays that optedIn == true, but the OneSignal dashboard shows permission status as "Permission Not Granted". At this time, I am unable to receive any notifications on the Android platform due to this issue.

Steps to reproduce?

1. Install 5.1.2 release of the package
2. Execute the following in main.dart to a physical Android device:

OneSignal.Debug.setLogLevel(OSLogLevel.verbose);
OneSignal.initialize("<YOUR APP ID HERE>");
OneSignal.Notifications.requestPermission(true);

3. Check OneSignal dashboard to see the device subscription displays Permission Not Granted

What did you expect to happen?

I expected that the user would show as subscribed in the dashboard and be able to to receive notifications.

OneSignal Flutter SDK version

Release 5.1.2

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

I/OneSignal(13166): [Thread-21] FirebaseMessaging.getToken not found, attempting to use FirebaseInstanceId.getToken
I/OneSignal(13166): [Thread-21] Device registered, push token = 
D/OneSignal(13166): [Thread-21] OperationRepo.enqueue(operation: {"name":"update-subscription","appId":"<YOUR APP ID HERE>","onesignalId":"<ONE SIGNAL ID>","subscriptionId":"<SUB ID>","type":"PUSH","enabled":false,"address":"","status":"SUBSCRIBED"}, flush: false)
D/OneSignal(13166): [OpRepo] SubscriptionOperationExecutor(operations: [{"name":"update-subscription","appId":"<YOUR APP ID HERE>","onesignalId":"<ONE SIGNAL ID>","subscriptionId":"<SUB ID>","type":"PUSH","enabled":false,"address":"","status":"SUBSCRIBED","id":"<ID>"}])
D/OneSignal(13166): [DefaultDispatcher-worker-3] HttpClient: PATCH apps/<YOUR APP ID HERE>/subscriptions/<SUB ID> - {"subscription":{"type":"AndroidPush","token":"","enabled":false,"notification_types":1,"sdk":"050106","device_model":"SM-S146VL","device_os":"14","rooted":false,"net_type":0,"app_version":"10"}}
D/OneSignal(13166): [DefaultDispatcher-worker-3] HttpClient: PATCH apps/<YOUR APP ID HERE>/subscriptions/<SUB ID> - FAILED STATUS: 400
W/OneSignal(13166): [DefaultDispatcher-worker-3] HttpClient: PATCH RECEIVED JSON: {"errors":[{"code":"subscription-10","title":"Subscription can't change notification_types to positive integer while disabled"}]}
D/OneSignal(13166): [OpRepo] OperationRepo: execute response = FAIL_NORETRY
E/OneSignal(13166): Operation execution failed without retry: [{"name":"update-subscription","appId":"<YOUR APP ID HERE>","onesignalId":"<ONE SIGNAL ID>","subscriptionId":"<SUB ID>","type":"PUSH","enabled":false,"address":"","status":"SUBSCRIBED","id":"<ID>"}]

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