This commit is contained in:
Hamza-Ayed
2024-05-31 19:19:32 +03:00
parent 794bc8fb24
commit cc76aa394f
8 changed files with 166 additions and 50 deletions

View File

@@ -211,6 +211,26 @@ class FirebaseMessagesController extends GetxController {
} catch (e) {
print('Error navigating to PassengerCallPage: $e');
}
} else if (message.notification!.title! == 'Call Income from Driver') {
try {
var myListString = message.data['passengerList'];
var driverList = jsonDecode(myListString) as List<dynamic>;
// if (Platform.isAndroid) {
NotificationController().showNotification(
'Call Income'.tr,
message.notification!.body!,
'iphone_ringtone',
);
// }
// Assuming GetMaterialApp is initialized and context is valid for navigation
Get.to(() => PassengerCallPage(
channelName: driverList[1].toString(),
token: driverList[0].toString(),
remoteID: driverList[2].toString(),
));
} catch (e) {
print('Error navigating to PassengerCallPage: $e');
}
} else if (message.notification!.title! == 'Call End') {
try {
var myListString = message.data['passengerList'];