Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On SDK configuration, interactor instance is created and has .none state. When Call screen is loaded, its start() method is called which executes some updates based on current interactor.state. When configure method is called before each engagement start (like we currently do in WidgetsSDK Testing app), CallViewModel.start() does nothing, because interactor.state is .none. But when WidgesSDK is configured once (for example on the app launch), the same interactor instance is used for all subsequent engagements. When you end first engagement (Chat/Audio/Video, probably CV also), interactor.state is .ended. Then if you start new Audio/Video engagement, CallViewModel.start() calls CallViewModel.call.end() method, which breaks something and connecting state becomes infinite. This commit fixes calling CallViewModel.call.end() on Audio/Video engagement start. Commit also make two engagement references weak to avoid retaining it when CoreSDK already released it from memory. The toggle (UISwitch) was added to Main screen, that provides the ability to disable/enable SDK configuration before each engagement. MOB-2730
- Loading branch information