flutter_attribution_plugin 1.0.0 copy "flutter_attribution_plugin: ^1.0.0" to clipboard
flutter_attribution_plugin: ^1.0.0 copied to clipboard

Flutter plugin providing access to Apple Search Ads Attribution Token (iOS) and Google Play Install Referrer URL (Android).

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_attribution_plugin/flutter_attribution_plugin.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 value = "Loading...";

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

  Future<void> load() async {
    try {
      if (Platform.isIOS) {
        value =
        await AttributionPlugin.getIosAttributionToken();
      } else {
        value =
        await AttributionPlugin.getAndroidReferrerUrl();
      }
    } catch (e) {
      value = e.toString();
    }

    debugPrint(value);

    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text(value),
        ),
      ),
    );
  }
}
0
likes
0
points
28
downloads

Publisher

verified publisherinphinit.space

Weekly Downloads

Flutter plugin providing access to Apple Search Ads Attribution Token (iOS) and Google Play Install Referrer URL (Android).

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_attribution_plugin

Packages that implement flutter_attribution_plugin