6
votes

I am just starting a project with silent push notifications for IOS, to allow the app to update in the background. One basic point that is unclear to me so far is what happens if the user rejects push messaging entirely? Does that reject silent push notifications from being received by the app, or only cause the device not to display the messages to the user visually/audibly?

I realize apple has rules that an app should not only work if push is allowed, but I'm curious of how to best handle this situation.

2

2 Answers

3
votes

Edit: As stated out in the comments, silent notifications aren't affected by the user permissions. The only thing you have to take care of is the notifications format:

The sending of a silent notification requires a special configuration of the notification’s payload. If your payload is not configured properly, the notification might be displayed to the user instead of being delivered to your app in the background. In your payload, make sure the following conditions are true:

  • The payload’s aps dictionary must include the content-available key with a value of 1.
  • The payload’s aps dictionary must not contain the alert, sound, or badge keys.

Source Apple


This was my old answer true for pre-iOS 8 versions (and still is for visible notifications, which aren't topic here): If the user denies remote notifications, this door is closed. Technically you could think of your own background service, but this needs to run constantly in the background, e.g. via continuous GPS usage (bad idea).

A better option is to convince the user to accept and ask at the right moment in time. This article should give you a rough direction what to think about: http://techcrunch.com/2014/04/04/the-right-way-to-ask-users-for-ios-permissions/

1
votes

The accepted answer is incorrect.

Silent notifications are delivered regardless of whether or not the user has given permission for push notifications.

In iOS, tvOS, and watchOS, apps must have authorization to display alerts, play sounds, or badge the app’s icon in response to incoming notifications. Requesting authorization puts control of those interactions in the hands of the user, who can grant or deny your request. The user can also change the authorization settings for your app later in the system settings.

Source: Apple's Developer Documentation