Skip to content
A flutter plugin for getting the unique serial number for android and identifierForVendor in ios
Ruby Dart Java Swift Objective-C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
android
example
ios
lib clean up Sep 7, 2018
test
.packages
CHANGELOG.md
LICENSE
README.md
pubspec.lock
pubspec.yaml
unique_identifier.iml
unique_identifier_android.iml

README.md

Flutter Search Panel

pub package

A Flutter plugin to get the ANDROID_ID for android and identifierForVendor for iOS platforms.

Installing

dependencies:
  unique_identifier: ^0.0.3

Import

import 'package:unique_identifier/unique_identifier.dart';

How To Use

 dart String _identifier = 'Unknown';
  
 @override
 void initState() {
   super.initState();
   initUniqueIdentifierState();
 }

 Future<void> initUniqueIdentifierState() async {
   String identifier;
   try {
     identifier = await UniqueIdentifier.serial;
   } on PlatformException {
     identifier = 'Failed to get Unique Identifier';
   }

   if (!mounted) return;

   setState(() {
     _identifier = identifier;
   });
 }

 @override
 Widget build(BuildContext context) {
   return new MaterialApp(
     home: new Scaffold(
       appBar: new AppBar(
         title: const Text('Plugin example app'),
       ),
       body: new Center(
         child: new Text('Running on device with id: $_identifier\n'),
       ),
     ),
   );
 }

Bugs & Requests

If you encounter any bugs feel free to open an issue. Raise a ticket on github for suggestions. Pull request are also welcome.

Flutter

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

License

MIT License

You can’t perform that action at this time.