Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 3 tasks
jaggerharness opened this issue Mar 21, 2024 · 4 comments

Comments

@jaggerharness
Copy link

jaggerharness commented Mar 21, 2024

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
@jaggerharness
Copy link
Author

I've found a temporary solution (OneSignal/OneSignal-Android-SDK#1824 (comment)) by adding the following to the build.gradle:

implementation 'com.google.firebase:firebase-messaging:23.4.0'

@arabnology
Copy link

Same here! #900
Is there another solution than the implementation 'com.google.firebase:firebase-messaging:23.4.0'

We are not using this library, and we won't use it in our project.

@wasilni2022
Copy link

This bug will take forever to be fixed by the team! OneSignal, we trusted you at first, and now you left us at this risky time ?!

@arda-copur
Copy link

It's annoying that a question this simple takes so much time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants