Nguyen Huu
Nguyen Huu

Reputation: 333

Receive push notification when app in foreground after disable notification permission in settings

Although I disable notification permission in setting, still receive push notification when app in foreground AppDelegate::application(_:didReceiveRemoteNotification:fetchCompletionHandler:)[L:------------------didReceiveRemoteNotification [AnyHashable("aps"): { alert = { body = "Push payload body"; subtitle = "Test push notification"; title = "Push Hero"; }; }]------------------]

Upvotes: 1

Views: 82

Answers (1)

Geometry Dash
Geometry Dash

Reputation: 21

When the notification permissions are disabled, the system won't show notifications in the notification center or as banners. However, if the app is running in the foreground, the application(_:didReceiveRemoteNotification:fetchCompletionHandler:) method can still be called. This happens because the notification payload is delivered directly to the app when it is active.

Upvotes: 2

Related Questions