Push notification fixes

merge-requests/400/head
haroon amjad 4 years ago
parent eeb20073cb
commit 0a90791aca

@ -38,7 +38,7 @@
</intent> </intent>
</queries> </queries>
<application <application
android:name="io.flutter.app.FlutterApplication" android:name=".Application"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:label="Dr. Alhabib"> android:label="Dr. Alhabib">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -171,24 +171,11 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
height: 25.0, height: 25.0,
thickness: 1.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( Texts(
TranslationBase.of(context).companyName, TranslationBase.of(context).companyName + ": " + model.insuranceApproval[index].companyName.toString(),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 17.5, fontSize: 17.5,
), ),
Divider( Divider(
color: Colors.black, color: Colors.black,
height: 25.0, height: 25.0,

@ -265,125 +265,124 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// if (results[Permission.calendar].isGranted) ; // if (results[Permission.calendar].isGranted) ;
}); });
// requestPermissions();
// }); // });
// //
// //_firebase Background message handler // //_firebase Background message handler
// _firebaseMessaging.configure( _firebaseMessaging.configure(
// // onMessage: (Map<String, dynamic> message) async { onMessage: (Map<String, dynamic> message) async {
// // showDialog("onMessage: $message"); // showDialog("onMessage: $message");
// // print("onMessage: $message"); print("onMessage: $message");
// // print(message); print(message);
// // print(message['name']); print(message['name']);
// // print(message['appointmentdate']); print(message['appointmentdate']);
// //
// // if (Platform.isIOS) { if (Platform.isIOS) {
// // if (message['is_call'] == "true") { if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context); var route = ModalRoute.of(context);
// //
// // if (route != null) { if (route != null) {
// // print(route.settings.name); print(route.settings.name);
// // } }
// //
// // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message); Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// // print(myMap); print(myMap);
// // LandingPage.isOpenCallPage = true; LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) { if (!isPageNavigated) {
// // isPageNavigated = true; isPageNavigated = true;
// // Navigator.push( Navigator.push(
// // context, context,
// // MaterialPageRoute( MaterialPageRoute(
// // builder: (context) => IncomingCall( builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData))) incomingCallData: LandingPage.incomingCallData)))
// // .then((value) { .then((value) {
// // isPageNavigated = false; isPageNavigated = false;
// // }); });
// // } }
// // } else { } else {
// // print("Is Call Not Found iOS"); print("Is Call Not Found iOS");
// // } }
// // } else { } else {
// // print("Is Call Not Found iOS"); print("Is Call Not Found iOS");
// // } }
// //
// // if (Platform.isAndroid) { if (Platform.isAndroid) {
// // if (message['data'].containsKey("is_call")) { if (message['data'].containsKey("is_call")) {
// // var route = ModalRoute.of(context); var route = ModalRoute.of(context);
// //
// // if (route != null) { if (route != null) {
// // print(route.settings.name); print(route.settings.name);
// // } }
// //
// // Map<String, dynamic> myMap = Map<String, dynamic> myMap =
// // new Map<String, dynamic>.from(message['data']); new Map<String, dynamic>.from(message['data']);
// // print(myMap); print(myMap);
// // LandingPage.isOpenCallPage = true; LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) { if (!isPageNavigated) {
// // isPageNavigated = true; isPageNavigated = true;
// // Navigator.push( Navigator.push(
// // context, context,
// // MaterialPageRoute( MaterialPageRoute(
// // builder: (context) => IncomingCall( builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData))) incomingCallData: LandingPage.incomingCallData)))
// // .then((value) { .then((value) {
// // isPageNavigated = false; isPageNavigated = false;
// // }); });
// // } }
// // } else { } else {
// // print("Is Call Not Found Android"); print("Is Call Not Found Android");
// // } LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']);
// // } else { }
// // print("Is Call Not Found Android"); } else {
// // } print("Is Call Not Found Android");
// // }, }
// // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, },
// // onLaunch: (Map<String, dynamic> message) async { onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// // print("onLaunch: $message"); onLaunch: (Map<String, dynamic> message) async {
// // showDialog("onLaunch: $message"); print("onLaunch: $message");
// // }, // showDialog("onLaunch: $message");
// // onResume: (Map<String, dynamic> message) async { },
// // print("onResume: $message"); onResume: (Map<String, dynamic> message) async {
// // print(message); print("onResume: $message");
// // print(message['name']); print(message);
// // print(message['appointmentdate']); print(message['name']);
// // print(message['appointmentdate']);
// // showDialog("onResume: $message");
// // // showDialog("onResume: $message");
// // if (Platform.isIOS) {
// // if (message['is_call'] == "true") { if (Platform.isIOS) {
// // var route = ModalRoute.of(context); if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context);
// // if (route != null) {
// // print(route.settings.name); if (route != null) {
// // } print(route.settings.name);
// // }
// // Map<String, dynamic> myMap =
// // new Map<String, dynamic>.from(message); Map<String, dynamic> myMap =
// // print(myMap); new Map<String, dynamic>.from(message);
// // LandingPage.isOpenCallPage = true; print(myMap);
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); LandingPage.isOpenCallPage = true;
// // if (!isPageNavigated) { LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // isPageNavigated = true; if (!isPageNavigated) {
// // Navigator.push( isPageNavigated = true;
// // context, Navigator.push(
// // MaterialPageRoute( context,
// // builder: (context) => IncomingCall( MaterialPageRoute(
// // incomingCallData: LandingPage.incomingCallData))) builder: (context) => IncomingCall(
// // .then((value) { incomingCallData: LandingPage.incomingCallData)))
// // isPageNavigated = false; .then((value) {
// // }); isPageNavigated = false;
// // } });
// // } else { }
// // print("Is Call Not Found iOS"); } else {
// // } print("Is Call Not Found iOS");
// // } else { }
// // print("Is Call Not Found iOS"); } else {
// // } print("Is Call Not Found iOS");
// // }, }
// ); },
);
} }
showDialogs(String message) { showDialogs(String message) {

@ -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 androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', 'HMG', importance: Importance.Max, priority: Priority.High, ticker: 'ticker', vibrationPattern: _vibrationPattern());
var iOSPlatformChannelSpecifics = IOSNotificationDetails(); var iOSPlatformChannelSpecifics = IOSNotificationDetails();
var platformChannelSpecifics = NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); 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);
});
}); });
} }

@ -196,6 +196,7 @@ dependencies:
flutter_animarker: ^1.0.0 flutter_animarker: ^1.0.0
auto_size_text: ^2.0.1 auto_size_text: ^2.0.1
equatable: ^1.2.5 equatable: ^1.2.5
signalr_core: ^1.0.8
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save