API | Description |
registerPush | Register for push service (must be called after the App user agrees to the Privacy Policy to use the push service). |
unRegisterPush | Unregister to disable push service. |
setRegistrationID | Set Push Device ID. RegistrationID is the unique identification ID of the push receiving device. By default, this ID is automatically generated when the push service is successfully registered, but you can also set it manually. Note! If you call this API, make sure to call it before registerPush .Use cases: If you have integrated both the Chat message service and the Push service on a device, and the user login Chat userID is assumed to be "user123", if you want to push messages to "user123", you need to call this interface to set the device identification ID as follows: Push.setRegistrationID("user123", () => {}); |
getRegistrationID | After successfully registering the push service, you can call this interface to obtain the unique identification ID of the push receiving device, which is the RegistrationID. |
getNotificationExtInfo | Upon receiving offline push notifications, click the notification bar to pull up the App, and call this interface to get the push extension information. |
addPushListener | Add a Push listener. |
removePushListener | Remove a Push listener. |
disablePostNotificationInForeground | When the app is in the foreground, turn on/off notification bar notifications (default is on). |
createNotificationChannel | Create a client notification channel. This API can implement custom ringtone feature on the Android platform. |
registerPush(SDKAppID, appKey, onSuccess, onError)
Parameters | Type | Description | Access Path |
SDKAppID | Number | SDKAppID for Push Service Push. | |
appKey | String | Client key for Push Service Push. | |
onSuccess | Function | Callback for successful push registration. | - |
onError | Function |undefined | Callback for failed push registration. | - |
unRegisterPush(onSuccess, onError)
Parameters | Type | Description |
onSuccess | Function | Callback for successful push unregistration. |
onError | Function |undefined | Callback for failed push unregistration. |
registerPush
.setRegistrationID(registrationID, onSuccess)
Parameters | Type | Description |
registrationID | String | Customized push ID identifier. |
onSuccess | Function | Callback after successfully setting the customized push ID identifier. |
setRegistrationID
interface to set the identifier ID, this interface will return the identifier ID you set, otherwise, it will return a random value generated by the Push SDK.getRegistrationID(onSuccess)
Parameters | Type | Description |
onSuccess | Function | Callback for successfully obtaining the push ID. |
getNotificationExtInfo(onSuccess)
Parameters | Type | Description |
onSuccess | Function | Callback for successfully getting the clicked pass-through content. |
addPushListener(eventName: string, listener: (data: any) => void);
Parameters | Type | Description |
eventName | String | Push Event Type. |
listener | Function | Push Event Handling Method. |
removePushListener(eventName: string, listener?: (data: any) => void);
Parameters | Type | Description |
eventName | String | Push Event Type. |
listener | Function | undefined | Push Event Handling Method. |
disablePostNotificationInForeground(disable: boolean);
Parameters | Type | Description |
disable | boolean | Turning On/Off Notification Bar Notifications When the App is in the Foreground, Default On: true: Turning off notification bar notifications when the app is in the foreground false: Turning on notification bar notifications when the app is in the foreground |
createNotificationChannel(options: any, onSuccess: (data: any) => void);
Parameters | Type | Description |
options.channelID | String | The ID of the custom channel. |
options.channelName | String | The name of the custom channel. |
options.channelDesc | String | undefined | The description of the custom channel. |
options.channelSound | String | undefined | The alert tone of the custom channel, audio file name without suffix. The audio file needs to be placed in MyReactNativeApp/android/app/src/main/res/raw .For example: options.channelSound = private_ring , which sets MyReactNativeApp/android/app/src/main/res/raw/private_ring.mp3 as the custom alert tone. |
onSuccess | Function | Callback function for successful API invocation. |
Was this page helpful?