SDKsReact Native
Set global message reception
Configure account-level default message reception and do-not-disturb options using the OpenIM React Native SDK.
Configure the account-level message notification policy:
await OpenIMSDK.setSelfInfo({
globalRecvMsgOpt: MessageReceiveOptType.NotNotify,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
globalRecvMsgOpt | MessageReceiveOptType | Yes | Global message reception option. |
MessageReceiveOptType values:
| Enum value | Value | Description |
|---|---|---|
MessageReceiveOptType.Normal | 0 | Receive messages and notify normally. |
MessageReceiveOptType.NotNotify | 2 | Receive messages silently without notification (Do Not Disturb). |
Return value
A resolved Promise confirms that the global message reception option was updated on the server.
The change triggers the OnSelfInfoUpdated event. Reconcile local state using userID and update globalRecvMsgOpt. For event listener details, see Update current user profile.
Global reception is an account-level fallback; individual conversations can override this behavior using per-conversation options as described in Set message receive options.
Was this page helpful?