The option to detect if the is in background automatically.

SendbirdChat by default tracks the Application state by being notified Activity#onResume() and Activity#onPause() event in the Application.

This enables connection is automatically made or closed when Application goes foreground or background respectively. This auto-detection renders Application can receive push notifications (FCM) without calling disconnect explicitly.

You can be notified when your Application goes foreground and connection is reestablished with ConnectionHandler.onReconnectSucceeded callback (refer to ConnectionHandler and addConnectionHandler).

If you want the Application not to act like in background so connection to still open, for instance when you start external gallery Activity to send photos from you Application, set this as false with such as call and then set true again at