Skip to main content

Mobile Push Notifications

Global IM UIKit supports configuring push notification content to meet the display requirements of mobile apps when receiving push notifications.

Configuring Push Hooks​

The setPushConfigHook method is used to configure push hooks. The SDK will call this hook before sending a message to retrieve push configurations. You can use this method to configure the title, content, and other information of push notifications.

Code Example

kitApp.setPushConfigHook((message) => {
// message is the current message object being sent
return {
pushTitle: '',
pushContent: '',
pushData: '',
iOSConfig: {
// ...
},
androidConfig: {
// ...
},
};
});

For the return value data structure of the push hook, please refer to the IMLib IPushConfig interface definition.