Ios silent push notification when a user refuses to authorize Push

I am just starting a project with quiet push notifications for IOS so that the application can update in the background. One of the main points that is still unclear to me is what happens if the user completely rejects push messages? Does this mean rejection of silent push notifications from receiving by the application or only so that the device does not display messages to the user visually / audibly?

I understand that Apple has rules that the application should not only work with push permission, but I'm curious how to deal with this situation better.

+5
source share
2 answers

Edit: As stated in the comments, the silence of notifications does not depend on user rights. The only thing you need to take care of is the notification format:

Silent notifications require a special notification payload configuration. If your payload is not configured correctly, a notification may be displayed to the user instead of being sent to your application in the background. In your payload, ensure that the following conditions are met:

  • The aps payload dictionary should contain a content-available key with a value of 1 .
  • The aps payload dictionary should not contain alert , sound or badge keys.

Apple source


This was my old answer on pre-iOS 8 (and still for visible notifications that are not topics here): If the user rejects deleted notifications, this door closes. Technically, you can come up with your own background service, but it needs to be constantly run in the background, for example. through continuous use of GPS (a bad idea).

The best option is to convince the user to accept and ask at the right time. This article should give you an approximate direction to think about: http://techcrunch.com/2014/04/04/the-right-way-to-ask-users-for-ios-permissions/

0
source

The accepted answer is incorrect.

Silent notifications are delivered regardless of whether the user has granted permission for push notifications.

In iOS, tvOS, and watchOS, apps must have authorization to display alerts, play sounds, or the app icon icon in response to incoming notifications. An authorization request puts control over these interactions in the hands of a user who can submit or reject your request. The user can also change the authorization settings for your application later in the system settings.

Source: Apple Developer Documentation

0
source

Source: https://habr.com/ru/post/1207049/


All Articles