iOS Silent Push Notifications

Imad Ali Mohammad
2 min readMar 7, 2018

When you send a Silent push notification and if app is suspended then the system wakes up or launches your app and puts it into the background running state before calling the method but if the app is killed by user manually then it will not wakeup. They can be used to inform the application of new content without having the user informed. Instead of displaying a notification alert, the application will be awakened in background

Silent notifications are not meant as a way to keep your app awake in the background beyond quick refresh operations, nor are they meant for high priority updates. APNs treats background update notifications as low priority and may throttle their delivery altogether if the total number becomes excessive. The actual limits are dynamic and can change based on conditions, but try not to send more than a few notifications per hour.

To support a Silent notification, make sure that the payload’s aps dictionary includes the content-available key with a value of 1. If there are user-visible updates that go along with the background update, you can set the alert, sound, or badge keys in the aps dictionary, as appropriate.

When a background update notification is delivered to the user’s device, iOS wakes up your app in the background and gives it up to 30 seconds to run. In iOS, the system delivers background update notifications by calling the application:didReceiveRemoteNotification:fetchCompletionHandler: method of your app delegate. Use that method to initiate any download operations needed to fetch new data. Processing remote notifications in the background requires that you add the appropriate background modes to your app.

To configure your app to process background update notifications

To support silent remote notifications, add the remote-notification value to the UIBackgroundModes array in your Info.plist file. To learn more about this array, see UIBackgroundModes.

<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
  1. In the Project Navigator, select your project.
  2. In the editor, select your iOS app target.
  3. Select the Capabilities tab.
  4. Enable the Background Modes capability.
  5. Enable the Remote notifications background mode.
Xcode App capabilities → Background modes
JSON payload for Silent Push notifications:
{
"aps" = {
"content-available" : 1,
"sound" : ""
};
// You can add custom key-value pair here...
}

Thats it, Now you can update the data using the Silent push notifications.

--

--

Imad Ali Mohammad

Senior iOS Engineer, Passionate about coding and building amazing apps.