enterAcceptedOfflineCall method
Due to some time-consuming and waiting operations, such as data loading or user login in the App. so in certain situations, it may not be appropriate to navigate to ZegoUIKitPrebuiltCall directly when ZegoUIKitPrebuiltCallInvitationService.init.
This is because the behavior of jumping to ZegoUIKitPrebuiltCall may be overwritten by some subsequent jump behaviors of the App. Therefore, manually navigate to ZegoUIKitPrebuiltCall using the API in App will be a better choice.
SO! please
-
set ZegoCallInvitationOfflineConfig.autoEnterAcceptedOfflineCall to false in ZegoUIKitPrebuiltCallInvitationService.init
-
call ZegoUIKitPrebuiltCallInvitationService.enterAcceptedOfflineCall after ZegoUIKitPrebuiltCallInvitationService.init done when your app finish loading(data or user login)
Implementation
void enterAcceptedOfflineCall() {
ZegoLoggerService.logInfo(
'try enterAcceptedOfflineCall',
tag: 'call-invitation',
subTag: 'page manager',
);
if (private.waitingEnterAcceptedOfflineCallWhenInitNotDone) {
ZegoLoggerService.logInfo(
'enterAcceptedOfflineCall, '
'will be call when init done',
tag: 'call-invitation',
subTag: 'page manager',
);
return;
}
if (!private._isInit) {
ZegoLoggerService.logInfo(
'enterAcceptedOfflineCall, '
'not init, please call after init done',
tag: 'call-invitation',
subTag: 'page manager',
);
private.waitingEnterAcceptedOfflineCallWhenInitNotDone = true;
return;
}
private._pageManager?.enterAcceptedOfflineCall();
}