Push Notification permissions inconsistency #502
Labels
c/permissions
Related to Permissions component.
c/push-notifications
Related to Push Notifications component.
Description
Push-notifications permissions are requested with hardcoded options, even though the options should probably be defined by PushNotificationService functionality:
https://github.com/Softeq/XToolkit.WhiteLabel/blob/master/Softeq.XToolkit.Permissions.iOS/PermissionsService.cs#L70-L78
Also, it seems like our implementation of checking push-notification permissions might have an issue: we take into account specific settings, not only authorization status
https://github.com/Softeq/XToolkit.WhiteLabel/blob/master/Softeq.XToolkit.Permissions.iOS/PermissionsService.cs#L54-L68
One thing is that settings are hardcoded, which is not good - again, seems like PushNotificationService should decide which settings are actually required. The second is that the logic itself might be a bit incorrect - if user grants permission for alert+sound, for instance, and then disables sounds in settings, then our implementation would say that notification permissions are denied, although it is not true and notifications would still be received and shown to user.
Steps to Reproduce
IPermissionsManager.CheckWithRequestAsync<NotificationsPermission>()
PushNotificationService
to handle push notificationsExpected Behavior
PushNotificationService
has all required options authorizedActual Behavior
Only
Alert
andSound
options are authorized alwaysPossible Fix
I would suggest to remove push-notification permissions from the Permissions project and implement it in the PushNotifications project (as a part of
IPushNotificationService
, or as a separate service?), and also rework check permissions logic.Basic Information
The text was updated successfully, but these errors were encountered: