flutter_local_notifications icon indicating copy to clipboard operation
flutter_local_notifications copied to clipboard

[Request] Add option for provisional authorization (iOS/macOS)

Open seanmc86 opened this issue 3 years ago • 2 comments

As per the Apple documentation, rather than explicitly requesting authorization, we can use provisional authorization to send messages that the user can keep or turn off.

This just requires adding the .provisional option to center.requestAuthorization

Could this be added?

Does the initialize method need to be adjusted in cases where we don't always want to use the default authorization request, or can it simply not be called?

seanmc86 avatar Mar 25 '21 12:03 seanmc86

Could you submit a PR for it? Regarding initialize, this could default to not requesting it. Note there's another API that is specific to iOS/macOS for requesting permissions

MaikuB avatar Mar 27 '21 20:03 MaikuB

@MaikuB Can you mention the name of the API to request provisional permission.

Actually, I am using this plugin alongside firebase_messaging plugin. I am using following code in my main method to request provisional permission.

await FirebaseMessaging.instance.requestPermission( provisional: true, );

The firebase messaging plugin is working fine with provisional permission. But, i am not able to show notifications using this permission, granting notification permission.

Can you help me in understanding and resolving this issue. Thanks!

amitm29 avatar Nov 23 '21 09:11 amitm29