flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
10.98k stars 426 forks source link

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

Open FeodorFitsner opened 11 months ago

FeodorFitsner commented 11 months ago

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

Discussed in https://github.com/flet-dev/flet/discussions/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 ```python 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_ ### ------------------------------------------------------ - [X] I have searched for answers to my question both in the issues and in previous discussions.
JUDE122-MAX commented 11 months ago

I don't know if it'll work but you can implement kvdroid. Kvdroid is a python library written to access the android system using Python. For iOS, I have no idea on how to do that.