12/31/2
This commit is contained in:
@@ -13,11 +13,6 @@ import '../../constant/style.dart';
|
||||
import '../../main.dart';
|
||||
import '../../views/home/profile/promos_passenger_page.dart';
|
||||
import '../../views/home/Captin/orderCaptin/order_request_page.dart';
|
||||
import '../../views/widgets/elevated_btn.dart';
|
||||
import '../functions/crud.dart';
|
||||
import '../functions/launch.dart';
|
||||
import '../home/captin/map_driver_controller.dart';
|
||||
import '../home/map_passenger_controller.dart';
|
||||
|
||||
class FirebaseMessagesController extends GetxController {
|
||||
final fcmToken = FirebaseMessaging.instance;
|
||||
@@ -203,19 +198,19 @@ class FirebaseMessagesController extends GetxController {
|
||||
}
|
||||
// If the app is in the background or terminated, show a system tray message
|
||||
RemoteNotification? notification = message.notification;
|
||||
AndroidNotification? android = message.notification?.android;
|
||||
AndroidNotification? android = notification?.android;
|
||||
// if (notification != null && android != null) {
|
||||
if (notification != null && android != null) {
|
||||
print('onMessageOpenedApp: ${notification.title} ${notification.body}');
|
||||
// print('onMessageOpenedApp: ${notification.title} ${notification.body}');
|
||||
if (message.data.isNotEmpty) {
|
||||
if (message.notification!.title!.contains('Order')) {
|
||||
var myListString = message.data['DriverList'];
|
||||
print(myListString);
|
||||
print('9999999999999myListString999999999999999');
|
||||
// print(myListString);
|
||||
// print('9999999999999myListString999999999999999');
|
||||
var myList = jsonDecode(myListString) as List<dynamic>;
|
||||
driverToken = myList[14].toString();
|
||||
update();
|
||||
print('driverToken==============$driverToken');
|
||||
// print('driverToken==============$driverToken');
|
||||
Get.to(() => OrderRequestPage(), arguments: {
|
||||
'myListString': myListString,
|
||||
'DriverList': myList,
|
||||
@@ -223,8 +218,8 @@ class FirebaseMessagesController extends GetxController {
|
||||
});
|
||||
} else if (message.notification!.title!.contains('Apply Ride')) {
|
||||
var passengerList = message.data['passengerList'];
|
||||
print(passengerList);
|
||||
print('9999999999999my Apply Ride 999999999999999');
|
||||
// print(passengerList);
|
||||
// print('9999999999999my Apply Ride 999999999999999');
|
||||
var myList = jsonDecode(passengerList) as List<dynamic>;
|
||||
driverID = myList[2].toString();
|
||||
|
||||
@@ -313,18 +308,18 @@ class FirebaseMessagesController extends GetxController {
|
||||
});
|
||||
|
||||
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
||||
print(
|
||||
'onMessageOpenedApp: ${message.notification!.title} ${message.notification!.body}');
|
||||
// print(
|
||||
// 'onMessageOpenedApp: ${message.notification!.title} ${message.notification!.body}');
|
||||
RemoteNotification? notification = message.notification;
|
||||
if (message.data.isNotEmpty) {
|
||||
if (message.notification!.title!.contains('Order')) {
|
||||
if (notification!.title!.contains('Order')) {
|
||||
var myListString = message.data['DriverList'];
|
||||
print(myListString);
|
||||
print('9999999999999myListString999999999999999');
|
||||
// print(myListString);
|
||||
// print('9999999999999myListString999999999999999');
|
||||
var myList = jsonDecode(myListString) as List<dynamic>;
|
||||
driverToken = myList[14].toString();
|
||||
update();
|
||||
print('driverToken==============$driverToken');
|
||||
// print('driverToken==============$driverToken');
|
||||
Get.to(() => OrderRequestPage(), arguments: {
|
||||
'myListString': myListString,
|
||||
'DriverList': myList,
|
||||
@@ -332,8 +327,8 @@ class FirebaseMessagesController extends GetxController {
|
||||
});
|
||||
} else if (message.notification!.title!.contains('Apply Ride')) {
|
||||
var passengerList = message.data['passengerList'];
|
||||
print(passengerList);
|
||||
print('9999999999999my Apply Ride 999999999999999');
|
||||
// print(passengerList);
|
||||
// print('9999999999999my Apply Ride 999999999999999');
|
||||
var myList = jsonDecode(passengerList) as List<dynamic>;
|
||||
driverID = myList[2].toString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user