Silent Push Notifications
Remote notifications allow you to notify your app when important events occur. You might have new instant messages to deliver, breaking news alerts to send, or the latest episode of your user’s favorite TV show ready for him or her to download for offline viewing. Remote notifications are great for sporadic but immediately important content, where the delay between background fetches might not be acceptable. Remote Notifications can also be much more efficient than Background Fetch, as your application only launches when necessary. However, remote notifications are limited by the system and cannot automatically launch your application if the user has force-quit it.
A Remote Notification is really just a normal Push Notification with the
content-available flag set. You might send a push with an alert message informing the user that something has happened, while you update the UI in the background. But Remote Notifications can also be silent, containing no alert message or sound, used only to update your app’s interface or trigger background work. You might then post a local notification when you’ve finished downloading or processing the new content.
Silent push notifications are rate-limited, so don’t be afraid of sending as many as your application needs. iOS and the APNs servers will control how often they are delivered, and you won’t get into trouble for sending too many. If your push notifications are throttled, they might be delayed until the next time the device sends a keep-alive packet or receives another notification.
Sending Remote Notifications
To send a remote notification, set the
content-available flag in a push notification payload. When you’re sending a Remote Notification, you might also want to include some data in the notification payload, so your application can reference the event. This could save you a few networking requests and increase the responsiveness of your app.
content-available flag can be set in the Braze dashboard (pictured below) as well as within our User API.
Use Silent Remote Notifications to Trigger Background Work
Silent remote notifications can wake your app from a “Suspended” or “Not Running” state, to update content or run certain tasks without notifying your users. To send a silent remote push notification, you just need to set up the
content-available flag with no message nor sound. Please set up your app’s background mode to enable
remote notifications under the “Capabilities” tab in your project settings.
Enabling background mode for remote notifications is required for Braze’s Uninstall Tracking feature.
Even with the remote notifications background mode enabled, the system will not launch your app into the background if the user has force-quit the application. The user must explicitly launch the application or reboot the device before the app can be automatically launched into the background by the system. For more information, please refer to Apple’s documentation on Background Execution and
iOS Silent Notifications Limitations
The iOS operating system may gate notifications for some features. Please note that if you are experiencing difficulties with these features, the iOS’s silent notifications gate might be the cause.
Braze has several features which rely on iOS Silent Push Notifications:
|Uninstall Tracking||User receives a silent, nightly uninstall tracking push.|
|Geofences||Silent syncing of geofences from server to device.|