notifyDriver method
Implementation
notifyDriver(BuildContext context) async {
RFN.Remoting.Message.onMessage((RemoteMessage message) {
driverDetails = DriverDetails(
message.data['name'],
message.data['lat'],
CoordinateRF(double.parse(message.data['lat']),
double.parse(message.data['lng'])));
status = RequestStatus.success;
notifyListeners();
}, context);
status = RequestStatus.loading;
notifyListeners();
String token =
"fvY6Ojg2QFG9XaEULec88k:APA91bGj1q6FvY6jQgHECdZumiwJPga2INQ0VqCYedELX7Yns6TzgUIkjd76JoIonSozAW3xc-B6W0W6PuWYFPeb0YRECbeGkLbo52nT3GOdREqiqyk_wulM_PuU0uBWjd3dk21u2-W5";
String? fcmToken = await FirebaseMessaging.instance.getToken();
// debugPrint(token);
for (var element in availableDriverList) {
// if (element.registrationId == "2e8c2c14-6832-4c71-964a-f868ca74c489") {
RFN.Remoting.Message
.send(msg: "New Ride Request", fcmToken: token, data: {
"Name": "rakib",
"fcm": fcmToken,
"lat": pickupLocation.lat,
"lng": pickupLocation.lng
});
break;
//}
}
}