Mobile push
ChatUI SDK lets you inject push title, body, and payload fields before a message is sent by registering setPushConfigHook on NCChatUIApplication. Mobile apps can then show richer offline notifications.
Register the hook
Call setPushConfigHook on your NCChatUIApplication instance. The SDK invokes the hook before send and uses the returned object as push configuration.
TypeScript
import type { PushConfigHook } from '@nexconn/chatui';
const hook: PushConfigHook = (message) => {
return {
pushTitle: `New message from ${message.senderUserId}`,
pushContent: message.content?.text ?? '[Message]',
pushData: JSON.stringify({ messageId: message.messageId }),
iOSConfig: {
// Fill per Nexconn Chat push fields and your product needs
},
androidConfig: {
// Fill per Nexconn Chat push fields and your product needs
},
};
};
app.setPushConfigHook(hook);
The hook type is PushConfigHook; it returns a PushConfig object aligned with the @nexconn/chat send pipeline (see the exported types). The message argument is ChatUIMessageModel.
tip
For full push field semantics, read the Nexconn Chat API reference and the push topics in the Help Center.