Our team is currently using the latest Zoom Video iOS SDK (v2.4.5). As part of our requirements, we need to leave the Zoom session whenever the user backgrounds the app. When we detect a backgrounding event, we call:
This works without any issues as long as no one is sharing their screen.
However, we’re running into a problem when another participant is sharing their screen. If a user backgrounds the app during an active screen share (from another user), then returns to the foreground and rejoins the session, the shared screen appears blank. At that point, there’s no way for the returning user to recover the screen share view.
This feels like an unintended behavior. In earlier SDK versions, calling leaveSession() handled this scenario cleanly, so it seems like the share helper state may not be fully reset when leaving a session during an active screen share.
Is there a recommended or more appropriate way to handle app backgrounding while another participant is sharing their screen?
Tagging @ekaansh.zoom, @boonjun.tan, and @gianni.zoom in case you have guidance.
Before I give you the right solution, I will need to find out more on your use case.
When the user leaves the session during app background mode, what is the intended behaviour that you would like the user to have when they move your app back to foreground?
Are you calling the join session again?
If yes, upon joining back the session, did you get the onUserShareStatusChanged callback triggered for the other person already sharing the screen?
1. When the app goes into the background, we call ZoomVideoSDK.shareInstance()?.leaveSession().
When the app returns to the foreground, we call joinSession() to rejoin.
If the participant who is not sharing their screen leaves the session, we call stopShare() on the local user (who was sharing), since there is no longer anyone to receive the shared content.
The issue is that this state change—specifically, that the local user has stopped sharing—is not propagated to the participant who left. When they rejoin, they do not receive the updated sharing state, and they see a grey screen.
2. Yes, we do call joinSession() again when the user returns.
3. When the previously disconnected participant rejoins, the Zoom internals still believe the local user is sharing, even though stopShare() was called while they were gone. Our code then calls startShare() again, and both users receive the onUserShareStatusChanged callback.
What is the recommended approach for managing the screen‑sharing state when a participant who is not sharing their screen leaves the session, but the local user is currently sharing and then they stop sharing when the participant who is not sharing their screen left
For your scenario, the onSinkSharingStatus callback will not be called on to the local user that has left the session before the remote user stop sharing. Hence in the UIView that the local user used to subscribe with the screen shared earlier on by the remote user should be dismiss/unsubscribe as well. Later on when the remote user starts resharing, then you can resubscribe it as the onSinkSharingStatus callback will be triggered.