25-10-5/1
This commit is contained in:
@@ -26,6 +26,7 @@ import '../../../views/auth/captin/otp_page.dart';
|
||||
import '../../../views/auth/captin/otp_token_page.dart';
|
||||
import '../../../views/auth/syria/pending_driver_page.dart';
|
||||
import '../../firebase/firbase_messge.dart';
|
||||
import '../../firebase/notification_service.dart';
|
||||
import '../../functions/encrypt_decrypt.dart';
|
||||
import '../../functions/package_info.dart';
|
||||
import '../../functions/secure_storage.dart';
|
||||
@@ -258,7 +259,7 @@ class LoginDriverController extends GetxController {
|
||||
update();
|
||||
await SecurityHelper.performSecurityChecks();
|
||||
// Log.print('(BoxName.emailDriver): ${box.read(BoxName.emailDriver)}');
|
||||
|
||||
// await getJWT();
|
||||
var res = await CRUD().get(link: AppLink.loginFromGoogleCaptin, payload: {
|
||||
'email': email ?? 'yet',
|
||||
'id': driverID,
|
||||
@@ -328,8 +329,11 @@ class LoginDriverController extends GetxController {
|
||||
// if (box.read(BoxName.emailDriver).toString() !=
|
||||
// '963992952235@intaleqapp.com') {
|
||||
if (token != 'failure') {
|
||||
if ((jsonDecode(token)['data'][0]['token'].toString()) !=
|
||||
box.read(BoxName.tokenDriver).toString()) {
|
||||
var serverData = jsonDecode(token);
|
||||
if ((serverData['data'][0]['token'].toString()) !=
|
||||
box.read(BoxName.tokenDriver).toString() ||
|
||||
serverData['data'][0]['fingerPrint'].toString() !=
|
||||
fingerPrint.toString()) {
|
||||
await Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'Device Change Detected'.tr,
|
||||
@@ -534,12 +538,20 @@ class LoginDriverController extends GetxController {
|
||||
if (token != 'failure') {
|
||||
if ((jsonDecode(token)['data'][0]['token']) !=
|
||||
(box.read(BoxName.tokenDriver))) {
|
||||
Get.put(FirebaseMessagesController()).sendNotificationToDriverMAP(
|
||||
'token change'.tr,
|
||||
'change device'.tr,
|
||||
(jsonDecode(token)['data'][0]['token']).toString(),
|
||||
[],
|
||||
'ding.wav');
|
||||
// Get.put(FirebaseMessagesController()).sendNotificationToDriverMAP(
|
||||
// 'token change'.tr,
|
||||
// 'change device'.tr,
|
||||
// (jsonDecode(token)['data'][0]['token']).toString(),
|
||||
// [],
|
||||
// 'ding.wav');
|
||||
NotificationService.sendNotification(
|
||||
target: (jsonDecode(token)['data'][0]['token']).toString(),
|
||||
title: 'token change',
|
||||
body: 'token change'.tr,
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'cancel',
|
||||
driverList: [],
|
||||
);
|
||||
Get.defaultDialog(
|
||||
title: 'you will use this device?'.tr,
|
||||
middleText: '',
|
||||
|
||||
Reference in New Issue
Block a user