Add OneSignal.Notifications.canRequest() functionality to Android. It was previously iOS-only, with Android always returning false.
Scope
Adds OneSignal.Notifications.canRequest() functionality to Android.
Note that the method OneSignal.Notifications.canRequest() returns whether or not the device has been prompted for push already, and may not indicate on Android whether or not a push prompt will display.
Testing
Manual testing
Testing on Android emulator API 33:
New app install and see canRequest = true
Prompt for push and accept
See canRequest = false which is correct
Affected code checklist
[ ] Notifications
[ ] Display
[ ] Open
[ ] Push Processing
[ ] Confirm Deliveries
[ ] Outcomes
[ ] Sessions
[ ] In-App Messaging
[ ] REST API requests
[ ] Public API changes
Checklist
Overview
[x] I have filled out all REQUIRED sections above
[x] PR does one thing
[x] Any Public API changes are explained in the PR details and conform to existing APIs
Testing
[x] I have included test coverage for these changes, or explained why they are not needed
[x] All automated tests pass, or I explained why that is not possible
[x] I have personally tested this on my device, or explained why that is not possible
Final pass
[x] Code is as readable as possible.
[x] I have reviewed this PR myself, ensuring it meets each checklist item
Description
One Line Summary
OneSignal.Notifications.canRequest()
has been fixed for Android in https://github.com/OneSignal/OneSignal-Android-SDK/pull/1798, make it available in Flutter SDK.Details
Motivation
Add
OneSignal.Notifications.canRequest()
functionality to Android. It was previously iOS-only, with Android always returningfalse
.Scope
Adds
OneSignal.Notifications.canRequest()
functionality to Android.Note that the method
OneSignal.Notifications.canRequest()
returns whether or not the device has been prompted for push already, and may not indicate on Android whether or not a push prompt will display.Testing
Manual testing
Testing on Android emulator API 33:
canRequest = true
canRequest = false
which is correctAffected code checklist
Checklist
Overview
Testing
Final pass
This change is