OneSignal-Unity-SDK icon indicating copy to clipboard operation
OneSignal-Unity-SDK copied to clipboard

[question]: No response on PromptForPush()

Open G-r-i-n-c-h opened this issue 1 year ago • 3 comments

How can we help?

Just Checking if the behavior is correct. Using new 5.1.1 version of the SDK and Example app from git. On android 12 and bellow calling PromptForPush() does not give callback at all. the last line on console is "Opening permission prompt for push notifications and awaiting result..." However on android 13+ it pops up default notification view and all works as expected. Does anyone have the same problem ? (its clean example project nothing has been changed)

Code of Conduct

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

G-r-i-n-c-h avatar Mar 21 '24 11:03 G-r-i-n-c-h

Good question! Thanks for bringing this to our attention

OneSignal.Notifications.RequestPermissionAsync() does not return if notification permission is already granted and awaits forever. This is a bug and is true for both Android 12 and 13. We plan to fix this in a future release so that it returns true if permission is already granted.

shepherd-l avatar Mar 21 '24 20:03 shepherd-l

@shepherd-l Any workaround available for this one?

snoova avatar Mar 22 '24 14:03 snoova

@snoova

I recommend checking that OneSignal.Notifications.Permission is false inorder to call await OneSignal.Notifications.RequestPermissionAsync();

shepherd-l avatar Mar 22 '24 17:03 shepherd-l

This should be fixed in the latest 5.1.7 release. Please create a new issue if this is still a problem

shepherd-l avatar Jul 08 '24 15:07 shepherd-l