GithubHelp home page GithubHelp logo

appsflyer-adobe-mobile-ios-extension's Introduction

appsflyer-adobe-mobile-ios-extension

Version

πŸ›  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

  • iOS AppsFlyer SDK v6.13.1

Add the following to your app's Podfile:

pod 'AppsFlyerAdobeExtension', '6.13.1'

Register the AppsFlyer extension from your Application class, alongside the Adobe SDK initialisation code:

...
#import "AppsFlyerAdobeExtension/AppsFlyerAdobeExtension.h"

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [ACPCore configureWithAppId:@"Key"];
    ...
    [AppsFlyerAdobeExtension registerExtension];
    ...
    
    [AppsFlyerAdobeExtension registerCallbacks:^(NSDictionary *dictionary) {
        NSLog(@"[AppsFlyerAdobeExtension] Received callback: %@", dictionary);
        if([[dictionary objectForKey:@"callback_type"] isEqualToString:@"onConversionDataReceived"]){
            if([[dictionary objectForKey:@"is_first_launch"] boolValue] == YES){
                NSString* af_status = [dictionary objectForKey:@"af_status"];
                if([af_status isEqualToString:@"Non-organic"]){
                    NSLog(@"this is first launch and a non organic install!");
                }
            }
        } else if([[dictionary objectForKey:@"callback_type"] isEqualToString:@"onAppOpenAttribution"]) {
            NSLog(@"onAppOpenAttribution Received");
        }
     }];

    [AppsFlyerAdobeExtension callbacksErrorHandler:^(NSError *error) {
          NSLog(@"[AppsFlyerAdobeExtension] Error receivng callback: %@" , error);
      }];
    
    return YES;
}

In Addition to adding the init code, the settings inside the launch dashboard must be set.

Setting Description
AppsFlyer iOS App ID Your iTunes application ID (required for iOS only)
AppsFlyer Dev Key Your application devKey provided by AppsFlyer (required)
Bind in-app events for Bind adobe event to appsflyer in-app events. For more info see the doc here.
Send attribution data Send conversion data from the AppsFlyer SDK to adobe. This is required for data elements.
Debug Mode Debug mode - set to true for testing only.
Wait for ECID Once enabled, the SDK Initialization will be delayed until the Experience Cloud ID is set.

Note: For Send attribution data, use this feature if you are only working with ad networks that allow sharing user level data with 3rd party tools.

Starting version 6.13.0, we support a manual mode to separate the initialization of the AppsFlyer SDK and the start of the SDK.
In this case, the AppsFlyer SDK won't start automatically, giving the developer more freedom when to start the AppsFlyer SDK.
Please note that in manual mode, the developer is required to implement the API [[AppsFlyerLib shared] start] in order to start the SDK.
You should set this mode before starting the MobileCore SDK and after registering the extensions in AppDelegate.
If you are using CMP to collect consent data this feature is needed. See explanation here.

Example:

[ACPCore configureWithAppId:@"<ADOBE_DEV_KEY>"];
[AppsFlyerAdobeExtension registerExtension];
AppsFlyerAdobeExtension.shared.manual = true;
...
[ACPCore start:^{
    [ACPCore lifecycleStart:nil];
}];

Please look at the example below to see how to start SDK once you want.
Keep in mind you shouldn't put the start() on a lifecycle method.
To start the AppsFlyer SDK, use the start() API, like the following :

[[AppsFlyerLib shared] start];
AppsFlyerAdobeExtension.shared.manual = false;

You need to end the manual mode. This will tell the Extension to call start() from this point.

See the full API available for this plugin.

Check out the available data elements here.

For a general introduction to DMA consent data, see here. The SDK offers two alternative methods for gathering consent data:

  • Through a Consent Management Platform (CMP): If the app uses a CMP that complies with the Transparency and Consent Framework (TCF) v2.2 protocol, the SDK can automatically retrieve the consent details.

    OR

  • Through a dedicated SDK API: Developers can pass Google's required consent data directly to the SDK using a specific API designed for this purpose.

Use CMP to collect consent data

A CMP compatible with TCF v2.2 collects DMA consent data and stores it in NSUserDefaults. To enable the SDK to access this data and include it with every event, follow these steps:

  1. Call [[AppsFlyerLib shared] enableTCFDataCollection:true] to instruct the SDK to collect the TCF data from the device.
  2. Add the extension to MobileCore extensions : [AppsFlyerAdobeExtension registerExtension].
  3. Set the extension to be on manual mode to true- meaning the developer will have the responsability to start the SDK.
    This will allow us to delay the Conversion call in order to provide the SDK with the user consent. AppsFlyerAdobeExtension.shared.manual = true
  4. Initialize MobileCore.
  5. In the applicationDidBecomeActive lifecycle method, use the CMP to decide if you need the consent dialog in the current session to acquire the consent data. If you need the consent dialog move to step 4; otherwise move to step 5.
  6. Get confirmation from the CMP that the user has made their consent decision and the data is available in NSUserDefaults.
  7. Call start() to the SDK.
  8. Set manual mode to false.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [[AppsFlyerLib shared] enableTCFDataCollection:true];

    // Override point for customization after application launch.
    [ACPCore setLogLevel:ACPMobileLogLevelVerbose];
    [ACPCore configureWithAppId:@"DEV_KEY"];

    
    [AppsFlyerAdobeExtension registerExtension];
    [ACPAnalytics registerExtension];
    [ACPIdentity registerExtension];
    [ACPLifecycle registerExtension];
    [ACPSignal registerExtension];
    AppsFlyerAdobeExtension.shared.manual = true;
    
    [ACPCore start:^{
        [ACPCore lifecycleStart:nil];
    }];

    [AppsFlyerAdobeExtension registerCallbacks:^(NSDictionary *dictionary) {
        NSLog(@"[AppsFlyerAdobeExtension] Received callback: %@", dictionary);
    }];
    
    [AppsFlyerAdobeExtension callbacksErrorHandler:^(NSError *error) {
        NSLog(@"[AppsFlyerAdobeExtension] Error receivng callback: %@" , error);
    }];

    return YES;
}

// Deep Link reporting using Univeral Links.
 - (BOOL) application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *restorableObjects))restorationHandler {
     [AppsFlyerAdobeExtension continueUserActivity:userActivity restorationHandler:restorationHandler];
    return YES;
}

// Deep Link reporting for URL Schemes.
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *) options {
    [AppsFlyerAdobeExtension openURL:url options:options];
    return YES;
}

Manually collect consent data

If your app does not use a CMP compatible with TCF v2.2, use the SDK API detailed below to provide the consent data directly to the SDK.

  1. Add the extension to MobileCore extensions : [AppsFlyerAdobeExtension registerExtension].
  2. Set the extension to be on manual mode to true- meaning the developer will have the responsability to start the SDK.
    This will allow us to delay the Conversion call in order to provide the SDK with the user consent. AppsFlyerAdobeExtension.shared.manual = true
  3. Initialize MobileCore.
  4. In the applicationDidBecomeActive lifecycle method determine whether the GDPR applies or not to the user.
    - If GDPR applies to the user, perform the following:
    1. Given that GDPR is applicable to the user, determine whether the consent data is already stored for this session.
      1. If there is no consent data stored, show the consent dialog to capture the user consent decision.
      2. If there is consent data stored continue to the next step.
    2. To transfer the consent data to the SDK create an AppsFlyerConsent object with the following parameters:
      - forGDPRUserWithHasConsentForDataUsage- Indicates whether the user has consented to use their data for advertising purposes. - hasConsentForAdsPersonalization- Indicates whether the user has consented to use their data for personalized advertising.
    3. Call [[AppsFlyerLib shared] setConsentData:[[AppsFlyerConsent alloc] initForGDPRUserWithHasConsentForDataUsage:BOOL hasConsentForAdsPersonalization:BOOL]].
    4. Call start() to the SDK.
    5. Set manual mode to false.

    - If GDPR doesn’t apply to the user perform the following:
    1. Call [[AppsFlyerLib shared] setConsentData:[[AppsFlyerConsent alloc] initNonGDPRUser]].
    2. Call start() to the SDK.
    3. Set manual mode to false.

See the Swift Example here.

appsflyer-adobe-mobile-ios-extension's People

Contributors

af-fess avatar andr-ggn avatar benjaminaf avatar morisgateno-appsflyer avatar pazlavi avatar wesfieldj avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

appsflyer-adobe-mobile-ios-extension's Issues

com.appsflyer.adobeextension Cannot initilalise AppsFlyer tracking without an appId or devKey

Console debug logs state that AppsFlyer tracking is not properly initialized with this log message: com.appsflyer.adobeextension Cannot initilalise AppsFlyer tracking without an appId or devKey

"AppsFlyer SDK Extension" is properly configured on "Adobe Experience Platform Launch" with the corresponding "AppsFlyer iOS App ID" and "AppsFlyer Dev Key" and enabled "Send attribution data to Adobe Analytics" checkbox.

This is code which is called on the app start:

import ACPCore
import ACPMobileServices
import ACPUserProfile
import AppsFlyerAdobeExtension

final class AdobeSDK {
    static func configure() {
        AppsFlyerLib.shared().appsFlyerDevKey = Env.appsFlyerDevKey
        AppsFlyerLib.shared().appleAppID = Env.appID

        ACPCore.setLogLevel(Env.isDebug ? .debug : .error)
        ACPCore.configure(withAppId: Env.adobeEnvironmentID)

        AppsFlyerAdobeExtension.register()
        ACPMobileServices.registerExtension()
        ACPIdentity.registerExtension()
        ACPLifecycle.registerExtension()
        ACPSignal.registerExtension()
        ACPUserProfile.registerExtension()

        ACPCore.start {
            ACPCore.lifecycleStart(nil)
        }
    }
}

I also tried to insert this before or after registration of the AppsFlyerAdobeExtension but still getting that same error:

AppsFlyerAdobeExtension.shared()?.setupAppsFlyerTracking(
    withAppId: Env.appID,
    appsFlyerDevKey: Env.appsFlyerDevKey,
    isDebug: Env.isDebug,
    trackAttrData: true,
    eventSettings: String()
)

Any idea what's not working here?

P.S. I suggest updating example in your README.md to have both Swift and Objective-C variants + whatever happens to be solution to this problem since by just adding the obvious part - it's still not working.

conflict with react-native-acpcore

I'm working in a react-native project that already uses this packages:

  • "react-native-appsflyer": "6.0.30"
  • "@adobe/react-native-acpanalytics": "1.1.5"
  • "@adobe/react-native-acpcore": "1.2.1"

Now we are trying to add the AppsFlyerAdobeExtension, but this error appears:
The 'Pods' target has libraries with conflicting names: libacpcore_ios.a, libacpidentity_ios.a, libacpsignal_ios.a, and libacplifecycle_ios.a.

What seems to be happen, is that react-native-acpcore already adds this pod as a dependency but AppsFlyerAdobeExtension doesn't find it and tries to add it to its own dependencies.

Is a way to force AppsFlyerAdobeExtension to use the ACPCore that already is on the project?

Arm64 Compatibility

Currently AppsFlyerAdobeExtension seems to be not supported iOs simulator on new m1 mac, due to pod dependency ​
​AppsFlyerFramework (= 6.2.6)

The dependecy should be uptated to 6.3.0

SPM support

Given that the latest AppsFlyerFramework (6.1.0+) only supports SPM, can this extension also be updated for SPM too please?
Many thanks

Adobe ID (MID) in Appsflyer costume ID

Hi,

When we do not set a customer ID in Appsflyer, the extension "AppsFlyer Adobe Extension" set automatically the Adobe user id.

Is there an option to disable this?

Error when register extension

Hi,
our company have a app for both platform iOS/Android

But we receive this logs recently in both platform:

2019-11-18 17:14:39.244711-0300 AppName

[20260:498179] com.appsflyer.adobeextension was registered

2019-11-18 17:14:39.244942-0300 AppName[20260:498454] com.appsflyer.adobeextension Shared State listener was registered

2019-11-18 17:14:39.245095-0300 AppName[20260:498454] com.appsflyer.adobeextension Analytics Events listener was registered

2019-11-18 17:14:39.245270-0300 AppName[20260:498454] com.appsflyer.adobeextension Shared State listener was initialized

2019-11-18 17:14:39.245511-0300 AppName[20260:498454] -[AppsFlyerEventListener initWithExtension:]: unrecognized selector sent to instance 0x6000018371b0

2019-11-18 17:14:39.267588-0300 AppName[20260:498454] [AdobeExperienceSDK ERROR <com.appsflyer.adobeextension>]: Failed to respond to external listener registration.
An unknown exception occurred.

2019-11-18 17:14:39.267769-0300 AppName[20260:498454] com.appsflyer.adobeextension unexpectedError Error Domain=com.adobemarketingmobile.module_errors Code=0 "(null)"

2019-11-18 17:14:39.453881-0300 AppName[20260:498484] com.appsflyer.adobeextension Cannot initilalise AppsFlyer tracking without an appId or devKey

2019-11-18 17:14:39.456091-0300 AppName[20260:498459] com.appsflyer.adobeextension Cannot initilalise AppsFlyer tracking without an appId or devKey

2019-11-18 17:14:39.458579-0300 AppName[20260:498458] com.appsflyer.adobeextension Cannot initilalise AppsFlyer tracking without an appId or devKey

2019-11-18 17:14:39.512423-0300 AppName[20260:498468] com.appsflyer.adobeextension Cannot initilalise AppsFlyer tracking without an appId or devKey

We follow the standard setup:

ACPCore.configure(withAppId: "launch-EN4fa4880c106c40dc9a16d7042a3b52f2")
AppsFlyerAdobeExtension.register()
ACPAnalytics.registerExtension()
ACPIdentity.registerExtension()
ACPCampaignClassic.registerExtension()

ACPLifecycle.registerExtension()

ACPCore.start {
	ACPCore.lifecycleStart(nil)
}

Had any change?

Support for AppsFlyerSDK v6.*

Hi, do you have any information on supporting the latest AppsFlyerSDK or should we downgrade to 5.* in order to use it in combination with this Adobe extension?

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.