diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 317134e2..911d3c9a 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -210,7 +210,7 @@ class ApiClientImp implements ApiClient { } // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 2101020; + // body['PatientID'] = 1018977; // body['PatientID'] = 53320; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; diff --git a/lib/core/utils/push_notification_handler.dart b/lib/core/utils/push_notification_handler.dart index 85643902..c8311e15 100644 --- a/lib/core/utils/push_notification_handler.dart +++ b/lib/core/utils/push_notification_handler.dart @@ -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().navigatorKey.currentContext!).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation()))); + // Navigator.of(GetIt.instance().navigatorKey.currentContext!).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation()))); Navigator.pushReplacementNamed( // context, GetIt.instance().navigatorKey.currentContext!, diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index d2e2737e..a11bd611 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -170,7 +170,7 @@ class _LandingPageState extends State { emergencyServicesViewModel.checkPatientERAdvanceBalance(); // myAppointmentsViewModel.getPatientAppointmentQueueDetails(); notificationsViewModel.initNotificationsViewModel(); - medicalFileViewModel.getPatientAllergiesList(); + // medicalFileViewModel.getPatientAllergiesList(); if (Utils.havePrivilege(122)) { insuranceViewModel.initInsuranceProvider(isFromHomePage: true); @@ -292,7 +292,7 @@ class _LandingPageState extends State { myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.initAppointmentsViewModel(); myAppointmentsViewModel.getPatientAppointments(true, false, isForTimeLine: true); - medicalFileViewModel.getPatientAllergiesList(); + medicalFileViewModel.getPatientAllergiesList(); // Refresh Appointments Data // habibWalletVM.initHabibWalletProvider(); // habibWalletVM.getPatientBalanceAmount(); @@ -312,6 +312,7 @@ class _LandingPageState extends State { // appointmentRatingViewModel.getAppointmentDetails( // appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!, // appointmentRatingViewModel.appointmentRatedList.last.projectID!, + // appointmentRatingViewModel.appointmentRatedList.last.clinicID!, // onSuccess: ((response) { // appointmentRatingViewModel.setClinicOrDoctor(false); // appointmentRatingViewModel.setTitle(LocaleKeys.rateDoctor.tr(context: context)); diff --git a/lib/presentation/tele_consultation/zoom/call_screen.dart b/lib/presentation/tele_consultation/zoom/call_screen.dart index 1c9db67a..cf46e765 100644 --- a/lib/presentation/tele_consultation/zoom/call_screen.dart +++ b/lib/presentation/tele_consultation/zoom/call_screen.dart @@ -327,6 +327,9 @@ class _CallScreenState extends State { // If no remote users remain, the other participant has left — end the session if (remoteUserList == null || remoteUserList.isEmpty) { + if (Platform.isIOS) { + await voIPKit.endCall(); + } await zoom.leaveSession(true); final navContext = GetIt.instance().navigatorKey.currentContext; if (navContext != null && Navigator.canPop(navContext)) { @@ -1297,6 +1300,9 @@ class _CallScreenState extends State { // } void onLeaveSession(bool isEndSession) async { + if (Platform.isIOS) { + await voIPKit.endCall(); + } await zoom.leaveSession(isEndSession); Navigator.pushAndRemoveUntil( context, @@ -1547,7 +1553,7 @@ class _CallScreenState extends State { multiCameraIndex: "0", videoAspect: VideoAspect.Original, fullScreen: false, - resolution: VideoResolution.Resolution180, + resolution: VideoResolution.Resolution720, ), ), );