logo
In-app Chat
SDK Error Codes
Powered Byspreading
On this page

Implement silent push notifications

Introduction

Silent push notifications are a special type of remote notification, mainly used for data synchronization between the App running in the background and the server. For example: when the App is not active and the data within the App is outdated, the server will send a silent push notification, and the App will update the data without any user awareness.

Prerequisites

Before implementing silent push notifications, please make sure of the following:

Implementation steps

  1. Contact ZEGOCLOUD Technical Support to configure the resourceID for carrying silent push strategies.

  2. In scenarios where offline push notifications need to be sent (such as call invitation, offline push notification, etc.), fill in the ZIMPushConfig > resourceID with the pre-configured value obtained from ZEGOCLOUD Technical Support. Additionally, fill in the payload field according to the specific business scenario.

Untitled
pushConfig.resourcesID = @"resourcesID configured by ZEGOCLOUD Technical Support";
1
Copied!
  1. In the "AppDelegate.m" file, implement the didReceiveRemoteNotification method with your business logic. When the App is in the background and not killed, this method will be triggered. Sample code is as follows:
Untitled
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {

    // Call the completionHandler after the your logic is completed
}
1
Copied!
  1. Once the above steps are completed, you can send silent push notifications to others and receive silent push notifications from others.

Previous

Cross application offline push

Next

Custom notification icon