24-12/27/1
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:sefer_driver/constant/api_key.dart';
|
||||
import 'package:sefer_driver/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:sefer_driver/views/widgets/error_snakbar.dart';
|
||||
import 'package:sefer_driver/views/widgets/mydialoug.dart';
|
||||
@@ -95,7 +96,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> fireBaseTitles(RemoteMessage message) async {
|
||||
if (message.notification!.title! == 'OrderSpeed'.tr) {
|
||||
if (message.notification!.title! == 'Order'.tr) {
|
||||
if (Platform.isAndroid) {
|
||||
notificationController.showNotification(
|
||||
message.notification!.title.toString(),
|
||||
@@ -398,61 +399,6 @@ class FirebaseMessagesController extends GetxController {
|
||||
}));
|
||||
}
|
||||
|
||||
// Future<dynamic> driverFinishTripDialoge(List<dynamic> driverList) {
|
||||
// return Get.defaultDialog(
|
||||
// title: 'Driver Finish Trip'.tr,
|
||||
// content: const DriverTipWidget(),
|
||||
// confirm: MyElevatedButton(
|
||||
// title: 'Yes'.tr,
|
||||
// onPressed: () async {
|
||||
// var tip = (Get.find<MapPassengerController>().totalPassenger) *
|
||||
// (double.parse(box.read(BoxName.tipPercentage.toString())));
|
||||
// var res = await CRUD().post(link: AppLink.addTips, payload: {
|
||||
// 'passengerID': box.read(BoxName.passengerID),
|
||||
// 'driverID': driverList[0].toString(),
|
||||
// 'rideID': driverList[1].toString(),
|
||||
// 'tipAmount': tip.toString(),
|
||||
// });
|
||||
// await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
||||
// 'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
// 'balance': ((-1) * tip).toString()
|
||||
// });
|
||||
|
||||
// await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
|
||||
// 'driverID': driverList[0].toString(),
|
||||
// 'paymentID': '${Get.find<MapPassengerController>().rideId}tip',
|
||||
// 'amount': (tip * 100).toString(),
|
||||
// 'paymentMethod': 'visa-tip',
|
||||
// });
|
||||
|
||||
// if (res != 'failure') {
|
||||
// FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
// 'You Have Tips',
|
||||
// '${'${tip.toString()}\$${' tips\nTotal is'.tr}'} ${tip + (Get.find<MapPassengerController>().totalPassenger)}',
|
||||
// driverList[2].toString(),
|
||||
// );
|
||||
// }
|
||||
// Get.to(() => RateDriverFromPassenger(), arguments: {
|
||||
// 'driverId': driverList[0].toString(),
|
||||
// 'rideId': driverList[1].toString(),
|
||||
// 'price': driverList[3].toString()
|
||||
// });
|
||||
// },
|
||||
// kolor: AppColor.greenColor,
|
||||
// ),
|
||||
// cancel: MyElevatedButton(
|
||||
// title: 'No,I want'.tr,
|
||||
// onPressed: () {
|
||||
// Get.to(() => RateDriverFromPassenger(), arguments: {
|
||||
// 'driverId': driverList[0].toString(),
|
||||
// 'rideId': driverList[1].toString(),
|
||||
// 'price': driverList[3].toString()
|
||||
// });
|
||||
// },
|
||||
// kolor: AppColor.redColor,
|
||||
// ));
|
||||
// }
|
||||
|
||||
void sendNotificationAll(String title, body, tone) async {
|
||||
// Get the token you want to subtract.
|
||||
String token = box.read(BoxName.tokenFCM);
|
||||
@@ -528,33 +474,6 @@ class FirebaseMessagesController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
// for (var i = 0; i < tokens.length; i++) {
|
||||
// http
|
||||
// .post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
|
||||
// headers: <String, String>{
|
||||
// 'Content-Type': 'application/json',
|
||||
// 'Authorization': 'key=${storage.read(key: BoxName.serverAPI}'
|
||||
// },
|
||||
// body: jsonEncode({
|
||||
// 'notification': <String, dynamic>{
|
||||
// 'title': title,
|
||||
// 'body': body,
|
||||
// 'sound': 'true'
|
||||
// },
|
||||
// 'priority': 'high',
|
||||
// 'data': <String, dynamic>{
|
||||
// 'click_action': 'FLUTTER_NOTIFICATION_CLICK',
|
||||
// 'id': '1',
|
||||
// 'status': 'done'
|
||||
// },
|
||||
// 'to': tokens[i],
|
||||
// }))
|
||||
// .whenComplete(() {})
|
||||
// .catchError((e) {
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
//android/app/src/main/res/raw/iphone_ringtone.wav
|
||||
void sendNotificationToPassengerToken(
|
||||
String title, body, token, List<String> map, String tone,
|
||||
{int retryCount = 2}) async {
|
||||
|
||||
Reference in New Issue
Block a user