In-app Chat
On this page

Protocol

2026-07-06
ZPNsManagerZPNsNotificationCenterDelegate

ZPNsManager

Details

ZPNsManager SDK main class.

Declared in ZPNs.h

Methods

getVersion

static
getVersion
+ (NSString *)getVersion;
Gets the SDK's version number.
Declared in ZPNs.h

If you encounter an abnormality during the running of the SDK, you can submit the problem, log and other information to the ZEGO technical staff to locate and troubleshoot. Developers can also collect current SDK version information through this API, which is convenient for App operation statistics and related issues.

  • When to call:Any time.
  • Caution:None.
  • Available since:1.0.0
  • Restrictions:None.

SDK version.

setPushConfig

static
setPushConfig
+ (void)setPushConfig:(ZPNsConfig) config;
Set push Settings for each vendor.
Declared in ZPNs.h

Parameters

NameTypeDescription
configZPNsConfig

Details

Set push Settings for each vendor.

  • Use cases:Developers need to use this method to set up configurations pushed by vendors.
  • Caution:Called when vendor push needs to be set.
  • Available since:2.0.0 or later.

shared

static
shared
+ (ZPNs *)getInstance;
Get the ZPNs instance.
Declared in ZPNs.h
  • Supported Versions:2.0.0 and above. Detailed Description: When using the ZPNs SDK, developers shall directly call this API to obtain the internal singleton object instead of creating and maintaining the object on their own.
  • Calling Timing:Any time.
  • Usage Restrictions:None.
  • Caution:This method must be used to get the ZPNs singleton object when utilizing ZPNs.

SDK singleton object for subsequent API calls

setZPNsNotificationCenterDelegate:

setZPNsNotificationCenterDelegate:
- (void)on<K extends keyof ZPNsEventHandler>:() delegate;
Set the callback for ZPNs push event notifications.

Parameters

NameTypeDescription
delegateA callback object that implements the ZPNs callback protocol.
  • Supported versions:2.0.0 and above. Detailed description: Configure event notification callbacks to listen for callbacks such as successful ZPNs registration events and push notification clicks.
  • Usage restrictions:None.

setDeviceToken

setDeviceToken
- (void)setDeviceToken:(NSData *) deviceToken :(BOOL) isProduct;
Use this method to pass deviceToken into ZPNs and get PushID.
Declared in ZPNs.h

Parameters

NameTypeDescription
deviceTokenNSData *
isProductBOOL

Details

Use this method to pass deviceToken into ZPNs and get PushID.

  • Use cases:This method should be used after the official iOS interface didRegisterForRemoteNotificationsWithDeviceToken trigger, and on this interface will be incoming deviceToken parameters. When to call /Trigger: Official iOS interface didRegisterForRemoteNotificationsWithDeviceToken trigger after use.
  • Caution:The isProduct Boolean value for this method is false for development and true for production.
  • Available since:2.0.0 or later.

setVoipToken

setVoipToken
- (void)setVoipToken:(NSData *) deviceToken :(BOOL) isProduct;
Declared in ZPNs.h

Parameters

NameTypeDescription
deviceTokenNSData *
isProductBOOL

registerAPNs

registerAPNs
- (void)registerAPNs;
This method is used to register vendor offline push.
Declared in ZPNs.h

This method is used to register vendor offline push.

  • Use cases:This method is called when a developer needs to use offline push.
  • Available since:ZPNs 2.0.0 or later.

unregisterAPNs

unregisterAPNs
- (void)unregisterAPNs;
Call this method to de-register when offline push is not required.
Declared in ZPNs.h

Call this method to de-register when offline push is not required.

  • Use cases:This method can be called to de-register when a user clicks a close message notification within the application. When to call /Trigger: Called when de-registration is required.
  • Caution:It needs to be called after [registerPush] is called.
  • Available since:2.0.0 or later.

addLocalNotificationWithContent:trigger:withCompletionHandler:

addLocalNotificationWithContent:trigger:withCompletionHandler:
deprecated
- (void)addLocalNotificationWithContent:(UNMutableNotificationContent *) content trigger:(UNTimeIntervalNotificationTrigger *) trigger withCompletionHandler:(void (^)(NSError *__nullable error)) completionHandler;
Add a local push notification.
Declared in ZPNs.h

Parameters

NameTypeDescription
contentUNMutableNotificationContent *Please refer to Apple's official documentation UNMutableNotificationContent.
triggerUNTimeIntervalNotificationTrigger *Please refer to Apple's official documentation UNTimeIntervalNotificationTrigger.
completionHandlervoid (^)(NSError *__nullable error)

Details

When the developer's App is in the foreground or has just been pushed to the background and is not frozen, the background will not send offline pushes if the background does not perceive that the user is offline. At this time, if the developer needs to supplement the push notification, he can use this interface to manually send a local push message to the device.

Deprecated
This API deprecated since ZPNs 2.4.0, please use another [addLocalNotificationRequest] instead.

addLocalNotificationRequest:withCompletionHandler:

addLocalNotificationRequest:withCompletionHandler:
- (void)addLocalNotificationRequest:(UNNotificationRequest *) request withCompletionHandler:(void (^)(NSError *__nullable error)) completionHandler;
Add a local push notification.
Declared in ZPNs.h

Parameters

NameTypeDescription
requestUNNotificationRequest *Please refer to Apple's official documentation UNNotificationRequest.
completionHandlervoid (^)(NSError *__nullable error)The block to execute with the results. Please refer to Apple's official documentation.

Details

When the developer's App is in the foreground or has just been pushed to the background and is not frozen, the background will not send offline pushes if the background does not perceive that the user is offline. At this time, if the developer needs to supplement the push notification, he can use this interface to manually send a local push message to the device.

setBadge:

setBadge:
- (void)setBadge:(int) badge;
Reports the number of corners of the current App to the ZPNs server through this interface.
Declared in ZPNs.h

Parameters

NameTypeDescription
badgeintThe value to be set.
  • Available since
    version 2.6.0 or later. Description
    the number of corners of the current App to the ZPNs server through this interface. When the app is offline, the ZPNs changes based on the previously reported corner mark number.
  • Use cases:When the local corner of the developer is changed, this interface is called to report the change. Default value
    the receiver does not report the badge, the corner mark will not be modified when the push is sent. When to call /Trigger
    can be called at any time, but the actual time reported to the background is after pushID has successfully registered and the user has logged in, and before logging out.
  • Caution:Badge cannot be less than 0.
  • Restrictions:There is no single interface frequency limit. Currently, you need to configure this interface only for iOS.

ZPNsNotificationCenterDelegate

Details

Declared in ZPNs.h

Methods

onRegistered

onRegistered
- (void)onRegistered:(NSString *) pushID;
Declared in ZPNs.h

Parameters

NameTypeDescription
pushIDNSString *
  • Available since:2.0.0.

ZPNsNotificationCenter:didReceiveNotificationResponse:userInfo:withCompletionHandler:

ZPNsNotificationCenter:didReceiveNotificationResponse:userInfo:withCompletionHandler:
- (void)ZPNsNotificationCenter:didReceiveNotificationResponse:userInfo:withCompletionHandler:;
Declared in ZPNs.h

ZPNsNotificationCenter:willPresentNotification:userInfo:withCompletionHandler:

ZPNsNotificationCenter:willPresentNotification:userInfo:withCompletionHandler:
- (void)ZPNsNotificationCenter:(UNUserNotificationCenter *) center willPresentNotification:(UNNotification *) notification userInfo:(NSDictionary *) userInfo withCompletionHandler:(void (^)(UNNotificationPresentationOptions)) completionHandler;
Declared in ZPNs.h

Parameters

NameTypeDescription
centerUNUserNotificationCenter *
notificationUNNotification *
userInfoNSDictionary *
completionHandlervoid (^)(UNNotificationPresentationOptions)

Previous

Class

Next

Enum

On this page

Back to top