app_set_id 1.2.0 copy "app_set_id: ^1.2.0" to clipboard
app_set_id: ^1.2.0 copied to clipboard

Tiny Flutter plugin to retrieve the App Set ID (Android) or Identifier for Vendor (IDfV, iOS)

example/lib/main.dart

import 'dart:async';

import 'package:app_set_id/app_set_id.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _identifier = 'Loading...';
  final _appSetIdPlugin = AppSetId();

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String identifier;
    try {
      identifier = await _appSetIdPlugin.getIdentifier() ?? "Unknown";
    } on PlatformException {
      identifier = 'Failed to get identifier.';
    }

    if (!mounted) return;

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('App Set ID'),
        ),
        body: Center(
          child: Text('App Set ID: $_identifier\n'),
        ),
      ),
    );
  }
}
16
likes
160
pub points
91%
popularity

Publisher

verified publisher2312.nl

Tiny Flutter plugin to retrieve the App Set ID (Android) or Identifier for Vendor (IDfV, iOS)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on app_set_id