|
|
|
|
@ -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;
|
|
|
|
|
|