onChannelChanged, onMessageReceived do not trigger when app in background or lockscreen

When my phone lock the screen, I cannot receive any event handler new group channel added. (onChanelChanged or onMessageReceived )
Do we have any solution to update list channel when app in background or lockscreen.

Device: iOS / android
Platform: React native
Language: typescript
Sendbird package: “sendbird”: “3.1.9”

@uday.bhaskar Could you help take a look?

Hi @zdungx

React-Native operates in a JavaScript thread rather than a native one, so the JavaScript thread itself generally doesn’t run when the app moves to the background.

To notify the SDK when the app moves to the background, the sdk.setBackgroundState / sdk.setForegroundState API is provided. By using the mentioned API and collection, you can receive and handle events that occurred while the app was in the background when it returns to the foreground.

For more information, you can refer to the following documentation:

Hi @Airen_Kang

Thank you for your reply.

Could we receive these events when the app running in the background?
Or these events will occur when the app resumes in the foreground from background mode?
And is it work for android and ios?

anyway let me try it.