6/30/1
This commit is contained in:
@@ -159,6 +159,12 @@ class FirebaseMessagesController extends GetxController {
|
||||
.showNotification('message From passenger'.tr, ''.tr, 'tone2');
|
||||
passengerDialog(message.notification!.body!);
|
||||
|
||||
update();
|
||||
} else if (message.notification!.title! == 'message From Driver'.tr) {
|
||||
NotificationController()
|
||||
.showNotification('message From passenger'.tr, ''.tr, 'tone2');
|
||||
passengerDialog(message.notification!.body!);
|
||||
|
||||
update();
|
||||
} else if (message.notification!.title! == 'RideIsBegin') {
|
||||
Get.find<MapPassengerController>().getBeginRideFromDriver();
|
||||
@@ -332,7 +338,9 @@ class FirebaseMessagesController extends GetxController {
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Hi ,I will go now'.tr,
|
||||
'I will go now'.tr,
|
||||
Get.find<MapPassengerController>().driverToken, []);
|
||||
Get.find<MapPassengerController>().driverToken,
|
||||
[],
|
||||
'ding.wav');
|
||||
Get.find<MapPassengerController>()
|
||||
.startTimerDriverWaitPassenger5Minute();
|
||||
|
||||
@@ -412,7 +420,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
'notification': <String, dynamic>{
|
||||
'title': title,
|
||||
'body': body,
|
||||
'sound': 'start.wav'
|
||||
'sound': 'ding.wav'
|
||||
},
|
||||
'priority': 'high',
|
||||
'data': <String, dynamic>{
|
||||
@@ -455,7 +463,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
// }
|
||||
|
||||
void sendNotificationToPassengerToken(
|
||||
String title, body, token, List<String> map) async {
|
||||
String title, body, token, List<String> map, String tone) async {
|
||||
try {
|
||||
final response = await http.post(
|
||||
Uri.parse('https://fcm.googleapis.com/fcm/send'),
|
||||
@@ -467,7 +475,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
'notification': <String, dynamic>{
|
||||
'title': title,
|
||||
'body': body,
|
||||
'sound': 'tone2.wav'
|
||||
'sound': tone
|
||||
},
|
||||
'data': {
|
||||
'passengerList': map,
|
||||
@@ -489,7 +497,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
}
|
||||
|
||||
void sendNotificationToAnyWithoutData(
|
||||
String title, String body, String token) async {
|
||||
String title, String body, String token, String tone) async {
|
||||
try {
|
||||
final response = await http.post(
|
||||
Uri.parse('https://fcm.googleapis.com/fcm/send'),
|
||||
@@ -501,7 +509,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
'notification': <String, dynamic>{
|
||||
'title': title,
|
||||
'body': body,
|
||||
'sound': 'promo.wav'
|
||||
'sound': tone
|
||||
},
|
||||
'data': <String, dynamic>{
|
||||
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
|
||||
@@ -524,8 +532,8 @@ class FirebaseMessagesController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
void sendNotificationToDriverMAP(
|
||||
String title, String body, String token, List<String> data) async {
|
||||
void sendNotificationToDriverMAP(String title, String body, String token,
|
||||
List<String> data, String tone) async {
|
||||
try {
|
||||
final response = await http.post(
|
||||
Uri.parse('https://fcm.googleapis.com/fcm/send'),
|
||||
@@ -538,7 +546,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
'title': title,
|
||||
'body': body,
|
||||
// 'sound': 'tone2.wav',
|
||||
'sound': 'order.wav'
|
||||
'sound': tone
|
||||
},
|
||||
'data': {
|
||||
'DriverList': data,
|
||||
|
||||
Reference in New Issue
Block a user