25-10-5/1
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user