From 104c93f95ae9ee1a3dd3f997cb738874c47253f7 Mon Sep 17 00:00:00 2001 From: Aamir-iMac Date: Thu, 4 May 2023 11:19:31 +0300 Subject: [PATCH] OnIos --- lib/classes/chat_call_kit.dart | 2 +- lib/classes/consts.dart | 4 ++-- lib/classes/notifications.dart | 7 ++++--- lib/provider/chat_call_provider.dart | 2 ++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/classes/chat_call_kit.dart b/lib/classes/chat_call_kit.dart index 651d006..ba60ecf 100644 --- a/lib/classes/chat_call_kit.dart +++ b/lib/classes/chat_call_kit.dart @@ -31,7 +31,7 @@ class ChatVoipCall { await ChatVoipCall().listenerEvent(); ALM.Response autoLoginData; SingleUserChatModel callerData; - // if(!background){} + // if(!background){} await initProviders(); if (data!.data["user_token_response"] == null || data.data["user_token_response"].isEmpty) { autoLoginData = ALM.Response.fromJson(AppState().getchatUserDetails!.response!.toJson()); diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 32b3fc7..f2f0610 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -3,8 +3,8 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; class ApiConsts { //static String baseUrl = "http://10.200.204.20:2801/"; // Local server // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server - static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server - // static String baseUrl = "https://hmgwebservices.com"; // Live server + //static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server + static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrlServices = baseUrl + "/Services/"; // server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; diff --git a/lib/classes/notifications.dart b/lib/classes/notifications.dart index 30736e3..dca7fae 100644 --- a/lib/classes/notifications.dart +++ b/lib/classes/notifications.dart @@ -60,7 +60,7 @@ class AppNotifications { if (initialMessage != null) _handleMessage(initialMessage); FirebaseMessaging.onMessage.listen((RemoteMessage message) { - if (message != null) _handleMessage(message); + if (message != null) _handleMessage(message); }); FirebaseMessaging.onMessageOpenedApp.listen(_handleOpenApp); @@ -120,7 +120,7 @@ class AppNotifications { Utils.saveStringFromPrefs("isAppOpendByChat", "true"); Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString()); } else if (message.data.isNotEmpty && message.data["messageType"] == 'call') { - if( Platform.isAndroid){ + if (Platform.isAndroid) { ChatVoipCall().showCallkitIncoming(uuid: const Uuid().v4(), data: message); } } @@ -132,6 +132,7 @@ class AppNotifications { Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString()); } } +} AndroidNotificationChannel channel = const AndroidNotificationChannel( "high_importance_channel", @@ -145,7 +146,7 @@ Future backgroundMessageHandler(RemoteMessage message) async { Utils.saveStringFromPrefs("isAppOpendByChat", "false"); Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString()); } else if (message.data.isNotEmpty && message.data["messageType"] == 'call') { - if( Platform.isAndroid) { + if (Platform.isAndroid) { ChatVoipCall().showCallkitIncoming(uuid: const Uuid().v4(), data: message, background: true); } } diff --git a/lib/provider/chat_call_provider.dart b/lib/provider/chat_call_provider.dart index c593cb1..81b6f1f 100644 --- a/lib/provider/chat_call_provider.dart +++ b/lib/provider/chat_call_provider.dart @@ -203,6 +203,7 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin { } if (_pc.connectionState == RTCPeerConnectionState.RTCPeerConnectionStateConnected) { _pc.dispose(); + _pc.close(); } isCallStarted = false; isVideoCall = false; @@ -225,6 +226,7 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin { } if (_pc.connectionState == RTCPeerConnectionState.RTCPeerConnectionStateConnected) { _pc.dispose(); + _pc.close(); } isCallStarted = false; isVideoCall = false;