From 396ea61086ebb6a1eb8a1d82a4f924ffde997047 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 8 Nov 2026 18:23:36 +0300 Subject: [PATCH] Android device id plugin changed --- lib/api/dashboard_api_client.dart | 10 +++++++--- pubspec.yaml | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/api/dashboard_api_client.dart b/lib/api/dashboard_api_client.dart index 05e4d325..6576100c 100644 --- a/lib/api/dashboard_api_client.dart +++ b/lib/api/dashboard_api_client.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'dart:developer'; import 'dart:io'; +import 'package:android_id/android_id.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:http/http.dart' as http; import 'package:device_info_plus/device_info_plus.dart'; @@ -282,9 +283,12 @@ class DashboardApiClient { String? deviceId = ""; // Generate a v4 (random) id if (Platform.isAndroid) { - AndroidDeviceInfo androidInfo = await DeviceInfoPlugin().androidInfo; - deviceId = await androidInfo.id; - deviceId = stringToBase64.encode(deviceId); + const _androidIdPlugin = AndroidId(); + deviceId = await _androidIdPlugin.getId() ?? "${(await DeviceInfoPlugin().androidInfo).id}${AppState().postParamsObject!.pUserName ?? ""}"; + + // AndroidDeviceInfo androidInfo = await DeviceInfoPlugin().androidInfo; + // deviceId = await androidInfo.id; + // deviceId = stringToBase64.encode(deviceId); deviceId = deviceId.length >= 50 ? deviceId.substring(0, 48) : deviceId; } else if (Platform.isIOS) { IosDeviceInfo iosInfo = await DeviceInfoPlugin().iosInfo; diff --git a/pubspec.yaml b/pubspec.yaml index c8811515..1be1e125 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,8 +17,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -#version: 3.7.1+300081 -version: 3.9.3+1 +version: 3.7.9+300089 +#version: 3.9.3+1 environment: sdk: ^3.7.0 @@ -59,6 +59,7 @@ dependencies: # platform_device_id_plus: ^1.0.7 # mobile_device_identifier: ^0.0.3 device_info_plus: ^13.2.0 + android_id: ^0.6.0 image_picker: ^1.1.2 file_picker: ^13.1.0 geolocator: ^14.1.1