Silent Push Notifications
Sometimes, you may want to use a Silent Push Notification to update content inside you app in the background. A silent push notification is defined as a push that does not have an alert, badge or sound, and just has Key-Value data.
iOS
Firstly, you need to enable Remote Notification in your capabilities screen. This is found by clicking your Target in Xcode, and then selecting Capabilities.
Next, you must implement application:didReceiveRemoteNotification:fetchCompletionHandler
to handle the push.
App must be in the background
To receive this callback, your app must be in the background. If the app has been swiped out of memory, or your phone has recently been rebooted, you will not receive this callback.
Android
To perform a similar action on Android, refer to Android Custom Notification Handling.
Updated 5 months ago