g123k / flutter_app_badger

Support to update the app badge on the launcher (both for Android and iOS)
https://pub.dev/packages/flutter_app_badger
Apache License 2.0
307 stars 172 forks source link

Whether to ask permission should be passed as a parameter #64

Open fatadel opened 2 years ago

fatadel commented 2 years ago

First of all, thanks a lot for the package!

Second of all, I have a small concern. It's very likely that asking for notification permissions is a part of an already existing UI/UX, but if the functionality of this package is invoked earlier, then that flow is broken. Since it is possible to manage the app badge even without the permissions being granted, I think it should be possible to invoke the methods of this package passing a parameter for not asking for the permissions (which could be set to ask by default as it is now).

FilledStacks commented 2 years ago

Any update on this issue being tackled?

eherbut commented 2 years ago

+1 Relevant request Need to have control over request permission dialog since it broke existing UX.

mikah22 commented 2 years ago

This is so important, not sure how this was missed. await FlutterAppBadger.isAppBadgeSupported(); should not ask for push notification permission. Right now when the app gets launched, I am using the above code to check whether the OS/phone supports app badges. It's such a bad user experience to ask for Notification permission as soon as the app launches.

vincent-hoodoo commented 2 years ago

I just spent a good two hours banging my head against the wall:

all because I couldn't understand why in the world the notification permission was asked on every launch...

At no point in time did it occur to me that it could come from this plugin, since all I was doing in the initialisation phase is call isAppBadgeSupported()

rafalbednarczuk commented 1 year ago

If the project's minimum iOS version is at least 10.0, then workaround is to treat the device as supporting badges without calling isAppBadgeSupported(). That's because badges are supported on iOS 10.0+ devices.

final isAppBadgeSupported = Platform.isIOS ? true : await FlutterAppBadger.isAppBadgeSupported()
amin79 commented 7 months ago

any updates?