|
|
|
|
@ -317,7 +317,6 @@ class PushNotificationHandler {
|
|
|
|
|
|
|
|
|
|
final voIPKit = FlutterIOSVoIPKit.instance;
|
|
|
|
|
|
|
|
|
|
late Timer timeOutTimer;
|
|
|
|
|
bool isTalking = false;
|
|
|
|
|
|
|
|
|
|
var data = {
|
|
|
|
|
@ -390,9 +389,7 @@ class PushNotificationHandler {
|
|
|
|
|
try {
|
|
|
|
|
log('🎈 example: onDidRejectIncomingCall $uuid - $callerId');
|
|
|
|
|
await voIPKit.endCall();
|
|
|
|
|
await voIPKit.dispose();
|
|
|
|
|
await FlutterCallkitIncoming.endAllCalls();
|
|
|
|
|
timeOutTimer.cancel();
|
|
|
|
|
// Cleanup on reject with API call
|
|
|
|
|
if (_currentCallId != null) {
|
|
|
|
|
await _endCallAndCleanup(_currentCallId!, isDeclined: true);
|
|
|
|
|
@ -410,7 +407,7 @@ class PushNotificationHandler {
|
|
|
|
|
|
|
|
|
|
String zoomSessionID = callerId.split("_").sublist(0, callerId.split("_").length - 1).join("_");
|
|
|
|
|
|
|
|
|
|
await voIPKit.acceptIncomingCall(callerState: CallStateType.idle);
|
|
|
|
|
await voIPKit.acceptIncomingCall(callerState: CallStateType.calling);
|
|
|
|
|
await voIPKit.callConnected();
|
|
|
|
|
|
|
|
|
|
// Cleanup on accept - cancel timer and reset flags
|
|
|
|
|
@ -418,16 +415,15 @@ class PushNotificationHandler {
|
|
|
|
|
_callTimeoutTimer = null;
|
|
|
|
|
_isCallInProgress = false;
|
|
|
|
|
_currentCallId = null;
|
|
|
|
|
await Future.delayed(Duration(milliseconds: 1500)).then((val) async {
|
|
|
|
|
await Future.delayed(Duration(milliseconds: 2000)).then((val) async {
|
|
|
|
|
await voIPKit.endCall();
|
|
|
|
|
await voIPKit.dispose();
|
|
|
|
|
await FlutterCallkitIncoming.endAllCalls();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await Utils.saveStringFromPrefs(CacheConst.zoomRoomID, zoomSessionID);
|
|
|
|
|
|
|
|
|
|
Utils.removeFromPrefs(CacheConst.isAppOpenedFromCall);
|
|
|
|
|
Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
|
|
|
|
|
// Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
|
|
|
|
|
Navigator.pushReplacementNamed(
|
|
|
|
|
// context,
|
|
|
|
|
GetIt.instance<NavigationService>().navigatorKey.currentContext!,
|
|
|
|
|
|