|
|
|
|
@ -73,7 +73,7 @@ class AppNotifications {
|
|
|
|
|
if (initialMessage != null) _handleMessage(initialMessage);
|
|
|
|
|
|
|
|
|
|
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
|
|
|
|
if (message.notification != null) _handleMessage(message);
|
|
|
|
|
_handleMessage(message);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
FirebaseMessaging.onMessageOpenedApp.listen(_handleOpenApp);
|
|
|
|
|
@ -134,23 +134,26 @@ class AppNotifications {
|
|
|
|
|
Utils.saveStringFromPrefs("isAppOpendByChat", "false");
|
|
|
|
|
GetNotificationsResponseModel notification = GetNotificationsResponseModel();
|
|
|
|
|
|
|
|
|
|
notification.createdOn = DateUtil.getMonthDayYearDateFormatted(DateTime.now());
|
|
|
|
|
notification.messageTypeData = message.data['picture'];
|
|
|
|
|
notification.message = message.data['message'];
|
|
|
|
|
notification.notificationType = message.data["NotificationType"].toString();
|
|
|
|
|
if (message.data["NotificationType"] == "2") {
|
|
|
|
|
notification.videoURL = message.data["VideoUrl"];
|
|
|
|
|
}
|
|
|
|
|
if (message.notification != null) {
|
|
|
|
|
notification.createdOn = DateUtil.getMonthDayYearDateFormatted(DateTime.now());
|
|
|
|
|
notification.messageTypeData = message.data['picture'];
|
|
|
|
|
notification.message = message.data['message'];
|
|
|
|
|
notification.notificationType = message.data["NotificationType"].toString();
|
|
|
|
|
if (message.data["NotificationType"] == "2") {
|
|
|
|
|
notification.videoURL = message.data["VideoUrl"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future.delayed(Duration(seconds: 5), () {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) => NotificationsDetailsPage(
|
|
|
|
|
notification: notification,
|
|
|
|
|
Future.delayed(Duration(seconds: 5), () {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) => NotificationsDetailsPage(
|
|
|
|
|
notification: notification,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (message.data.isNotEmpty && message.data["messageType"] == 'chat') {
|
|
|
|
|
Utils.saveStringFromPrefs("isAppOpendByChat", "true");
|
|
|
|
|
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
|
|
|
@ -187,8 +190,6 @@ class AppNotifications {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const AndroidNotificationChannel channel = AndroidNotificationChannel(
|
|
|
|
|
|