iOS 7
Silent Push Notification
iOS Notifications
Apple iOS Issues
iOS Development

Silent Push Notification in iOS 7 does not work

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

Silent push notifications in iOS have been a valuable tool for developers who need to update an app's content or perform background operations without notifying the user. However, with the release of iOS 7, many developers started experiencing issues with silent push notifications. This article dives into the technical details of why these issues occur and how you can mitigate them.

Understanding Silent Push Notifications

Silent push notifications are different from standard push notifications, as they don’t automatically alert the user. Instead, they can wake an app up in the background to download data, update content, or perform tasks without user's direct engagement. This type of notification is particularly useful for content-heavy applications such as news apps or apps requiring regular data updates.

Functionality

Silent push notifications are implemented using `Remote Notifications` or `background fetch`. In iOS, when a silent push notification is sent, the system wakes up the app for a short period (usually 30 seconds) to execute pre-defined operations.

The key property in a silent push notification's payload is the `"content-available"` key, which should be set to 1. An example payload might look like this:

  • Background modes: Apps must declare the appropriate background modes capability (`fetch` or `remote-notification`) in their Info.plist file.
  • Power considerations: iOS tries to conserve energy by limiting what apps can do in the background. Apps may not be woken up if the battery level is low unless they are on a charger.
  • Network availability: If the device is in Airplane mode or the network is otherwise unavailable, silent pushes may not be delivered until connectivity is restored.
  • Priority changes: Silent notifications may be throttled if the system predicts that too many silent notifications do not enhance user experience.
  • Local Notifications: Use local notifications to verify that background execution code functions properly. While you cannot simulate a push directly, this ensures the business logic is correct.
  • Logging: Implement thorough logging to capture the app's state and responses when it receives background notifications. Tools like Apple's Console application can be invaluable for this purpose.
  • Delta Updates: Send only necessary data changes instead of the entire data set to reduce load and parsing overhead.
  • Backoff Strategies: Implement strategies to reduce network calls in poor network conditions or adjust polling intervals dynamically.

Related reading
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

All Rights Reserved.