Giter Site home page Giter Site logo

tomykho / appsflyer-flutter-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appsflyersdk/appsflyer-flutter-plugin

0.0 0.0 0.0 696 KB

Flutter Plugin for AppsFlyer SDK

License: MIT License

Java 27.38% Ruby 2.56% Objective-C 31.58% Dart 37.92% JavaScript 0.41% Shell 0.04% Kotlin 0.10%

appsflyer-flutter-plugin's Introduction

appsflyer_sdk

A Flutter plugin for AppsFlyer SDK.

pub package Coverage

๐Ÿ›  In order for us to provide optimal support, we would kindly ask you to submit any issues to [email protected]

When submitting an issue please specify your AppsFlyer sign-up (account) email , your app ID , reproduction steps, logs, code snippets and any additional relevant information.


Table of content


Supported Platforms

  • Android
  • iOS 8+

This plugin is built for

  • iOS AppsFlyerSDK v6.2.6

  • Android AppsFlyerSDK v6.2.0

Flutter 2.0 is supported from version 6.2.3+2, including null safety support!

The version 6.2.4-flutterv1 will use iOS SDK V6.2.4 with Flutter V1


In v6 of AppsFlyer SDK there are some api breaking changes:

Before v6 v6
trackEvent logEvent
stopTracking stop
validateAndTrackInAppPurchase validateAndLogInAppPurchase
Before v6.1.2+4 v6.1.2+4
validateAndTrackInAppPurchase validateAndTrackInAppIosPurchase/validateAndTrackInAppAndroidPurchase

Important notice

  • Switch ConversionData and OnAppOpenAttribution to be based on callbacks instead of streams since plugin version 6.0.5+2

In order to install the plugin, visit this page.


To start using AppsFlyer you first need to create an instance of AppsflyerSdk before using any other of our sdk functionalities.

AppsflyerSdk receives a map or AppsFlyerOptions object. This is how you can configure our AppsflyerSdk instance and connect it to your AppsFlyer account.

Example (using map):

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

Map appsFlyerOptions = { "afDevKey": afDevKey,
                "afAppId": appId,
                "isDebug": true};

AppsflyerSdk appsflyerSdk = AppsflyerSdk(appsFlyerOptions);

The next step is to call initSdk which have the optional boolean parameters registerConversionDataCallback, registerOnAppOpenAttributionCallback and registerOnDeepLinkingCallback which are set to true as default.

After we call initSdk we can use all of AppsFlyer SDK features.

Initialize the SDK to enable AppsFlyer to detect installations, sessions (app opens) ,updates and use all of our features.

appsflyerSdk.initSdk(
    registerConversionDataCallback: true,
    registerOnAppOpenAttributionCallback: true,
    registerOnDeepLinkingCallback: true
);

  1. Add #import <AppTrackingTransparency/AppTrackingTransparency.h> in your AppDelegate.m

  2. Add the ATT pop-up for IDFA collection so your AppDelegate.m will look like this:

-(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    [GeneratedPluginRegistrant registerWithRegistry:self];
    if (@available(iOS 14, *)) {
        [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
            //If you want to do something with the pop-up
        }];
    }
    return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
  1. Add Privacy - Tracking Usage Description inside your .plist file in Xcode.

  2. Optional: Set the timeToWaitForATTUserAuthorization property in the AppsFlyerOptions to delay the sdk initazliation for a number of x seconds until the user accept the consent dialog:

AppsFlyerOptions options = AppsFlyerOptions(
    afDevKey: DotEnv().env["DEV_KEY"],
    appId: DotEnv().env["APP_ID"],
    showDebug: true,
    timeToWaitForATTUserAuthorization: 30
    ); 

For more info visit our Full Support guide for iOS 14:

https://support.appsflyer.com/hc/en-us/articles/207032066#integration-33-configuring-app-tracking-transparency-att-support


Great installation and setup guides can be viewed here


see the full API available for this plugin.

appsflyer-flutter-plugin's People

Contributors

adamkoch avatar af-fess avatar af-margot avatar afdima avatar gm-appsflyer avatar mgonzalezc avatar misterfourtytwo avatar rostopira avatar roughike avatar sdurban avatar shaharaf avatar shaharc1990 avatar shinriyo avatar sokoloff06 avatar vagrantrobbie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.