https://github.com/appsflyersdk/appsflyer-adobe-mobile-ios-extension
AppsFlyer iOS SDK Extension for Adobe Mobile SDK
https://github.com/appsflyersdk/appsflyer-adobe-mobile-ios-extension
Last synced: 6 months ago
JSON representation
AppsFlyer iOS SDK Extension for Adobe Mobile SDK
- Host: GitHub
- URL: https://github.com/appsflyersdk/appsflyer-adobe-mobile-ios-extension
- Owner: AppsFlyerSDK
- License: other
- Created: 2018-10-16T13:14:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-25T12:41:29.000Z (about 1 year ago)
- Last Synced: 2024-05-16T00:41:06.606Z (12 months ago)
- Language: Objective-C
- Size: 19.1 MB
- Stars: 0
- Watchers: 6
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# appsflyer-adobe-mobile-ios-extension
[](http://cocoapods.org/pods/AppsFlyerAdobeExtension)
π 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
- [Adding the SDK to your project](#add-sdk-to-project)
- [Initializing the SDK](#init-sdk)
- [Manual Mode](#manual-mode)
- [Guides](#guides)
- [API](#api)
- [Data Elements](#data-elements)
- [Send consent for DMA compliance](#dma_support)
- [Swift Example](#swift-example)### This plugin is built for
- iOS AppsFlyer SDK **v6.13.1**## π² Adding the SDK to your project
Add the following to your app's `Podfile`:
```javascript
pod 'AppsFlyerAdobeExtension', '6.13.1'
```@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](https://support.appsflyer.com/hc/en-us/articles/207377436-Adding-a-new-app#available-in-the-app-store-google-play-store-windows-phone-store) (required for iOS only) |
| AppsFlyer Dev Key | Your application [devKey](https://support.appsflyer.com/hc/en-us/articles/211719806-Global-app-settings-#sdk-dev-key) provided by AppsFlyer (required) |
| Bind in-app events for | Bind adobe event to appsflyer in-app events. For more info see the doc [here](/docs/Guides.md#events). |
| 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.
## π Guides
- [Deep Linking](/docs/Guides.md#deeplinking)
- [In-App Events](/docs/Guides.md#events)
- [Data Elements](/docs/Guides.md#data-elements)
- [Attribution Data tracking with Adobe Analytics](/docs/Guides.md#attr-data)
- [Deeplink Data tracking with Adobe Analytics](/docs/Guides.md#deeplink-data)## π API
See the full [API](/docs/API.md) available for this plugin.## π Data Elements
Check out the available data elements [here](/docs/DataElements.md).```objective-c
- (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> *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.
- Add the extension to MobileCore extensions :
[AppsFlyerAdobeExtension registerExtension]
.
- 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
- Initialize
MobileCore
.
- In the
applicationDidBecomeActive
lifecycle method determine whether the GDPR applies or not to the user.
- If GDPR applies to the user, perform the following:
- Given that GDPR is applicable to the user, determine whether the consent data is already stored for this session.
- If there is no consent data stored, show the consent dialog to capture the user consent decision.
- If there is consent data stored continue to the next step.
- 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.
- Call
[[AppsFlyerLib shared] setConsentData:[[AppsFlyerConsent alloc] initForGDPRUserWithHasConsentForDataUsage:BOOL hasConsentForAdsPersonalization:BOOL]]
.
- Call
start()
to the SDK.
- Set manual mode to
false
.
- If GDPR doesnβt apply to the user perform the following:
- Call
[[AppsFlyerLib shared] setConsentData:[[AppsFlyerConsent alloc] initNonGDPRUser]]
.
- Call
start()
to the SDK.
- Set manual mode to
false
.
## Swift Example
See the Swift Example [here](/docs/SwiftExample.md).