This commit is contained in:
Hamza-Ayed
2023-10-02 06:58:46 +03:00
parent 0368a141d7
commit ca59d9e3b7
5 changed files with 32 additions and 33 deletions

View File

@@ -178,6 +178,12 @@ class FirebasMessagesController extends GetxController {
);
} else if (message.notification!.title!.contains('Promo')) {
Get.to(const PromosPassengerPage());
} else if (message.notification!.title == ('Ride Begin')) {
Get.snackbar(
'Trip Begin'.tr,
'by Passenger'.tr,
backgroundColor: AppColor.yellowColor,
);
}
}
});
@@ -464,21 +470,7 @@ class FirebasMessagesController extends GetxController {
}
}
void sendNotificationToDriverId(
String title,
body,
strin1,
strin2,
strin3,
strin4,
strin5,
strin6,
string7,
string8,
passengerName,
passengertoken,
passengerPhone,
token) async {
void sendNotificationToDriverId(String title, body, token) async {
http
.post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
headers: <String, String>{
@@ -491,21 +483,7 @@ class FirebasMessagesController extends GetxController {
'body': body,
'sound': 'true'
},
'data': {
'myList': jsonEncode([
strin1,
strin2,
strin3,
strin4,
strin5,
strin6,
string7,
string8,
passengerName,
passengertoken,
passengerPhone
]),
},
'data': {},
'priority': 'high',
'to': token,
}))

View File

@@ -214,7 +214,7 @@ class MapController extends GetxController {
box.read(BoxName.phone).toString(),
durationByPassenger.toString(),
distanceByPassenger.toString(),
paymentController.isWalletChecked.toString() //todo if it is work
paymentController.isWalletChecked.toString()
];
FirebasMessagesController().sendNotificationToDriverMAP(
'Order',