Browse SDKs · React Native
Platform
SDKsReact Native

Set global message reception

Configure account-level default message reception and do-not-disturb options using the OpenIM React Native SDK.

Copy

Configure the account-level message notification policy:

await OpenIMSDK.setSelfInfo({
  globalRecvMsgOpt: MessageReceiveOptType.NotNotify,
});

Parameters

ParameterTypeRequiredDescription
globalRecvMsgOptMessageReceiveOptTypeYesGlobal message reception option.

MessageReceiveOptType values:

Enum valueValueDescription
MessageReceiveOptType.Normal0Receive messages and notify normally.
MessageReceiveOptType.NotNotify2Receive 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.