diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 867a4e03..61472941 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -38,7 +38,7 @@ diff --git a/android/app/src/main/res/drawable/app_icon.png b/android/app/src/main/res/drawable/app_icon.png old mode 100644 new mode 100755 index c4cc798d..2d394f83 Binary files a/android/app/src/main/res/drawable/app_icon.png and b/android/app/src/main/res/drawable/app_icon.png differ diff --git a/assets/images/icon.png b/assets/images/icon.png new file mode 100644 index 00000000..e802ae3e Binary files /dev/null and b/assets/images/icon.png differ diff --git a/assets/images/new/icon.png b/assets/images/new/icon.png new file mode 100644 index 00000000..e802ae3e Binary files /dev/null and b/assets/images/new/icon.png differ diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index cb1f76ff..a69b2c16 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -171,24 +171,11 @@ class _InsuranceApprovalState extends State { height: 25.0, thickness: 1.0, ), -// Text( -// 'Company Name: ' + -// model.insuranceApproval[index] -// .companyName == -// null -// ? '000' -// : model -// .insuranceApproval[index].companyName, -// style: TextStyle( -// fontSize: 17.5, -// fontWeight: FontWeight.w600), -// ), Texts( - TranslationBase.of(context).companyName, + TranslationBase.of(context).companyName + ": " + model.insuranceApproval[index].companyName.toString(), fontWeight: FontWeight.w600, fontSize: 17.5, ), - Divider( color: Colors.black, height: 25.0, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index e4799a0d..5ec09a75 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -265,125 +265,124 @@ class _LandingPageState extends State with WidgetsBindingObserver { // if (results[Permission.calendar].isGranted) ; }); - // requestPermissions(); - // }); // // //_firebase Background message handler - // _firebaseMessaging.configure( - // // onMessage: (Map message) async { - // // showDialog("onMessage: $message"); - // // print("onMessage: $message"); - // // print(message); - // // print(message['name']); - // // print(message['appointmentdate']); - // // - // // if (Platform.isIOS) { - // // if (message['is_call'] == "true") { - // // var route = ModalRoute.of(context); - // // - // // if (route != null) { - // // print(route.settings.name); - // // } - // // - // // Map myMap = new Map.from(message); - // // print(myMap); - // // LandingPage.isOpenCallPage = true; - // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - // // if (!isPageNavigated) { - // // isPageNavigated = true; - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (context) => IncomingCall( - // // incomingCallData: LandingPage.incomingCallData))) - // // .then((value) { - // // isPageNavigated = false; - // // }); - // // } - // // } else { - // // print("Is Call Not Found iOS"); - // // } - // // } else { - // // print("Is Call Not Found iOS"); - // // } - // // - // // if (Platform.isAndroid) { - // // if (message['data'].containsKey("is_call")) { - // // var route = ModalRoute.of(context); - // // - // // if (route != null) { - // // print(route.settings.name); - // // } - // // - // // Map myMap = - // // new Map.from(message['data']); - // // print(myMap); - // // LandingPage.isOpenCallPage = true; - // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - // // if (!isPageNavigated) { - // // isPageNavigated = true; - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (context) => IncomingCall( - // // incomingCallData: LandingPage.incomingCallData))) - // // .then((value) { - // // isPageNavigated = false; - // // }); - // // } - // // } else { - // // print("Is Call Not Found Android"); - // // } - // // } else { - // // print("Is Call Not Found Android"); - // // } - // // }, - // // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, - // // onLaunch: (Map message) async { - // // print("onLaunch: $message"); - // // showDialog("onLaunch: $message"); - // // }, - // // onResume: (Map message) async { - // // print("onResume: $message"); - // // print(message); - // // print(message['name']); - // // print(message['appointmentdate']); - // // - // // showDialog("onResume: $message"); - // // - // // if (Platform.isIOS) { - // // if (message['is_call'] == "true") { - // // var route = ModalRoute.of(context); - // // - // // if (route != null) { - // // print(route.settings.name); - // // } - // // - // // Map myMap = - // // new Map.from(message); - // // print(myMap); - // // LandingPage.isOpenCallPage = true; - // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - // // if (!isPageNavigated) { - // // isPageNavigated = true; - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (context) => IncomingCall( - // // incomingCallData: LandingPage.incomingCallData))) - // // .then((value) { - // // isPageNavigated = false; - // // }); - // // } - // // } else { - // // print("Is Call Not Found iOS"); - // // } - // // } else { - // // print("Is Call Not Found iOS"); - // // } - // // }, - // ); + _firebaseMessaging.configure( + onMessage: (Map message) async { + // showDialog("onMessage: $message"); + print("onMessage: $message"); + print(message); + print(message['name']); + print(message['appointmentdate']); + + if (Platform.isIOS) { + if (message['is_call'] == "true") { + var route = ModalRoute.of(context); + + if (route != null) { + print(route.settings.name); + } + + Map myMap = new Map.from(message); + print(myMap); + LandingPage.isOpenCallPage = true; + LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + if (!isPageNavigated) { + isPageNavigated = true; + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => IncomingCall( + incomingCallData: LandingPage.incomingCallData))) + .then((value) { + isPageNavigated = false; + }); + } + } else { + print("Is Call Not Found iOS"); + } + } else { + print("Is Call Not Found iOS"); + } + + if (Platform.isAndroid) { + if (message['data'].containsKey("is_call")) { + var route = ModalRoute.of(context); + + if (route != null) { + print(route.settings.name); + } + + Map myMap = + new Map.from(message['data']); + print(myMap); + LandingPage.isOpenCallPage = true; + LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + if (!isPageNavigated) { + isPageNavigated = true; + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => IncomingCall( + incomingCallData: LandingPage.incomingCallData))) + .then((value) { + isPageNavigated = false; + }); + } + } else { + print("Is Call Not Found Android"); + LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']); + } + } else { + print("Is Call Not Found Android"); + } + }, + onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, + onLaunch: (Map message) async { + print("onLaunch: $message"); + // showDialog("onLaunch: $message"); + }, + onResume: (Map message) async { + print("onResume: $message"); + print(message); + print(message['name']); + print(message['appointmentdate']); + + // showDialog("onResume: $message"); + + if (Platform.isIOS) { + if (message['is_call'] == "true") { + var route = ModalRoute.of(context); + + if (route != null) { + print(route.settings.name); + } + + Map myMap = + new Map.from(message); + print(myMap); + LandingPage.isOpenCallPage = true; + LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + if (!isPageNavigated) { + isPageNavigated = true; + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => IncomingCall( + incomingCallData: LandingPage.incomingCallData))) + .then((value) { + isPageNavigated = false; + }); + } + } else { + print("Is Call Not Found iOS"); + } + } else { + print("Is Call Not Found iOS"); + } + }, + ); } showDialogs(String message) { diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index e0367ba3..f1c6442f 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -53,7 +53,9 @@ class LocalNotification { var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', 'HMG', importance: Importance.Max, priority: Priority.High, ticker: 'ticker', vibrationPattern: _vibrationPattern()); var iOSPlatformChannelSpecifics = IOSNotificationDetails(); var platformChannelSpecifics = NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload); + await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err){ + print(err); + }); }); } diff --git a/pubspec.yaml b/pubspec.yaml index 0d6b4756..8bc31cb1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -196,6 +196,7 @@ dependencies: flutter_animarker: ^1.0.0 auto_size_text: ^2.0.1 equatable: ^1.2.5 + signalr_core: ^1.0.8 dev_dependencies: flutter_test: