Browse SDKs · React Native
SDKsReact Native

Set global message reception

Set the global message reception option with the OpenIM React Native SDK.

Copy

globalRecvMsgOpt controls the current account's global message reception option. Use setSelfInfo() to update the field:

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

Parameter description

Enum valueNumeric valueDescription
MessageReceiveOptType.Normal0Receive messages normally and allow notifications.
MessageReceiveOptType.NotNotify2Receive messages without notifications.

After the setting is updated, the current-user information is delivered through OnSelfInfoUpdated. See Update your profile for the listener example.

The global message reception option applies to the account. A conversation can also have its own message reception setting.