25-10-5/1

This commit is contained in:
Hamza-Ayed
2025-10-08 13:14:07 +03:00
parent 1cc66029a3
commit 482c1296bc
22 changed files with 770 additions and 559 deletions

View File

@@ -29,6 +29,7 @@ import '../../constant/api_key.dart';
import '../../constant/char_map.dart';
import '../../constant/colors.dart';
import '../../print.dart';
import '../firebase/notification_service.dart';
import 'encrypt_decrypt.dart';
import 'tts.dart';
import 'upload_image.dart';
@@ -105,12 +106,20 @@ class AI extends GetxController {
NotificationController().showNotification(
"Code approved".tr, "Code approved".tr, 'tone2', '');
// Notification text with dynamic token
Get.put(FirebaseMessagesController()).sendNotificationToDriverMAP(
'You have received a gift token!'.tr,
'for '.tr + box.read(BoxName.phoneDriver).toString(),
jsonDecode(res)['message'][0]['token'].toString(),
[],
'tone2', // Type of notification
// Get.put(FirebaseMessagesController()).sendNotificationToDriverMAP(
// 'You have received a gift token!'.tr,
// 'for '.tr + box.read(BoxName.phoneDriver).toString(),
// jsonDecode(res)['message'][0]['token'].toString(),
// [],
// 'tone2', // Type of notification
// );
NotificationService.sendNotification(
target: jsonDecode(res)['message'][0]['token'].toString(),
title: 'You have received a gift token!'.tr,
body: 'for '.tr + box.read(BoxName.phoneDriver).toString(),
isTopic: false, // Important: this is a token
tone: 'tone2',
driverList: [],
);
} else {
// mySnackeBarError(