-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
Description
What happened?
When you give consent for the first time, the status is Permission Not Granted. If you revoke consent and give it a second time, the bug is fixed
Happens only on Android 13+ devices.
Steps to reproduce?
1. Install OneSignal 5.1.15
2. Trigger the Android 13+ notification permission prompt using
var request = new PermissionRequest(); from Unity.Notifications.Android
3. Grant permission when the system dialog appears
Confirmation Scenario:
1. Go to the device's settings, revoke the notification permission, and relaunch the app.
2. Grant permission againWhat did you expect to happen?
I expected the user status to be "Subscribed"
Unity version
2022.3.62f2
OneSignal Unity SDK version
5.1.15
Platform
Android
Relevant log output
1. FAILING LOG (First launch, permission granted mid-session)
This log shows that right after initialization, both OneSignalId and the SubscriptionToken are missing.
[OneSignalService] Init
...
[UnityMobileNotificationsService] InitNotifications // This triggers the prompt
...
// User grants permission
...
// The crucial log line showing the failure:
[NotificationsManager] OneSignalID: null, ExternalID: 2500128, SubscriptionId: 40437d3d-12de-438a-9a11-7c48ee5b0b48, SubscriptionToken:
2. SUCCESSFUL LOG (Second launch, after revoking and re-granting permission)
This log shows that on a subsequent launch where the prompt is also shown at startup, the SDK successfully subscribes the user.
[OneSignalService] Init
...
[UnityMobileNotificationsService] InitNotifications // This triggers the prompt
...
// User grants permission
...
// The crucial log line showing success:
[NotificationsManager] OneSignalID: 36dd6ede-fbb2-42f7-9ec7-64d6003ca231, ExternalID: 2500121, SubscriptionId: 0453c128-df78-4d82-9421-ee10d85ba0d4, SubscriptionToken: eYgL32tkTqSiQBdCpsO1vE:[...]Code of Conduct
- I agree to follow this project's Code of Conduct