What happened?
According to the canRequest API docs
Whether attempting to request notification permission will show a prompt. Returns true if the device has not been prompted for push notification permission already
Also your own docs states this about the getCanRequestPermission API
returns whether the system will show a permission prompt
However in version 5.5.4 of the Flutter SDK, the latest version as at the time of posting this, this is not the behaviour of the canRequest API. canRequest always returns true regardless of whether the system will show notification permission prompt or not
Steps to reproduce?
1. On fresh open of the app, calling `canRequest` API returns true, as it should
2. Use `requestPermission` to ask Notification permission for the first time
3. Deny the system permission prompt shown the first time
4. Calling `canRequest` API after denying first prompt returns true, as it should
5. Use `requestPermission` to ask Notification permission for the second time
6. Deny the system permission prompt shown the second time
7. Calling `canRequest` API after denying the second prompt returns true again which it should not. It should return false because permission prompt cannot show again
8. Calling `canRequest` API subsequently returns true. `canRequest` API never returns false
What did you expect to happen?
Calling canRequest API after denying the second prompt returns true again which it should not. It should return false because permission prompt cannot show again
OneSignal Flutter SDK version
5.5.4
Which platform(s) are affected?
Relevant log output
Code of Conduct
What happened?
According to the
canRequestAPI docsAlso your own docs states this about the
getCanRequestPermissionAPIHowever in version
5.5.4of the Flutter SDK, the latest version as at the time of posting this, this is not the behaviour of thecanRequestAPI.canRequestalways returns true regardless of whether the system will show notification permission prompt or notSteps to reproduce?
What did you expect to happen?
Calling
canRequestAPI after denying the second prompt returns true again which it should not. It should return false because permission prompt cannot show againOneSignal Flutter SDK version
5.5.4
Which platform(s) are affected?
Relevant log output
Code of Conduct