Skip to content

attriax/sdk-flutter

Repository files navigation

Attriax Flutter SDK

sdk-flutter/ is the Flutter SDK workspace for Attriax. Most production apps should depend on attriax_flutter, which is the main public package and the reference runtime for shared SDK behavior across Flutter, web, React, and Unity.

If you want the package-level guide, examples, and API-focused usage notes, start with attriax/README.md.

What To Install

For real app integrations, use attriax_flutter:

flutter pub add attriax_flutter

This workspace also contains the federated platform packages, the shared platform interface, and the generated internal API client, but most apps should not import those packages directly.

Quick Start

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:attriax_flutter/attriax.dart';

final navigatorKey = GlobalKey<NavigatorState>();

final attriax = Attriax(
	config: const AttriaxConfig(
		appToken: 'ax_your_app_token',
	),
);

Future<void> main() async {
	WidgetsFlutterBinding.ensureInitialized();
	await attriax.init();
	unawaited(processAttriaxStartup(attriax));
	runApp(const MyApp());
}

Future<void> processAttriaxStartup(Attriax attriax) async {
	final initialDeepLink = await attriax.deepLinks.waitForInitialDeepLink();
	final resolution = await initialDeepLink?.resolve();
	debugPrint(
		'${initialDeepLink?.uri.toString() ?? 'no deep link'} (found: ${resolution?.found ?? false})',
	);
}

MaterialApp(
	navigatorKey: navigatorKey,
	navigatorObservers: [
		AttriaxNavigationObserver(attriax: attriax),
	],
);

await attriax.recordPageView(
	'/checkout',
	pageClass: 'CheckoutPage',
	previousPageName: '/cart',
);

await attriax.recordPurchase(
	revenue: 9.99,
	currency: 'USD',
	productId: 'pro_monthly',
	transactionId: 'order_123',
	store: 'app_store',
);

await attriax.recordAdEvent(
	AttriaxAdEventType.impression,
	adNetwork: 'admob',
	adPlacement: 'level_complete',
	adFormat: 'rewarded',
);

What The Flutter SDK Covers

  • App-open attribution, deep-link resolution, and deferred deep-link handling.
  • Automatic or manual page tracking through AttriaxNavigationObserver and recordPageView(...).
  • Custom events, crash/error reporting, purchase revenue, ad revenue, and standardized ad lifecycle events.
  • Install-referrer access on Android when it is available.
  • Firebase and APNs token registration for uninstall-tracking flows.
  • Dynamic-link creation from the app runtime.

Platform Notes

  • Android and iOS are the primary mobile targets and have the strongest runtime support.
  • Web resolves the initial URL automatically in Dart.
  • Windows, macOS, and Linux can forward deep links into Attriax, but desktop URI handling remains more manual.
  • Host apps still own platform files such as Android App Links, iOS Associated Domains, FlutterDeepLinkingEnabled, and ATT messaging text like NSUserTrackingUsageDescription.

More Documentation

Development commands, example-app workflows, internal tester notes, and other workspace-maintainer guidance now live in the root ../AGENTS.md file instead of this consumer-facing README.

License

This repository and the publishable Flutter SDK packages ship under Apache-2.0. Each published package also includes its own LICENSE file so the license is preserved in the pub.dev archive.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors