diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 685602d..830efb7 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -21,7 +21,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 30
+ 31
CFBundleSignature
????
CFBundleURLTypes
@@ -36,7 +36,7 @@
CFBundleVersion
- 4.0.01
+ 4.0.02
FirebaseAppDelegateProxyEnabled
NO
GMSApiKey
diff --git a/lib/controller/firebase/firbase_messge.dart b/lib/controller/firebase/firbase_messge.dart
index 47493bb..a79c80b 100644
--- a/lib/controller/firebase/firbase_messge.dart
+++ b/lib/controller/firebase/firbase_messge.dart
@@ -420,7 +420,7 @@ class FirebaseMessagesController extends GetxController {
// });
// }
// }
-
+//android/app/src/main/res/raw/iphone_ringtone.wav
void sendNotificationToPassengerToken(
String title, body, token, List map) async {
try {
@@ -458,6 +458,43 @@ class FirebaseMessagesController extends GetxController {
}
}
+ void sendNotificationToPassengerTokenCALL(
+ String title, body, token, List map) async {
+ try {
+ final response = await http.post(
+ Uri.parse('https://fcm.googleapis.com/fcm/send'),
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Authorization': 'key=${AK.serverAPI}'
+ },
+ body: jsonEncode({
+ 'notification': {
+ 'title': title,
+ 'body': body,
+ 'sound': 'iphone_ringtone.wav'
+ },
+ 'data': {
+ 'passengerList': map,
+ },
+ 'priority': 'high',
+ 'to': token,
+ }),
+ );
+
+ if (response.statusCode == 200) {
+ // Notification sent successfully
+ print('Notification sent successfully');
+ } else {
+ // Handle error response
+ print(
+ 'Failed to send notification. Status code: ${response.statusCode}');
+ }
+ } catch (e) {
+ // Handle other exceptions
+ print('sendNotification() error: $e');
+ }
+ }
+
void sendNotificationToAnyWithoutData(
String title, String body, String token) async {
try {
diff --git a/lib/controller/functions/call_controller.dart b/lib/controller/functions/call_controller.dart
index c67f0ea..8d2fe77 100644
--- a/lib/controller/functions/call_controller.dart
+++ b/lib/controller/functions/call_controller.dart
@@ -38,8 +38,8 @@ class CallController extends GetxController {
// Set up an instance of Agora engine
setupVoiceSDKEngine();
// join();
- FirebaseMessagesController().sendNotificationToPassengerToken(
- 'Call Income from Passenger',
+ FirebaseMessagesController().sendNotificationToPassengerTokenCALL(
+ 'Call Income',
'${'You have call from driver'.tr} ${box.read(BoxName.nameDriver)}',
Get.find().tokenPassenger,
[
@@ -79,8 +79,8 @@ class CallController extends GetxController {
},
onUserJoined: (RtcConnection connection, int remoteUid, int elapsed) {
// Get.snackbar("Remote user uid:$remoteUid joined the channel", '');
- status = '${Get.find().passengerName}'
- ' joined'
+ status = '${Get.find().passengerName} '
+ 'joined'
.tr;
remoteUid = remoteUid;
update();
@@ -88,7 +88,7 @@ class CallController extends GetxController {
onUserOffline: (RtcConnection connection, int? remoteUid,
UserOfflineReasonType reason) {
// Get.snackbar("Remote user uid:$remoteUid left the channel", '');
- status = 'Call left'.tr;
+ status = 'Call Left'.tr;
remoteUid = null;
update();
},
diff --git a/lib/controller/functions/crud.dart b/lib/controller/functions/crud.dart
index 4d1a7ea..8f53ebb 100644
--- a/lib/controller/functions/crud.dart
+++ b/lib/controller/functions/crud.dart
@@ -48,9 +48,9 @@ class CRUD {
required String uid,
}) async {
var uid = box.read(BoxName.phone) ?? box.read(BoxName.phoneDriver);
- var res = await http.get(
- Uri.parse(
- 'https://repulsive-pig-rugby-shirt.cyclic.app/token?channelName=$channelName'),
+ var res = await http.get(Uri.parse(
+ // 'https://repulsive-pig-rugby-shirt.cyclic.app/token?channelName=$channelName'),
+ 'https://orca-app-b2i85.ondigitalocean.app/token?channelName=$channelName'),
headers: {'Authorization': 'Bearer ${AK.agoraAppCertificate}'});
if (res.statusCode == 200) {
diff --git a/lib/controller/home/captin/map_driver_controller.dart b/lib/controller/home/captin/map_driver_controller.dart
index c686cab..b438d33 100644
--- a/lib/controller/home/captin/map_driver_controller.dart
+++ b/lib/controller/home/captin/map_driver_controller.dart
@@ -398,6 +398,15 @@ class MapDriverController extends GetxController {
'passengerID': passengerId,
'driverID': box.read(BoxName.driverID).toString(),
});
+
+ var res1 =
+ await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
+ 'paymentID': 'rideId$rideId',
+ 'amount': (costOfWaiting5Minute).toStringAsFixed(0),
+ 'paymentMethod': 'wait',
+ 'driverID': box.read(BoxName.driverID).toString(),
+ });
+ print(res1);
if (res != 'failure') {
Get.snackbar(
'You will get cost of your work for this trip'.tr,
@@ -515,6 +524,7 @@ class MapDriverController extends GetxController {
'passengerId': passengerId,
'rideId': rideId,
'price': price.toString(),
+ 'walletChecked': walletChecked
});
// Get.back();
// }
@@ -581,15 +591,19 @@ class MapDriverController extends GetxController {
? (i ~/ 60) +
(recentDistanceToDash *
Get.find().comfortPrice)
- : carType == 'Mashwari'
+ : carType == 'Delivery'
? (i ~/ 60) +
(recentDistanceToDash *
Get.find().deliveryPrice)
- : (i ~/ 60) +
- (recentDistanceToDash *
- Get.find()
- .mashwariPrice); // $1 for each minute + $4 for each km
- price = (price * .10) + price; // Add 10% tax
+ : carType == 'Rayeh Gai'
+ ? (i ~/ 60) +
+ (recentDistanceToDash *
+ Get.find().speedPrice)
+ : (i ~/ 60) +
+ (recentDistanceToDash *
+ Get.find()
+ .mashwariPrice); // $1 for each minute + $4 for each km
+ price = (price * double.parse(kazan)) + price; // Add 10% tax
speed = Get.find().speed * 3.6;
progressTimerRideBegin = i / durationOfRide;
remainingTimeTimerRideBegin = durationOfRide - i;
diff --git a/lib/controller/home/captin/order_request_controller.dart b/lib/controller/home/captin/order_request_controller.dart
index 5a58020..ae5a847 100644
--- a/lib/controller/home/captin/order_request_controller.dart
+++ b/lib/controller/home/captin/order_request_controller.dart
@@ -79,6 +79,22 @@ class OrderRequestController extends GetxController {
}
}
+ void getSQL() async {
+ DateTime today = DateTime.now();
+ int todayDay = today.day;
+
+ String driverId = box.read(BoxName.driverID).toString();
+
+ String customQuery = '''
+ SELECT *
+ FROM ${TableName.driverOrdersRefuse}
+ WHERE driver_id = '$driverId'
+ AND created_at LIKE '%$todayDay%'
+ ''';
+ List