Giter Site home page Giter Site logo

diogocarlomagno / adobeairextension-appsflyer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appsflyersdk/adobeairextension-appsflyer

0.0 0.0 0.0 206.3 MB

Adobe Air Extension for AppsFlyer

ActionScript 18.59% Java 23.75% Objective-C 41.40% C 14.34% Shell 1.92%

adobeairextension-appsflyer's Introduction

AppsFlyer Adobe Air extension

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 , production steps, logs, code snippets and any additional relevant information.

Table of content


We have renamed the following APIs:

Old API New API
trackEvent logEvent
startTracking start
stopTracking stop
isTrackingStopped isStopped
setCustomerIdAndTrack startWithCUID
validateAndTrackInAppPurchase validateAndLogInAppPurchase

And removed the following ones:

  • trackAppLaunch -> no longer needed. See new init guide
  • sendDeepLinkData -> no longer needed

If you have used 1 of the removed APIs, please check the integration guide for the updated instructions

Supported platforms:

  • Android
  • iOS 6+

Based on:

  • iOS AppsFlyerSDK v6.2.4
  • Android AppsFlyerSDK v6.2.3

Built with:

  • SWF-version = 44
  • AIR SDK version = 33.1.1.217

Download the AppsFlyerAIRExtension.ane file from the bin folder Add the ANE to your project and make sure the IDE is marked to package it.

If the following was not added automatically please add it to the APP_NAME-app.xml:

<extensions> 
	<extensionID>com.appsflyer.adobeair</extensionID> 
</extensions>
  • On AppsFlyer's dashboard you will need to add "air." prefix to the package name as this is added automatically by Air. For example - an app with the package name "com.test.android" , should set the app id on AppsFlyer's Dashboard as "air.com.test.android".

  • Add the following permissions to Android Manifest (in the app description APP_NAME-app.xml):

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
  • Add the following metatag to Android Manifest within the application tag (in the app description APP_NAME-app.xml):
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

As a result, you should see your Manifest like this:

image

IMPORTANT
Due to some limitations in the ADT, after APK is built it is missing some important files.

To add those files (with the help of automated script):

  1. Place into single directory of your choice:
  1. Run ./af_apk_fix.sh and enter requested info when prompted

Here is what the script is doing. In case of any issues you can perform those steps manually:

  1. Decode the apk using apktool. This will create app_name folder.
    apktool d app_name.apk

  2. Download the AppsFlyer SDK jar/aar of the same version that was used in the apk

  3. Extract files a- and b- from the jar (by renaming jar into a zip) and place them into the folder with the decompiled apk to app_name/unknown/com/appsflyer/internal

  4. Edit apktool.yml by adding these lines under unknownFiles: like in the screenshot below:

com/appsflyer/internal/b-: '0'
com/appsflyer/internal/a-: '0'

image

  1. Build the apk back (will appear under app_name/dist folder)
    apktool b app

  2. Sign the apk
    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore myKeystore.keystore app_name/dist/app_name.apk myKey

  3. Zipalign the apk (to be able to upload to Google Play)
    zipalign -f -v 4 app_name/dist/app_name.apk app_name/dist/zipalign_app_name.apk

  4. Verify zipalignment
    zipalign -c -v 4 app_name/dist/zipalign_app_name.apk

  5. Your apk zipalign_app_name.apk is ready to use!

If you use Strict mode ANE, make sure not to call any IDFA related APIs listed below. They are still present in the ActionScript, but will cause an app to crash if invoked.
  • waitForATTUserAuthorization(timeout:int):void;

Import the AppsFlyer Extension into your project:

import AppsFlyerInterface;

Construct the AppsFlyer interface:

private static var appsFlyer:AppsFlyerInterface; 
appsFlyer = new AppsFlyerInterface();

(Optional) If you want to perform deep linking or access AppsFlyer conversion data from the application, register Conversion Listener:

appsFlyer.registerConversionListener();

Set the Developer key and iOS app ID and Initialise the SDK:

appsFlyer.appsFlyer.init("DevKey", "iOSAppID");

Initialise session reporting (automatically report app launches and background-to-foreground transitions) with DevKey and iOS app ID:

appsFlyer.start("DevKey", "iOSAppID");

Note:

If you don't target iOS as a platform, specifying iOSAppID ID is not required


Android: Create an intent-filter in the Android-Manifest.xml containing the required scheme/host/path properties. For additional reading on App-Links in Adobe Air: https://www.adobe.com/devnet/air/articles/android-app-links.html

iOS: Using URI schemes. For additional reading on URI schemes in iOS: https://help.adobe.com/en_US/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS901d38e593cd1bac354f4f7b12e260e3e67-8000

More on DeepLinks and AppsFlyer: OneLink™ Overview

In order to receive the relevant AppsFlyer information from the deep link used, register the following event listeners:

appsFlyer.addEventListener(AppsFlyerEvent.APP_OPEN_ATTRIBUTION, eventHandler); // success 
appsFlyer.addEventListener(AppsFlyerEvent.ATTRIBUTION_FAILURE, eventHandler); // error 

And handle the response in a corresponding event handler:

private function eventHandler(event:AppsFlyerEvent):void {
	log("AppsFlyer event: " + event.type + "; \nData: " + event.data);
}

In order to receive the conversion data for the current install, register the following event listeners:

appsFlyer.addEventListener(AppsFlyerEvent.INSTALL_CONVERSATION_DATA_LOADED, eventHandler); // success
appsFlyer.addEventListener(AppsFlyerEvent.INSTALL_CONVERSATION_FAILED, eventHandler); //error

And handle the response in a corresponding event handler:

private function eventHandler(event:AppsFlyerEvent):void {
	log("AppsFlyer event: " + event.type + "; \nData: " + event.data);
}

By default, IMEI and Android ID are not collected by the SDK if the OS version is higher than KitKat (4.4) and the device contains Google Play Services.

To explicitly send these IDs to AppsFlyer, developers can use the following APIs and place it before initialising the SDK.

If the app does NOT contain Google Play Services, the IMEI and Android ID are collected by the SDK. However, apps with Google play services should avoid IMEI collection as this is in violation of the Google Play policy.

Enable / Disable IMEI collection (disabled by default)

appsFlyer.setCollectIMEI(bool);

Manually setting IMEI Data

appsFlyer.setImeiData("imeiString");

Enable / Disable Android ID collection (disabled by default)

appsFlyer.setCollectAndroidID(bool);

Manually setting Android ID Data

appsFlyer.setAndroidIdData("AndroidIDString");

In-App Events can be logged using the `logEvent("eventName", "eventValue") API. For Example:

var param:String = "Deposit";
var value:String = '{"amount":10, "FTDLevel":"-"}';
appsFlyer.logEvent(param, value);         
appsFlyer.setAppUserId("user_id_as_used_in_the_app");
appsFlyer.setUserEmails("[email protected]");
appsFlyer.setCurrency("USD");

In some extreme cases you might want to shut down all SDK reporting due to legal and privacy compliance. This can be achieved with the stop() API. Once this API is invoked, our SDK will no longer communicate with our servers and stop functioning.

appsFlyer.stop();
appsFlyer.setDebug(bool);

Important : do not release the application to the AppStore / Google Play with debug logs enabled.


You can find the release changelog here.

adobeairextension-appsflyer's People

Contributors

herasymchuk avatar sokoloff06 avatar gmeroz avatar orenbaranes avatar diogocarlomagno avatar dcampano avatar af-fess avatar benjaminaf avatar wesfieldj 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.