-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to handle permissions in a unified way for iOS & Android? #181
Comments
Hi @younesouhbi Thanks for your feedback ! You're right, notification permission handling is currently asymmetric. I think I will ask for Android notification when Alarm.set is called, like in iOS. In my opinion it's better this way because:
What do you think ? |
Thank you for your reply! I would say that there are advantages & disadvantages to this. Let me start with the advantages: Advantage: making the permission request contextual can help the user better understand why the permission is being requested, however, I also think that users are now accustomed to permissions being requested from apps, especially an app that schedules alarms. What is suspicious and confusing is when a calculator app wants to access the user's contacts for example :) This means that while contextualizing the permission request is good, I don't think it's needed in this case. Disadvantage 1: when the permission is requested at the moment of doing something, it interrupts the flow of what is being done. Personally, as a user, when I set out to perform an action, I don't like being distracted by "side quests". Imagine the user is trying to set an alarm for a specific date & time, then the permission request pops up, now they forgot which date or time they were trying to set an alarm for. Disadvantage 2: if there are multiple permissions and the plugin asks for each permission as it is requested, it might become annoying as it interrupts the user multiple times. Disadvantage 3: what if the app that uses the plugin cannot function without the permission? In this case, it might be better that the user doesn't waste their time if they are not willing to grant the permission. If said permission is only requested as it is needed, then the user might invest time in an app only to stumble upon the permission request and realizing the app doesn't work for them. It might be frustrating and it happened to me several times with various apps. Disadvantage 4: from a developer standpoint, it might be better to let devs manage the permissions themselves and concentrate on what the purpose of the plugin is, which if I understand correctly is: setting alarms and letting you know when one is triggered. In my app for example, I would prefer to have an initial screen that informs the user of all the required permissions and why they are needed before they even get to the home screen. Other developers might prefer to do it as needed. Still, removing permission handling from the plugin might be better. This way, all devs know that before calling the plugin APIs, they need to have the needed permissions granted or things will fail. How they manage that is their responsibility. So, all in all, I kind of lean towards another direction ;) |
@younesouhbi Thank you so much for your feedback ! It looks like it would be better to remove the permission request from the plugin then ! There is one thing you might need to know about notifications: for the android part I use a foreground service for triggering the alarm. It allows me to make the alarm work even if the app is in the background or killed. In order to use this foreground service, it is required by android to have a notification linked to it. Documentation here. I'll add to my to do list: remove iOS notification permission request. Sounds good ? |
@younesouhbi I realized I will have to wait to release version |
@gdelataillade Thank you for your reply. I have managed to remove the notification permission request from iOS. Here is the modified code for the NotificationManager.swift, in case someone wants to do the same thing:
This works in iOS. Thank you |
Again, thank you for this plugin, it's really helpful.
Right now, for iOS, the notification permission seems to be requested internally by the plugin. However, for Android, the example you provide uses the Permission Handler plugin to check and request for permissions. This makes a bit inconvenient and asymmetric.
Since the permission check/request is done after Alarm.init, I think it would be better to just pass the desired config to it, and have it do the permission checks/requests, or, if it's too much, just let the devs handle permissions themselves.
Thank you
The text was updated successfully, but these errors were encountered: