mixin27 / flutter_native_id

Flutter plugin for getting unique ID.

Home Page:https://pub.dev/packages/native_id

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NativeId Plugin (Android, iOS)

Pub Version License: MIT

Get current device unique id from within the flutter application.

Warning: In android, this plugin use the ANDROID_ID that can be change by user for the rooted device.

Installation 💻

❗ In order to start using native_id you must have the Flutter SDK installed on your machine.

Add native_id to your pubspec.yaml:

dependencies:
  native_id:

Install it:

flutter packages get

Usage

Import import 'package:native_id/native_id.dart';, instantiate NativeId and use the getId() or getUUID() methods.

Example:

Future<String> getNativeId() async {
    final nativeIdPlugin = NativeId();
    try {
      final nativeId = await nativeIdPlugin.getId();
      return nativeId ?? 'Unknown native id';
    } on PlatformException {
      return 'Failed to get nativeId';
    }
}

About

Flutter plugin for getting unique ID.

https://pub.dev/packages/native_id

License:MIT License


Languages

Language:Dart 47.5%Language:Kotlin 23.7%Language:Ruby 13.3%Language:Swift 10.8%Language:Objective-C 4.7%