Created
July 24, 2019 10:43
-
-
Save shishirthedev/9241c01582425b8566394f5eaefa1845 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// Using Device Info Package................ | |
Future<String> _getId() async { | |
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); | |
if (Theme.of(context).platform == TargetPlatform.iOS) { | |
IosDeviceInfo iosDeviceInfo = await deviceInfo.iosInfo; | |
return iosDeviceInfo.identifierForVendor; // unique ID on iOS | |
} else { | |
AndroidDeviceInfo androidDeviceInfo = await deviceInfo.androidInfo; | |
return androidDeviceInfo.androidId; // unique ID on Android | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment