analytics_hub_appsflyer 0.6.0 copy "analytics_hub_appsflyer: ^0.6.0" to clipboard
analytics_hub_appsflyer: ^0.6.0 copied to clipboard

Appsflyer provider for analytics_hub. Forwards LogEvent events to Appsflyer via the official SDK.

example/main.dart

import 'package:analytics_hub/analytics_hub.dart';
import 'package:analytics_hub_appsflyer/analytics_hub_appsflyer.dart';
import 'package:appsflyer_sdk/appsflyer_sdk.dart';

class ExampleEvent extends Event {
  const ExampleEvent({required this.exampleProperty})
    : super('example_log_event');

  final String exampleProperty;

  @override
  Map<String, Object?> get properties => {'example_property': exampleProperty};

  @override
  List<EventProvider> get providers => [
    const EventProvider(
      AppsflyerAnalyticsHubIdentifier(),
    ),
  ];
}

Future<void> main() async {
  // AppsFlyer SDK 7 exposes a shared singleton instead of a constructor.
  // Replace the placeholders with your actual dev key and app id, and keep
  // secrets out of source control.
  final appsFlyerSdk = AppsFlyerSdk.instance;

  await appsFlyerSdk.init(devKey: 'YOUR_DEV_KEY', appId: 'YOUR_APP_ID');

  // Initialization no longer sends a session: start once per readiness event.
  await appsFlyerSdk.registerSessionReadyListener(appsFlyerSdk.start);

  final hub = AnalyticsHub(
    providers: [
      AppsflyerAnalyticsHubProvider(
        appsFlyerSdk: appsFlyerSdk,
      ),
    ],
  );

  await hub.sendEvent(
    const ExampleEvent(exampleProperty: 'example_property'),
  );
}
0
likes
160
points
176
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Appsflyer provider for analytics_hub. Forwards LogEvent events to Appsflyer via the official SDK.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

analytics_hub, appsflyer_sdk

More

Packages that depend on analytics_hub_appsflyer