|
|
|
@ -60,7 +60,7 @@ class AppNotifications {
|
|
|
|
if (initialMessage != null) _handleMessage(initialMessage);
|
|
|
|
if (initialMessage != null) _handleMessage(initialMessage);
|
|
|
|
|
|
|
|
|
|
|
|
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
|
|
|
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
|
|
|
if (message != null) _handleMessage(message);
|
|
|
|
if (message != null) _handleMessage(message);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
FirebaseMessaging.onMessageOpenedApp.listen(_handleOpenApp);
|
|
|
|
FirebaseMessaging.onMessageOpenedApp.listen(_handleOpenApp);
|
|
|
|
@ -120,7 +120,7 @@ class AppNotifications {
|
|
|
|
Utils.saveStringFromPrefs("isAppOpendByChat", "true");
|
|
|
|
Utils.saveStringFromPrefs("isAppOpendByChat", "true");
|
|
|
|
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
|
|
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
|
|
} else if (message.data.isNotEmpty && message.data["messageType"] == 'call') {
|
|
|
|
} else if (message.data.isNotEmpty && message.data["messageType"] == 'call') {
|
|
|
|
if( Platform.isAndroid){
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
ChatVoipCall().showCallkitIncoming(uuid: const Uuid().v4(), data: message);
|
|
|
|
ChatVoipCall().showCallkitIncoming(uuid: const Uuid().v4(), data: message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -132,6 +132,7 @@ class AppNotifications {
|
|
|
|
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
|
|
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AndroidNotificationChannel channel = const AndroidNotificationChannel(
|
|
|
|
AndroidNotificationChannel channel = const AndroidNotificationChannel(
|
|
|
|
"high_importance_channel",
|
|
|
|
"high_importance_channel",
|
|
|
|
@ -145,7 +146,7 @@ Future<dynamic> backgroundMessageHandler(RemoteMessage message) async {
|
|
|
|
Utils.saveStringFromPrefs("isAppOpendByChat", "false");
|
|
|
|
Utils.saveStringFromPrefs("isAppOpendByChat", "false");
|
|
|
|
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
|
|
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
|
|
} else if (message.data.isNotEmpty && message.data["messageType"] == 'call') {
|
|
|
|
} 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);
|
|
|
|
ChatVoipCall().showCallkitIncoming(uuid: const Uuid().v4(), data: message, background: true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|