Skip to content

Getting android id or uuid for iOS devices to uniquely identify users #1938

@FeodorFitsner

Description

@FeodorFitsner

Library to use: https://pub.dev/packages/device_info_plus

Discussed in #1935

Originally posted by icanhackyou October 10, 2023

Question

in dart we can get then device uuid (ios) or android id which is uinque to each and every device i am in a very big problem i identify the user based on their page.client_user_agent and page.client_ip but if two users are on same wifi network and are using same browser then i can't distinguish between two users and that is not good. But dart provides a way to handle this issue i have pasted the sample code for it is there any way to implement it in flet @ndonkoHenri @FeodorFitsner please help

Code sample

import 'package:device_info/device_info.dart';

String deviceId;

DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();

if (Platform.isAndroid) {
  AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
  deviceId = androidInfo.androidId; 
} else if (Platform.isIOS) {
  IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
  deviceId = iosInfo.identifierForVendor;
}

Error message

No response

------------------------------------------------------

  • I have searched for answers to my question both in the issues and in previous discussions.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions