From 645d5452f56874caf2860fc33437984b7b7f0a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Thu, 14 Nov 2024 10:29:07 +0100 Subject: [PATCH 1/6] Initial copy --- .../en/sdk/adobe-extension/_codeblocks.mdoc | 113 +++ .../sdk/adobe-extension/ios/attribution.mdoc | 133 ++++ .../sdk/adobe-extension/ios/deep-linking.mdoc | 196 +++++ .../en/sdk/adobe-extension/ios/events.mdoc | 259 ++++++ .../en/sdk/adobe-extension/ios/example.mdoc | 26 + .../ios/external-device-id.mdoc | 97 +++ .../ios/global-parameters.mdoc | 205 +++++ .../en/sdk/adobe-extension/ios/index.mdoc | 49 ++ .../sdk/adobe-extension/ios/integration.mdoc | 752 ++++++++++++++++++ .../sdk/adobe-extension/ios/preinstalled.mdoc | 130 +++ .../sdk/adobe-extension/ios/push-tokens.mdoc | 184 +++++ .../migration/adobe-extension/ios/index.mdoc | 229 ++++++ 12 files changed, 2373 insertions(+) create mode 100644 src/content/docs/en/sdk/adobe-extension/_codeblocks.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/deep-linking.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/events.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/example.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/global-parameters.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/index.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc create mode 100644 src/content/docs/en/sdk/adobe-extension/ios/push-tokens.mdoc create mode 100644 src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc diff --git a/src/content/docs/en/sdk/adobe-extension/_codeblocks.mdoc b/src/content/docs/en/sdk/adobe-extension/_codeblocks.mdoc new file mode 100644 index 000000000..54ffd31cb --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/_codeblocks.mdoc @@ -0,0 +1,113 @@ +```objc +#import "AppDelegate.h" +@import AEPCore; +@import AEPServices; +#import + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + // Adjust Adobe Extension configuration + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:{environment}]; + [AdjustAdobeExtension setConfiguration:config]; + + // Adjust Adobe Extension registration + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] + completion:^{ + [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; + + if (appState != UIApplicationStateBackground) { + // only start lifecycle if the application is not in the background + [AEPMobileCore lifecycleStart:nil]; + } + }]; + + return YES; +} + +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + return [AdjustAdobeExtension application:app openURL:url options:options]; +} + +- (BOOL)application:(UIApplication *)application +continueUserActivity:(NSUserActivity *)userActivity + restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + return [AdjustAdobeExtension application:application + continueUserActivity:userActivity]; +} + + +#pragma mark - UISceneSession lifecycle + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + +1 +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end +``` + +```swift +import UIKit +import AEPCore +import AEPServices +import AdjustAdobeExtension + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + // Adjust Adobe Extension configuration + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + AdjustAdobeExtension.setConfiguration(config) + } + + // Adjust Adobe Extension registration + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { + MobileCore.configureWith(appId: "{your_adobe_app_id}") + if appState != .background { + // Only start lifecycle if the application is not in the background + MobileCore.lifecycleStart(additionalContextData: nil) + } + } + return true + } + + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + return AdjustAdobeExtension.application(app, open: url, options: options) + } + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + return AdjustAdobeExtension.application(application, continue: userActivity) + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } +} + +``` diff --git a/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc new file mode 100644 index 000000000..7eab55016 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc @@ -0,0 +1,133 @@ +--- +title: Set up an attribution callback +description: Set up an attribution callback to respond to attribution changes. +sidebar-position: 2 +--- + +When Adjust receives install data from the Adjust Android Extension for Adobe Experience SDK, the device is attributed to the source of the install. This attribution information can change if the user is retargeted or interacts with another campaign. + +You can configure a callback function to respond to attribution changes. When Adjust receives new attribution information, it sends the data asynchronously back to the device. The callback function receives the device's attribution data as an argument. + +Read Adjust's [attribution data policies](https://github.com/adjust/sdks/blob/master/doc/attribution-data.md) for more information about attribution data. + +## Reference {% #reference %} + +To set a callback function to listen for attribution changes, call the `setOnAttributionChangedListener` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`onAttributionChangedListener`: `OnAttributionChangedListener` + +: A function that returns `void` and receives device attribution information as a serialized JSON object. +{% /deflist %} + +## Tutorial: Create an attribution callback {% #tutorial %} + +To configure an attribution callback, you need to create a function and assign it to your `AdjustAdobeExtensionConfig` instance. In this tutorial, you'll build on `MainApp.java` from the [integration guide](/en/sdk/adobe-extension/android/integration) and add an `onAttributionChanged` callback function that outputs the user's attribution information to logs as a string. The final result looks like this: + +```java +import android.app.Application; +import android.util.Log; + +import com.adjust.adobeextension.AdjustAdobeExtension; +import com.adjust.adobeextension.AdjustAdobeExtensionConfig; +import com.adobe.marketing.mobile.AdobeCallback; +import com.adobe.marketing.mobile.Extension; +import com.adobe.marketing.mobile.Analytics; +import com.adobe.marketing.mobile.Identity; +import com.adobe.marketing.mobile.LoggingMode; +import com.adobe.marketing.mobile.MobileCore; + +public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + config.setOnAttributionChangedListener(new OnAttributionChangedListener() { + @Override + public void onAttributionChanged(AdjustAttribution adjustAttribution) { + Log.d("example", "Attribution information updated"); + Log.d("example", "Attribution: " + attribution.toString()); + } + }); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + List> extensions = Arrays.asList( + Analytics.EXTENSION, + Identity.EXTENSION, + AdjustAdobeExtension.EXTENSION); + MobileCore.registerExtensions(extensions, new AdobeCallback() { + @Override + public void call(Object o) { + Log.d("example", "Adjust Adobe Extension SDK initialized"); + } + }); + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } +} +``` + +Here's what you need to do: + +1. Inside the `try...catch` block, call the `setOnAttributionChangedListener` method of your `AdjustAdobeExtensionConfig` instance. Pass an `OnAttributionChangedListener` instance as an argument. + + {% codeblock highlight="{range: 6}" startLineNumber=21 %} + ```java + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + config.setOnAttributionChangedListener(new OnAttributionChangedListener() {}); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + ``` + {% /codeblock %} + +1. Create a new public function called `onAttributionChanged` inside your `setOnAttributionChangedListener` declaration. This method takes an `AdjustAttribution` argument and returns `void`. + + {% codeblock + title="MainApp.java" + highlight="{range: 3}" + startLineNumber=26 %} + ```java + config.setOnAttributionChangedListener(new OnAttributionChangedListener() { + @Override + public void onAttributionChanged(AdjustAttribution adjustAttribution) {} + }); + ``` + {% /codeblock %} + +1. Inside the `onAttributionChanged` function body, log the `AdjustAttribution` object by converting it to a string. + + {% codeblock + title="MainApp.java" + highlight="{range: 4-5}" + startLineNumber=26 %} + ```java + config.setOnAttributionChangedListener(new OnAttributionChangedListener() { + @Override + public void onAttributionChanged(AdjustAttribution adjustAttribution) { + Log.d("example", "Attribution information updated"); + Log.d("example", "Attribution: " + attribution.toString()); + } + }); + ``` + {% /codeblock %} + +That's it! When a user's attribution information changes, this callback function writes out the updated attribution information to the system log. diff --git a/src/content/docs/en/sdk/adobe-extension/ios/deep-linking.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/deep-linking.mdoc new file mode 100644 index 000000000..5a651093f --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/deep-linking.mdoc @@ -0,0 +1,196 @@ +--- +title: Set up deep linking +description: Configure your app to handle direct and deferred deep links. +sidebar-position: 6 +--- + +Deep links are URIs (Uniform Resource Identifiers) that direct users to specific pages within your app. They enhance user experience by guiding them directly to relevant content after they interact with a link. + +The Adjust Android Extension for the Adobe Experience SDK supports two types of deep linking, based on whether the user has already installed your app: + +- **Direct deep links**: If the user already has your app installed, the link opens the specified page. +- **Deferred deep links**: If the user doesn’t have your app installed, the link directs them to the app store to install it. After installation, the app opens the specified page. + +## Reattribute users with direct deep links {% #reattribute-users-with-direct-deep-links %} + +You can reattribute your users by sending deep link information to Adjust. When a user engages with a deep link, you can send this data to Adjust to update their attribution information. + +1. First, create an `AdjustDeeplink` instance with your deep link URI. The `AdjustDeeplink` class validates this URI and checks the formatted string to ensure successful processing. + +1. Then, call the `Adjust.processDeeplink` function to handle the deep link and pass the information to Adjust. + +The `AdjustDeeplink` class constructor requires the following argument: + +{% deflist %} +`url`: `Uri` + +: The deep link URI that opens your app. +{% /deflist %} + +The `Adjust.processDeeplink` function requires the following arguments: + +{% deflist %} +`adjustDeeplink`: `AdjustDeeplink` + +: The `AdjustDeeplink` instance you created. + +`context`: `Context` + +: The application context. +{% /deflist %} + +## Deferred deep link callbacks {% #deferred-deep-link-callbacks %} + +The Adjust Android Extension for Adobe Experience SDK opens deferred deep links by default. To control this behavior, or perform validation before the deep link is opened, configure the extension to call a function when the app opens via a deferred deep link. + +1. Call `setOnDeferredDeeplinkResponseListener` on your `AdjustAdobeExtensionConfig` instance. +1. Call `AdjustAdobeExtension.setConfiguration` to set your configuration. + +The `OnDeferredDeeplinkResponseListener` function requires the following argument: + +{% deflist %} +`onDeferredDeeplinkResponseListener`: `OnDeferredDeeplinkResponseListener` + +: A function that returns a `boolean` value. If it returns `false`, the extension won't open the deferred deep link. +{% /deflist %} + +### Tutorial: Create a deferred deep link function {% #tutorial %} + +If you followed the [integration guide](/en/sdk/adobe-extension/android/integration), you've already configured the Adjust Extension to process and open deep links. If you haven't done this, refer to [set up deep link handling](/en/sdk/adobe-extension/android/integration#set-up-deep-link-handling) for instructions. + +In this tutorial, you'll learn how to create a callback function that controls deep linking functionality using the `setOnDeferredDeeplinkResponseListener` method. The function will open the link depending on the following condition: + +"If the deep link contains `"no_open"`, the app won't open it." + +The result looks like this: + +```java +import android.app.Application; +import android.util.Log; + +import com.adjust.adobeextension.AdjustAdobeExtension; +import com.adjust.adobeextension.AdjustAdobeExtensionConfig; +import com.adobe.marketing.mobile.AdobeCallback; +import com.adobe.marketing.mobile.Extension; +import com.adobe.marketing.mobile.Analytics; +import com.adobe.marketing.mobile.Identity; +import com.adobe.marketing.mobile.LoggingMode; +import com.adobe.marketing.mobile.MobileCore; + +public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { + @Override + public boolean launchReceivedDeeplink(Uri deeplink) { + if (deeplink.contains("no_open")) { + return false; + } else { + return true; + } + } + }); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + List> extensions = Arrays.asList( + Analytics.EXTENSION, + Identity.EXTENSION, + AdjustAdobeExtension.EXTENSION); + MobileCore.registerExtensions(extensions, new AdobeCallback() { + @Override + public void call(Object o) { + Log.d("example", "Adjust Adobe Extension SDK initialized"); + } + }); + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } +} +``` + +Here's what you need to do: + +1. Inside the `try...catch` block, call the `setOnDeferredDeeplinkResponseListener` method of your `AdjustAdobeExtensionConfig` instance. Pass an `OnDeferredDeeplinkResponseListener` instance as an argument. + + {% codeblock + title="MainApp.java" + highlight="{range: 6}" + startLineNumber=21 %} + ```java + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() {}); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + ``` + {% /codeblock %} + +1. Create a new public function called `launchReceivedDeeplink` inside your `OnDeferredDeeplinkResponseListener` declaration. This method takes a `Uri` argument and returns a `boolean`. + + {% codeblock + title="MainApp.java" + highlight="{range: 3}" + startLineNumber=26 %} + ```java + config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { + @Override + public boolean launchReceivedDeeplink(Uri deeplink) {} + }); + ``` + {% /codeblock %} + +1. Add an `if` condition to the `launchReceivedDeeplink` to check if the `deeplink` contains the value `"no_open"`. If the string is found, the function returns `false`, and the app shouldn't open the deferred deep link. + + {% codeblock + title="MainApp.java" + highlight="{range: 3-5}" + startLineNumber=27 %} + ```java + @Override + public boolean launchReceivedDeeplink(Uri deeplink) { + if (deeplink.contains("no_open")) { + return false; + } + } + ``` + {% /codeblock %} + +1. Finally, add an `else` block to return `true` if the deep link doesn't contain `"no_open"`. + + {% codeblock + title="MainApp.java" + highlight="{range: 5-7}" + startLineNumber=27 %} + ```java + @Override + public boolean launchReceivedDeeplink(Uri deeplink) { + if (deeplink.contains("no_open")) { + return false; + } else { + return true; + } + } + ``` + {% /codeblock %} + +That's it! When a user opens your app with a deferred deep link, the Adjust Extension will check if the link contains the string `"no_open"`. If it does, the app won't open the deep link. diff --git a/src/content/docs/en/sdk/adobe-extension/ios/events.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/events.mdoc new file mode 100644 index 000000000..2ec90fc5c --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/events.mdoc @@ -0,0 +1,259 @@ +--- +title: Send event information +description: Follow this guide to send events to Adjust from your Adobe Experience app. +sidebar-position: 5 +--- + +You can use the Adjust Extension for Adobe Experience SDK to send event information to Adjust's servers when your users take specific actions. Adjust records these events and surfaces them in your [Datascape reports](https://help.adjust.com/en/article/datascape), [server callbacks](https://help.adjust.com/en/article/server-callbacks), and [cloud storage uploads](https://help.adjust.com/en/article/cloud-storage-uploads). + +For more information on configuring events in Adjust, visit the [Add events guide](https://help.adjust.com/en/article/add-events) in the Help Center. + +## How it works {% #how-it-works %} + +Event information is sent to Adjust when the following information is passed to the `MobileCore.trackAction` API: + +1. `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT`: a string value that maps to the Adjust `trackEvent` method. +1. `contextData`: a HashMap of values used to configure your event. + +When you call `MobileCore.trackAction` with these arguments, the Adjust extension creates an event instance, passes it to the `trackEvent` method, and sends the information to Adjust. + +## Reference {% #reference %} + +The `contextData` HashMap holds information about an event. Each event is represented by a unique `contextData` HashMap. To configure your event instance, add values to HashMap. + +The following keys are supported: + +{% deflist %} +`AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN` + +: Your Adjust event token. You MUST set this value to send event information to Adjust. Check out [add events](https://help.adjust.com/en/article/add-events#manage-your-events) for more information. + +`AdjustAdobeExtension.ADOBE_ADJUST_REVENUE` + +: The amount of revenue associated with the event. This value should be a string that represents a numerical value. + +`AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY`. + +: An [ISO 4217](https://www.iban.com/currency-codes) currency code. + +`AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX` + +: Append a callback parameter key to this prefix and add your callback parameter value to send callbacks to Adjust. + +`AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX` + +: Append a partner parameter key to this prefix and add your partner parameter value to send callbacks to third parties. +{% /deflist %} + +## Tutorial: Send an event {% #tutorial %} + +To send event information, you need to add a function to your main activity. In this tutorial, you'll build on `MainActivity.java` from the [integration guide](/en/sdk/adobe-extension/android/integration) and add a new function called `sendEventToAdjust` which will send an event with the following properties: + +- An event token: `"g3mfiw"`. +- 1 Euro of event revenue. +- A callback parameter with the key `"user_id"` and value `"855"`. +- A partner parameter with the key `"event_token` and value `"g3mfiw"`. + +The final result looks like this: + +```java +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; + +import androidx.appcompat.app.AppCompatActivity; + +import com.adjust.sdk.Adjust; +import com.adjust.sdk.AdjustDeeplink; +import com.adobe.marketing.mobile.MobileCore; + +import java.util.HashMap; +import java.util.Map; + +public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); + } + + public void sendEventToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "user_id", "855"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "event_token", "g3mfiw"); + + MobileCore.trackAction(action, contextData); + } +} +``` + +Here's what you need to do: + +1. First, import the following classes: + + - `com.adobe.marketing.mobile.MobileCore`: this class is used to send information to Adobe and Adjust. + - `java.util.HashMap`: this class is used to generate the `contextData` HashMap. + - `java.util.Map`: this class is used to type the `contextData` HashMap. + + ```java + // MainActivity.java + import com.adobe.marketing.mobile.MobileCore; + + import java.util.HashMap; + import java.util.Map; + ``` + +1. Next, create a new function inside the `MainActivity` class called `sendEventToAdjust`. This function takes [the application `View`](https://developer.android.com/reference/android/view/View) as an argument and returns `void.` + + {% codeblock + title="MainActivity.java" + highlight="{range: 13}" + startLineNumber=15 %} + ```java + public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); + } + + public void sendEventToAdjust(View view) {} + } + ``` + {% /codeblock %} + +1. Inside the `sendEventToAdjust` function, declare a new `String` variable called `action` and assign it the value `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT`. This is used to tell `MobileCore.trackAction` which action to handle. + + {% codeblock + title="MainActivity.java" + highlight="{range: 2}" + startLineNumber=27 %} + ```java + public void sendEventToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + } + ``` + {% /codeblock %} + +1. Create a new HashMap variable called `contextData`. This is used to hold the properties of the event. + + {% codeblock + title="MainActivity.java" + highlight="{range: 3}" + startLineNumber=27 %} + ```java + public void sendEventToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + } + ``` + {% /codeblock %} + +Now that the `contextData` HashMap is initialized, add values to build the event. You can refer back to the [`contextData` reference](#reference) for more information about the uses of each key. + +1. Add your Adjust event token to the HashMap using the `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN` key. This is required to inform Adjust which event you're trying to send. + + {% codeblock + title="MainActivity.java" + highlight="{range: 4}" + startLineNumber=27 %} + ```java + public void sendEventToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); + } + ``` + {% /codeblock %} + +1. Add the event revenue amount using `AdjustAdobeExtension.ADOBE_ADJUST_REVENUE` for the amount and `AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY` for the currency. Both values MUST be passed as strings. + + {% codeblock + title="MainActivity.java" + highlight="{range: 5-6}" + startLineNumber=27 %} + ```java + public void sendEventToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); + } + ``` + {% /codeblock %} + +1. Add a callback parameter using the `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX` key. Append a callback identifier to the key to match the parameter in your callback URL. + + {% codeblock + title="MainActivity.java" + highlight="{range: 7}" + startLineNumber=27 %} + ```java + public void sendEventToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "user_id", "855"); + } + ``` + {% /codeblock %} + +1. Add a partner parameter using the `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX` key. Append a callback identifier to the key to map it to your partner's placeholder. + + {% codeblock + title="MainActivity.java" + highlight="{range: 8}" + startLineNumber=27 %} + ```java + public void sendEventToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "user_id", "855"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "event_token", "g3mfiw"); + } + ``` + {% /codeblock %} + +1. Finally, to send the event information to Adjust, call `MobileCore.trackAction` with your `action` and `contextData` variables. + + {% codeblock + title="MainActivity.java" + highlight="{range: 10}" + startLineNumber=27 %} + ```java + public void sendEventToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "user_id", "855"); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "event_token", "g3mfiw"); + + MobileCore.trackAction(action, contextData); + } + ``` + {% /codeblock %} + +That's it! When the user performs an action that maps to the `sendEventToAdjust` function, an event is constructed and sent to Adjust. diff --git a/src/content/docs/en/sdk/adobe-extension/ios/example.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/example.mdoc new file mode 100644 index 000000000..b2c6d3fe9 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/example.mdoc @@ -0,0 +1,26 @@ +--- +title: iOS Adobe Extension example implementation +description: A full example of an app using all features of the Adjust Extension. +sidebar-label: Example +sidebar-position: 9 +--- + +This page contains a full example implementation of the Adjust iOS Extension for Adobe Experience SDK. + +You can see [the full example on GitHub](https://github.com/adjust/ios_adobe_extension/tree/main/AdjustAdobeExtension). + +{% exampleapp + permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtension/Classes/AdjustAdobeExtensionConfig.h" + lang="objc" /%} + +{% exampleapp + permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtension/Classes/AdjustAdobeExtensionConfig.m" + lang="objc" /%} + +{% exampleapp + permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtension/Classes/AdjustAdobeExtension.h" + lang="objc" /%} + +{% exampleapp + permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtension/Classes/AdjustAdobeExtension.m" + lang="objc" /%} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc new file mode 100644 index 000000000..dc76ab81f --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc @@ -0,0 +1,97 @@ +--- +title: Configure external device ID +description: Use external device IDs to enhance your reporting. +sidebar-position: 4 +--- + +An [external device identifier](https://help.adjust.com/en/article/external-device-identifiers) is a custom value that you can assign to a device or user. This helps you recognize users across sessions and platforms. External device IDs also help you deduplicate installs by user, to avoid counting multiple new installs assoiciated with the same user. + +Using external device IDs can produce different results depending on your setup. If you want to use them, contact your Adjust representative. They will talk you through the best approach for your use case. + +You must set your external device ID in your `AdjustAdobeExtensionConfig` instance before you call `AdjustAdobeExtension.setConfiguration`. You can't change this property after you've initialized the extension. + +## Reference {% #reference %} + +To set an external device ID, call the `setExternalDeviceId` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`externalDeviceId`: `String` + +: Your external device identifier. +{% /deflist %} + +## Tutorial: Set an external device ID {% #tutorial %} + +To set an external device ID, you need to set the ID using your `AdjustAdobeExtensionConfig` instance. If you followed the [integration guide](/en/sdk/adobe-extension/android/integration), your `MainApp.java` file should look something like this: + +```java +// MainApp.java +import android.app.Application; +import android.util.Log; + +import com.adjust.adobeextension.AdjustAdobeExtension; +import com.adjust.adobeextension.AdjustAdobeExtensionConfig; +import com.adobe.marketing.mobile.AdobeCallback; +import com.adobe.marketing.mobile.Extension; +import com.adobe.marketing.mobile.Analytics; +import com.adobe.marketing.mobile.Identity; +import com.adobe.marketing.mobile.LoggingMode; +import com.adobe.marketing.mobile.MobileCore; + +public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + List> extensions = Arrays.asList( + Analytics.EXTENSION, + Identity.EXTENSION, + AdjustAdobeExtension.EXTENSION); + MobileCore.registerExtensions(extensions, new AdobeCallback() { + @Override + public void call(Object o) { + Log.d("example", "Adjust Adobe Extension SDK initialized"); + } + }); + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } +} +``` + +To set a default link token for preinstalled apps, pass the link token to the `setExternalDeviceId` method of the `AdjustAdobeExtensionConfig` instance. The ID is sent to Adjust with each session. + +In this example, the external device ID is set to _{% $variables.config.externalDeviceId %}_. + +{% codeblock + title="MainApp.java" + highlight="{range: 6}" + startLineNumber=21 %} +```java +try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + config.setExternalDeviceId("{% $variables.config.externalDeviceId %}"); + AdjustAdobeExtension.setConfiguration(config); +} catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); +} +``` +{% /codeblock %} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/global-parameters.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/global-parameters.mdoc new file mode 100644 index 000000000..9ca2106aa --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/global-parameters.mdoc @@ -0,0 +1,205 @@ +--- +title: Set up global callback and partner parameters +description: Send information to your callback URL and to network partners with each session. +sidebar-label: Set up global parameters +sidebar-position: 7 +--- + +The Adjust Android Extension for Adobe Experience SDK enables you to send additional information to Adjust to forward to your callback URL and network partners. Global parameters are string key-value pairs that you can use to communicate more information about a device or user. + +## Global callback parameters {% #global-callback-parameters %} + +If you [register a callback URL](https://help.adjust.com/en/article/recommended-placeholders-callbacks) in the Adjust dashboard, Adjust sends a `GET` request to your callback URL when the SDK sends session data. To append parameters to this callback request, set the global parameters in your code. + +#### Reference {% #global-callback-parameters-reference %} + +The `Adjust` class methods manage the global callback parameters. You can add and remove individual parameters, or reset all parameters at once. + +### Add a global callback parameter {% #add-global-callback-parameter %} + +To add a global callback parameter, call the `Adjust.addGlobalCallbackParameter` method with the following arguments: + +{% deflist %} +`key`: `String` + +: The parameter key. + +`value`: `String` + +: The parameter value. +{% /deflist %} + +You can add multiple parameters by calling the `Adjust.addGlobalCallbackParameter` method multiple times. + +```java +Adjust.addGlobalCallbackParameter("key", "value"); +Adjust.addGlobalCallbackParameter("user_id", "855"); +``` + +### Remove a global callback parameter {% #remove-global-callback-parameter %} + +To remove a global callback parameter, call the `Adjust.removeGlobalCallbackParameter` method with the following argument: + +{% deflist %} +`key`: `String` + +: The key of the parameter you want to remove. +{% /deflist %} + +```java +Adjust.removeGlobalCallbackParameter("key"); +``` + +### Remove all global callback parameters {% #remove-all-global-callback-parameter %} + +To remove all global callback parameters at once, call the `Adjust.removeGlobalCallbackParameters` method. + +This method removes all active global callback parameters, meaning you won't receive any parameters in callbacks from Adjust. + +```java +Adjust.removeGlobalCallbackParameters(); +``` + +## Global partner parameters {% #global-partner-parameters %} + +You can send extra information to your network partners by adding partner parameters. Sharing additional parameters with your external partners enables more granular analysis and facilitates retargeting. + +When the Adjust Android Extension for Adobe Experience SDK sends session data, Adjust's servers forward any global partner parameters to any partners you've configured. + +Read [choose data sharing options](https://help.adjust.com/en/article/data-sharing-ad-network) to learn how to configure what data you share with external partners. + +#### Reference {% #global-partner-parameters-reference %} + +The `Adjust` class methods manage the global partner parameters. You can add and remove individual parameters, or reset all parameters at once. + +### Add a global partner parameter {% #add-global-partner-parameter %} + +To add a global partner parameter, call the `Adjust.addGlobalPartnerParameter` method with the following arguments: + +{% deflist %} +`key`: `String` + +: The parameter key. + +`value`: `String` + +: The parameter value. +{% /deflist %} + +You can add multiple parameters by calling the `Adjust.addGlobalPartnerParameter` method multiple times. + +```java +Adjust.addGlobalPartnerParameter("key", "value"); +Adjust.addGlobalPartnerParameter("user_id", "855"); +``` + +### Remove a global partner parameter {% #remove-global-partner-parameter %} + +To remove a global partner parameter, call the `Adjust.removeGlobalPartnerParameter` method with the following argument: + +{% deflist %} +`key`: `String` + +: The key of the parameter you want to remove. +{% /deflist %} + +```java +Adjust.removeGlobalPartnerParameter("key"); +``` + +### Remove all global partner parameters {% #remove-all-global-partner-parameter %} + +To remove all global partner parameters at once, call the `Adjust.removeGlobalPartnerParameters` method. + +This method removes all active global partner parameters, meaning no parameters will be sent to network partners. + +```java +Adjust.removeGlobalPartnerParameters(); +``` + +## Tutorial: Add and remove global parameters {% #tutorial %} + +You can change your global callback and partner parameters at any time by calling the methods described on this page. If you followed the [integration guide](/en/sdk/adobe-extension/android/integration), your `MainActivity.java` file should look something like this: + +```java +// MainActivity.java +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; + +import androidx.appcompat.app.AppCompatActivity; + +import com.adjust.sdk.Adjust; +import com.adjust.sdk.AdjustDeeplink; + +public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); + } +} +``` + +Add new functions to update global parameters: + +- `addAdjustGlobalCallback`: This function adds a new global callback. +- `removeAdjustGlobalCallback`: This function removes a global callback added by `addAdjustGlobalCallback`. +- `removeAllAdjustGlobalCallbacks`: This function removes all global callbacks. +- `addAdjustGlobalPartnerParam`: This function adds a new global partner parameter. +- `removeAdjustGlobalPartnerParam`: This function removes the global partner parameter added by `addAdjustGlobalPartnerParam`. +- `removeAllAdjustGlobalPartnerParams`: This function removes all global partner parameter. + +These functions take [a `View`](https://developer.android.com/reference/android/view/View) as an argument and return `void`. To handle the update, call the relevant `Adjust` class method within the body of each function. + +Here's the updated `MainActivity.java` file: + +{% codeblock + title="MainActivity.java" + highlight="{range: 13-35}" + startLineNumber=11 %} +```java +public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); + } + + public void addAdjustGlobalCallback(View view) { + Adjust.addGlobalCallbackParameter("user_id", "855"); + } + + public void removeAdjustGlobalCallback(View view) { + Adjust.removeGlobalCallbackParameter("user_id"); + } + + public void removeAllAdjustGlobalCallbacks(View view) { + Adjust.removeGlobalPartnerParameters(); + } + + public void addAdjustGlobalPartnerParam(View view) { + Adjust.addGlobalPartnerParameter("user_id", "855"); + } + + public void removeAdjustGlobalPartnerParam(View view) { + Adjust.removeGlobalPartnerParameter("user_id"); + } + + public void removeAllAdjustGlobalPartnerParams(View view) { + Adjust.removeGlobalPartnerParameters(); + } +} +``` +{% /codeblock %} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc new file mode 100644 index 000000000..05d34d3f8 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc @@ -0,0 +1,49 @@ +--- +title: iOS Adobe Extension integration guide +description: Follow this guide to integrate the Adjust iOS Extension for Adobe Experience SDK. +category-title: iOS +sidebar-position: 1 +--- + +The Adjust iOS Extension for Adobe Experience SDK provides you with a powerful tool to enhance your app's performance analytics. By integrating this extension, you can send essential data—such as install, session, and in-app event information—to Adjust. + +The extension is designed to work within the Adobe Experience SDK framework, so you can implement it without disrupting your existing workflows. + +{% callout type="seealso" %} +The full source code is available [on GitHub](https://github.com/adjust/ios_adobe_extension) +{% /callout %} + +## Integrate the extension {% #integrate-the-extension %} + +Follow the [integration guide](/en/sdk/adobe-extension/ios/integration) to add the Adjust iOS Extension for Adobe Experience SDK to your app. This guide covers the following: + +1. [Install dependencies](/en/sdk/adobe-extension/ios/integration#install-the-adjust-extension) +1. [Configure permissions](/en/sdk/adobe-extension/ios/integration#configure-permissions) +1. [Integrate the Adjust iOS Extension for Adobe Experience SDK](/en/sdk/adobe-extension/ios/integration#integration-guide) + +## Set up features {% #set-up-features %} + +The Adjust iOS Extension for Adobe Experience SDK has many features that enable you to record user activity. Follow these guides to configure the Adjust Extension: + +- [Set up a callback function to listen for attribution changes](/en/sdk/adobe-extension/ios/attribution). +- [Configure a default link token for preinstalled apps](/en/sdk/adobe-extension/ios/preinstalled). +- [Configure an external device ID for reporting](/en/sdk/adobe-extension/ios/external-device-id). + +Follow these guides to add functionality to your app using the Adjust Extension: + +- [Send event information to Adjust](/en/sdk/adobe-extension/ios/events). +- [Set up deep linking](/en/sdk/adobe-extension/ios/deep-linking). +- [Set up global callback and partner parameters](/en/sdk/adobe-extension/ios/global-parameters). +- [Send push tokens for uninstall measurement](/en/sdk/adobe-extension/ios/push-tokens). + +{% callout type="seealso" %} +The [example app](/en/sdk/adobe-extension/ios/example) includes an implementation of all features available in the Adjust iOS Extension for Adobe Experience SDK. +{% /callout %} + +## Build your app for production {% #build-your-app-for-production %} + +After you've integrated the Adjust iOS Extension for Adobe Experience and completed [your testing](/en/sdk/testing), prepare your app for release. Make sure to do the following: + +- [ ] Ask your marketing team to set up all necessary campaigns in Adjust. +- [ ] Set your [logging level](/en/sdk/adobe-extension/ios/integration#integration-guide) according to your needs. +- [ ] Change [your environment](/en/sdk/adobe-extension/ios/integration#configure-the-adjust-extension) to `AdjustAdobeExtensionConfig.ENVIRONMENT_PRODUCTION` to allow the extension to send data in your production environment. diff --git a/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc new file mode 100644 index 000000000..085bc134d --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc @@ -0,0 +1,752 @@ +--- +title: Integration guide +description: Follow this guide to integrate the Adjust iOS Extension for Adobe Experience SDK. +sidebar-position: 1 +--- + +This is a step-by-step guide to help you integrate and configure the Adjust Extension in your Adobe Experience app for iOS. With this extension, you can seamlessly integrate Adjust with the Adobe Experience SDK to capture and send attribution data and in-app event information. + +This extension enables you to send installs, sessions, custom in-app events, and other types of data to Adjust. Follow this guide to set up and configure the Adjust Extension and verify that you can send install information to Adjust. + +## Set up your project {% #set-up-your-project %} + +Follow these steps to set up your project to support the Adjust Extension for Adobe Experience SDK. + +### Install the Adjust Extension {% #install-the-adjust-extension %} + +To use the Adjust Extension for Adobe Experience SDK, you need to add it to your project as a dependency. + +If you're using Swift Package Manager, enter the following URL: + +```txt +https://github.com/adjust/ios_adobe_extension.git +``` + +If you're using CocoaPods, add the following line to your `Podfile`: + +{% codeblock title="Podfile" showLineNumbers=false %} +```rb +pod 'AdjustAdobeExtension' +``` +{% /codeblock %} + +### Add iOS frameworks {% #add-ios-frameworks %} + +The Adjust Extension requires additional iOS frameworks to access information about a device. Add the following frameworks and mark them as **optional** to enable these features. + +{% deflist %} +`AdSupport.framework` + +: Used to access the ID for Advertisers (IDFA) and Limited Ad Tracking (LAT) information. LAT is available only on devices running iOS 14 or earlier. + +`AppTrackingTransparency.framework` + +: Used to enable the Adjust Extension to wrap the user AppTrackingTransparency (ATT) consent dialog and access a user's ATT consent data. ATT is avaliable only on devices running iOS 14 or later. + +`AdServices.framework` + +: Used to enable the Adjust Extension to automatically handle attribution for Apple Search Ads (ASA) campaigns on devices running iOS 14.3 or later. Required when using the Apple Ads Attribution API. + +`StoreKit.framework` + +: Used to enable the Adjust Extension to communicate with the `SKAdNetwork` framework on devices running iOS 14 or later. +{% /deflist %} + +## Integration guide {% #integration-guide %} + +Once you've completed the project setup steps, you can integrate the Adjust SDK. The following guide shows you how to: + +1. Add the Adjust Extension to your Adobe Experience app. +1. Set your logging level to **verbose** to retrieve as much detail as possible from the extension. +1. Test the Extension in **sandbox** mode to ensure it sends data to Adjust. +1. Enable your app to open deep links. +1. Register with the Adobe Experience SDK. + +To do this, you need to create the following files: + +{% tabs %} +{% tab title="Swift" sync="swift" %} +- `AppDelegate.swift`: this is where you'll configure the Adjust Extension. +- `ViewController.swift`: this is where you'll create functions using the Adjust Extension. +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +- `AppDelegate.m`: the method file for your app delegate. This is where you'll configure the Adjust Extension. +- `AppDelegate.h`: the header file for your app delegate. +- `ViewController.m`: the method file for your view controller. This is where you'll create functions using the Adjust Extension. +- `ViewController.h`: the header file for your view controller. + +For the purposes of this guide, use the following header files: + +```objc +// AppDelegate.h +#import + +@interface AppDelegate : UIResponder +@end +``` + +```objc +// ViewController.h +#import + +@interface ViewController : UIViewController +@end +``` +{% /tab %} +{% /tabs %} + +### Import classes {% #import-classes %} + +First, you need to import some classes into your application files. Import the following classes into your app delegate: + +{% deflist %} +`AEPCore` + +: Contains the implementation of the Event Hub. + +`AEPServices` + +: Provides implementations for platform support such as networking, disk access, and database management. + +`AdjustAdobeExtension` + +: The Adjust Extension for Adobe Experience SDK. +{% /deflist %} + +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// AppDelegate.swift +import AEPCore +import AEPServices +import AdjustAdobeExtension +``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +// AppDelegate.m +#import "AppDelegate.h" +@import AEPCore; +@import AEPServices; +#import +``` +{% /tab %} +{% /tabs %} + +### Create an App Delegate {% #create-an-app-delegate %} + +To register the Adjust iOS Extension for Adobe Experience SDK, you need to create an App Delegate. If you've not yet created an App Delegate, follow these steps: + +1. Create a new `AppDelegate` implementation. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock title="AppDelegate.swift" highlight="{range: 6}" %} + ```swift + import AEPCore + import AEPServices + import AdjustAdobeExtension + + @main + class AppDelegate: UIResponder, UIApplicationDelegate {} + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock title="AppDelegate.swift" highlight="{range: 6}" %} + ```objc + #import "AppDelegate.h" + @import AEPCore; + @import AEPServices; + #import + + @implementation AppDelegate + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +1. Within your `AppDelegate` implementation, create a new function called `application` that returns a boolean. This function takes the following arguments: + + {% deflist %} + `application`: `UIApplication` + + : The singleton app object. + + `launchOptions`: `[UIApplication.LaunchOptionsKey : Any]` + + : A dictionary indicating the reason the app was launched. + {% /deflist %} + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 3}" + startLineNumber=5 %} + ```swift + @main + class AppDelegate: UIResponder, UIApplicationDelegate { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {} + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 3}" + startLineNumber=6 %} + ```objc + @implementation AppDelegate + + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {} + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +### Configure the Adjust Extension {% #configure-the-adjust-extension %} + +Once you've created the App Delegate, follow these steps to configure the Adjust iOS Extension for Adobe Experience SDK: + +1. Inside your `application` function, set your logging level by calling the `setLogLevel` method of the `AEPMobileCore` class with the following argument: + + {% deflist %} + `logLevel` + + : The level of logging you want to enable. + + - `Trace`: enable all logging. + - `Debug`: disable verbose logging. + - `Warning`: log only errors and warnings. + - `Error`: log only errors. + {% /deflist %} + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 2}" + startLineNumber=7 %} + ```swift + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 2}" + startLineNumber=8 %} + ```objc + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + } + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +1. Create a new `UIApplicationState` variable called `appState`. You'll use this to communicate the app state with the Adobe Experience SDK. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 3}" + startLineNumber=7 %} + ```swift + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 3}" + startLineNumber=8 %} + ```objc + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + } + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +1. Create a new `AdjustAdobeExtensionConfig` instance named `config` with the following argument: + + {% deflist %} + `environment`: `NSString` + + : The environment in which your device is running. + + - Pass `ADJEnvironmentSandbox` when testing. + - Pass `ADJEnvironmentProduction` when running the app in production. + {% /deflist %} + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 5}" + startLineNumber=7 %} + ```swift + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) {} + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 5}" + startLineNumber=8 %} + ```objc + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + } + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +1. Call the `setConfiguration` method of the `AdjustAdobeExtension` class with your configuration instance as an argument to register the configuration. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 6}" + startLineNumber=7 %} + ```swift + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + AdjustAdobeExtension.setConfiguration(config) + } + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 6}" + startLineNumber=8 %} + ```objc + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [AdjustAdobeExtension setConfiguration:config]; + } + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +### Register the Adjust Extension {% #register-the-adjust-extension %} + +Once you've configured the Adjust Extension, you need to register it with the Adobe Experience SDK. To do this: + +1. Inside your `application` function, call the `registerExtensions` method of the AEPMobileCore class with the following arguments: + + {% deflist %} + `extensions`: `NSArray* _Nonnull` + + : A list of extensions. + + `completion`: `(^ _Nullable)(void))` + + : A completion handler. + {% /deflist %} + + For the purposes of this guide, pass the `AdjustAdobeExtension` class for `extensions`. You'll set your completion handler in the next step. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 9}" + startLineNumber=7 %} + ```swift + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + AdjustAdobeExtension.setConfiguration(config) + } + + MobileCore.registerExtensions([AdjustAdobeExtension.self]) {} + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 8-9}" + startLineNumber=9 %} + ```objc + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [AdjustAdobeExtension setConfiguration:config]; + + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] + completion: ^{}]; + } + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +1. Within the completion handler, call the `configureWithAppId` method of the `AEPMobileCore` class with your Adobe App ID. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 10}" + startLineNumber=7 %} + ```swift + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + AdjustAdobeExtension.setConfiguration(config) + } + + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { + MobileCore.configureWith(appId: "{your_adobe_app_id}") + } + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 10}" + startLineNumber=9 %} + ```objc + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [AdjustAdobeExtension setConfiguration:config]; + + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] + completion: ^{ + [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; + }]; + } + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +1. Inside your completion handler, add an `if` block to call the `lifecycleStart` method of the `AEPMobileCore` if the app isn't in the background. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 11-13}" + startLineNumber=7 %} + ```swift + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + AdjustAdobeExtension.setConfiguration(config) + } + + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { + MobileCore.configureWith(appId: "{your_adobe_app_id}") + if appState != .background { + MobileCore.lifecycleStart(additionalContextData: nil) + } + } + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 11-13}" + startLineNumber=9 %} + ```objc + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [AdjustAdobeExtension setConfiguration:config]; + + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] + completion: ^{ + [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; + if (appState != UIApplicationStateBackground) { + [AEPMobileCore lifecycleStart:nil]; + } + }]; + } + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +1. Finally, return a `true` value at the top level of your `application` function. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 16}" + startLineNumber=7 %} + ```swift + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + AdjustAdobeExtension.setConfiguration(config) + } + + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { + MobileCore.configureWith(appId: "{your_adobe_app_id}") + if appState != .background { + MobileCore.lifecycleStart(additionalContextData: nil) + } + } + + return true + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 16}" + startLineNumber=9 %} + ```objc + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [AdjustAdobeExtension setConfiguration:config]; + + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] + completion: ^{ + [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; + if (appState != UIApplicationStateBackground) { + [AEPMobileCore lifecycleStart:nil]; + } + }]; + + return YES; + } + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +### Set up your activity file {% #set-up-your-activity-file %} + +Next, you need to set up your `MainActivity.java` file. You'll use this file to set up your Adjust features later. For the purposes of this guide, you're only going to set up the `onCreate` function to handle application startup. + +1. Create a new public class called `MainActivity`. This class should extend the `AppCompatActivity` class. + + {% codeblock title="MainActivity.java" startLineNumber=11 %} + ```java + public class MainActivity extends AppCompatActivity {} + ``` + {% /codeblock %} + +1. Create a new protected override function called `onCreate`. This function receives the `savedInstanceState` and returns `void`. + + {% codeblock + title="MainActivity.java" + highlight="{range: 2-3}" + startLineNumber=11 %} + ```java + public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) {} + } + ``` + {% /codeblock %} + +1. Within your `onCreate` function, call `super.onCreate` with the `savedInstanceState` to create your activity. + + {% codeblock + title="MainActivity.java" + highlight="{range: 3}" + startLineNumber=12 %} + ```java + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + ``` + {% /codeblock %} + +1. Next, call `setContentView` to map your activity to your app layout. In this example, the layout file is called `activity_main.xml`. + + {% codeblock + title="MainActivity.java" + highlight="{range: 4}" + startLineNumber=12 %} + ```java + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } + ``` + {% /codeblock %} + +### Set up deep link handling {% #set-up-deep-link-handling %} + +To configure the Adjust iOS Extension for Adobe Experience SDK to open deep links, follow these steps: + +1. Create a new `Intent` variable called `intent` inside your `onCreate` function and assign it the output of `getIntent()`. + + {% codeblock + title="MainActivity.java" + highlight="{range: 6}" + startLineNumber=12 %} + ```java + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + } + ``` + {% /codeblock %} + +1. Create a new `Uri` variable called `data` and assign it the output of `intent.getData()`. + + {% codeblock + title="MainActivity.java" + highlight="{range: 7}" + startLineNumber=12 %} + ```java + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + } + ``` + {% /codeblock %} + +1. Construct a new `AdjustDeeplink` instance with your `data` variable. + + {% codeblock + title="MainActivity.java" + highlight="{range: 8}" + startLineNumber=12 %} + ```java + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + } + ``` + {% /codeblock %} + +1. To open the URL, pass your `AdjustDeeplink` instance and `getApplicationContext()` to the `Adjust.processDeeplink` method. + + {% codeblock + title="MainActivity.java" + highlight="{range: 9}" + startLineNumber=12 %} + ```java + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); + } + ``` + {% /codeblock %} + + If you use [short branded links](https://help.adjust.com/en/article/short-branded-links), you can alternatively use the `Adjust.processAndResolveDeeplink` method to resolve your shortened link and return it to a callback function. + + {% codeblock + title="MainActivity.java" + highlight="{range: 9-14}" + startLineNumber=12 %} + ```java + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processAndResolveDeeplink(adjustDeeplink, getApplicationContext(), new OnDeeplinkResolvedListener() { + @Override + public void onDeeplinkResolved(String s) { + Log.d("example", "Unwrapped short link: " + s); + } + }); + } + ``` + {% /codeblock %} + +Once you've completed these steps, build and run your app. In your log viewer, set the filter `tag:Adjust` to show only logs relating to the Adjust Extension. After you launch your app, you should see the message `Install tracked`. diff --git a/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc new file mode 100644 index 000000000..9a2fa5d12 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc @@ -0,0 +1,130 @@ +--- +title: Send preinstalled app activity +sidebar-label: Configure preinstalled app +description: Configure a campaign to send information from preinstalled apps. +sidebar-position: 3 +--- + +You can use the Adjust Android Extension for Adobe Experience SDK to send Adjust activity from apps that came preinstalled on a user's device. This enables you to send information from users who didn't download your app from a campaign. + +You can send data from preinstalled apps to a predefined default link. When a user opens the app for the first time, the install session is associated with the default link token. + +## Reference {% #reference %} + +To set your default link token, call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`token`: `String` + +: Your alphanumeric Adjust link token. +{% /deflist %} + +## Tutorial: Set a default link token {% #tutorial %} + +To set your default link token, you need to add the token to your `AdjustAdobeExtensionConfig` instance. If you followed the [integration guide](/en/sdk/adobe-extension/android/integration), your `MainApp.java` file should look something like this: + +```java +// MainApp.java +import android.app.Application; +import android.util.Log; + +import com.adjust.adobeextension.AdjustAdobeExtension; +import com.adjust.adobeextension.AdjustAdobeExtensionConfig; +import com.adobe.marketing.mobile.AdobeCallback; +import com.adobe.marketing.mobile.Extension; +import com.adobe.marketing.mobile.Analytics; +import com.adobe.marketing.mobile.Identity; +import com.adobe.marketing.mobile.LoggingMode; +import com.adobe.marketing.mobile.MobileCore; + +public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + List> extensions = Arrays.asList( + Analytics.EXTENSION, + Identity.EXTENSION, + AdjustAdobeExtension.EXTENSION); + MobileCore.registerExtensions(extensions, new AdobeCallback() { + @Override + public void call(Object o) { + Log.d("example", "Adjust Adobe Extension SDK initialized"); + } + }); + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } +} +``` + +To set a default link token for preinstalled apps, pass the link token to the `setDefaultTracker` method of the `AdjustAdobeExtensionConfig` instance. When Adjust receives the install session information, it attributes the install to the default link. + +In this example, the default link token is set to `"abc123"`. + +{% codeblock title="MainApp.java" highlight="{range: 26}" %} +```java +import android.app.Application; +import android.util.Log; + +import com.adjust.adobeextension.AdjustAdobeExtension; +import com.adjust.adobeextension.AdjustAdobeExtensionConfig; +import com.adobe.marketing.mobile.AdobeCallback; +import com.adobe.marketing.mobile.Extension; +import com.adobe.marketing.mobile.Analytics; +import com.adobe.marketing.mobile.Identity; +import com.adobe.marketing.mobile.LoggingMode; +import com.adobe.marketing.mobile.MobileCore; + +public class MainApp extends Application { + @Override + public void onCreate() { + super.onCreate(); + + MobileCore.setApplication(this); + MobileCore.setLogLevel(LoggingMode.VERBOSE); + + try { + MobileCore.configureWithAppID("your_adobe_app_id"); + + AdjustAdobeExtensionConfig config = + new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); + config.setDefaultTracker("abc123"); + AdjustAdobeExtension.setConfiguration(config); + } catch (Exception e) { + Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + } + + try { + List> extensions = Arrays.asList( + Analytics.EXTENSION, + Identity.EXTENSION, + AdjustAdobeExtension.EXTENSION); + MobileCore.registerExtensions(extensions, new AdobeCallback() { + @Override + public void call(Object o) { + Log.d("example", "Adjust Adobe Extension SDK initialized"); + } + }); + } catch (Exception e) { + Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + } + } +} +``` +{% /codeblock %} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/push-tokens.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/push-tokens.mdoc new file mode 100644 index 000000000..4788ff505 --- /dev/null +++ b/src/content/docs/en/sdk/adobe-extension/ios/push-tokens.mdoc @@ -0,0 +1,184 @@ +--- +title: Send push tokens +description: Send push tokens to Adjust to inform audiences and uninstall and reinstall measurement. +sidebar-position: 8 +--- + +Push notifications enable you to deliver personalized content to your users. You can use deep links to direct users to specific pages in your app, and measure reattributions. + +- The push token is a unique identifier that can be used to sort [Audiences](https://help.adjust.com/en/article/audiences) and client callbacks. +- Push tokens are also required for [uninstall and reinstall measurement](https://help.adjust.com/en/article/uninstalls-reinstalls). + +## How it works {% #how-it-works %} + +Each device generates a unique push token that's used to target it. The push token is sent to Adjust when the following information is passed to the `MobileCore.trackAction` API: + +1. `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN`: a string constant that maps to the `setPushToken` method. +1. `contextData`: a HashMap of values used to configure your push token. + +When you call `MobileCore.trackAction` with these arguments, the Adjust extension the token to the `setPushToken` method and sends the information to Adjust. + +## Reference {% #reference %} + +The `contextData` HashMap holds information about an action. To configure your push token, add the following key-value pair to your HashMap. + +{% deflist %} +`AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN` + +: The device's push token. +{% /deflist %} + +## Example: Send a push token {% #example-send-push-token %} + +To send a push token to Adjust, you need to add a function to your main activity. In this tutorial, you'll build on `MainActivity.java` from the [integration guide](/en/sdk/adobe-extension/android/integration) and add a new function called `sendPushTokenToAdjust` which will send an updated push token to Adjust. The final result looks like this: + +```java +// MainActivity.java +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; + +import androidx.appcompat.app.AppCompatActivity; + +import com.adjust.sdk.Adjust; +import com.adjust.sdk.AdjustDeeplink; +import com.adobe.marketing.mobile.MobileCore; + +import java.util.HashMap; +import java.util.Map; + +public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); + } + + public void sendPushTokenToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "de18dbf8-f38a-4962-8f1e-44abcf43055d"); + + MobileCore.trackAction(action, contextData); + } +} +``` + +Here's what you need to do: + +1. First, import the following classes: + + - `com.adobe.marketing.mobile.MobileCore`: this class is used to send information to Adobe and Adjust. + - `java.util.HashMap`: this class is used to generate the `contextData` HashMap. + - `java.util.Map`: this class is used to type the `contextData` HashMap. + + {% codeblock + title="MainActivity.java" + highlight="{range: 10}, {range: 12-13}" %} + ```java + import android.content.Intent; + import android.net.Uri; + import android.os.Bundle; + import android.view.View; + + import androidx.appcompat.app.AppCompatActivity; + + import com.adjust.sdk.Adjust; + import com.adjust.sdk.AdjustDeeplink; + import com.adobe.marketing.mobile.MobileCore; + + import java.util.HashMap; + import java.util.Map; + ``` + {% /codeblock %} + +1. Next, create a new function inside the `MainActivity` class called `sendPushTokenToAdjust`. This function takes [a `View`](https://developer.android.com/reference/android/view/View) as an argument and returns `void.` + + {% codeblock + title="MainActivity.java" + highlight="{range: 13}" + startLineNumber=15 %} + ```java + public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Intent intent = getIntent(); + Uri data = intent.getData(); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); + } + + public void sendPushTokenToAdjust(View view) {} + } + ``` + {% /codeblock %} + +1. Inside the `sendPushTokenToAdjust` function, declare a new `String` variable called `action` and assign it the value `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN`. This is used to tell `MobileCore.trackAction` which action to handle. + + {% codeblock + title="MainActivity.java" + highlight="{range: 2}" + startLineNumber=27 %} + ```java + public void sendPushTokenToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN; + } + ``` + {% /codeblock %} + +1. Create a new HashMap variable called `contextData`. This is used to hold the properties of the action. + + {% codeblock + title="MainActivity.java" + highlight="{range: 3}" + startLineNumber=27 %} + ```java + public void sendPushTokenToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN; + Map contextData = new HashMap(); + } + ``` + {% /codeblock %} + +1. Add your push token to the HashMap using the `AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN` key. This example sets the push token to `"de18dbf8-f38a-4962-8f1e-44abcf43055d"`. + + {% codeblock + title="MainActivity.java" + highlight="{range: 4}" + startLineNumber=27 %} + ```java + public void sendPushTokenToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "de18dbf8-f38a-4962-8f1e-44abcf43055d"); + } + ``` + {% /codeblock %} + +1. Finally, call `MobileCore.trackAction` with your `action` and `contextData` variables to send the push token to Adjust. + + {% codeblock + title="MainActivity.java" + highlight="{range: 6}" + startLineNumber=27 %} + ```java + public void sendPushTokenToAdjust(View view) { + String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + Map contextData = new HashMap(); + contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "de18dbf8-f38a-4962-8f1e-44abcf43055d"); + + MobileCore.trackAction(action, contextData); + } + ``` + {% /codeblock %} + +That's it! When the user performs an action that maps to the `sendPushTokenToAdjust` function, your push token is sent to Adjust. diff --git a/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc b/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc new file mode 100644 index 000000000..97c2a1b1b --- /dev/null +++ b/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc @@ -0,0 +1,229 @@ +--- +title: iOS Adobe Extension v3 migration guide +description: Follow this guide to migrate from v2 to v3 +sidebar-label: iOS v3 migration guide +sidebar-position: 1 +--- + +The [Adjust Extension for Adobe Experience SDK](https://github.com/adjust/ios_adobe_extension) has been updated to v3 to support Adjust iOS SDK v5. Follow this guide to migrate from v2 to v3. + +{% callout type="important" %} +You need to update your app to support [iOS API 21](https://developer.ios.com/tools/releases/platforms#5.0) or above before migrating. +{% /callout %} + +To install v3 of the Adjust iOS Extension for Adobe Experience, update the dependency declarations in your `build.gradle` as follows: + +1. `com.adjust.adobeextension:adobeextension` MUST be updated to 3.0.0 or later. +1. `com.adjust.sdk:adjust-ios` MUST be updated to 5.0.0 or later. + +```groovy +dependencies { + implementation 'com.adjust.adobeextension:adobeextension:{% $versions.ios_adobe_extension.v3 %}' + implementation 'com.adjust.sdk:adjust-ios:{% $versions.ios.v5 %}' + implementation 'com.adobe.marketing.mobile:core:3.2.0' + implementation 'com.ios.installreferrer:installreferrer:2.2' +} +``` + +For a complete guide to setting up the Adjust iOS Extension for Adobe Experience, see the [integration guide](/en/sdk/adobe-extension/ios/integration). + +## New APIs {% #new-apis %} + +{% minorversion added="v3" size="large" /%} + +The following APIs have been added in v3. + +### Resolve short branded links {% #resolve-short-branded-links %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for resolving [short branded links](https://help.adjust.com/en/article/short-branded-links). To resolve shortened links, call the `Adjust.processAndResolveDeeplink` method with the following arguments: + +{% deflist %} +`adjustDeeplink`: `AdjustDeeplink` + +: The deep link that opened the app. + +`context`: `Context` + +: The app context. Call `getApplicationContext()` to fill this value. + +`callback`: `OnDeeplinkResolvedListener` + +: A callback function that receives the resolved short link as an argument. +{% /deflist %} + +```java +Intent intent = getIntent(); +Uri data = intent.getData(); +AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); +Adjust.processAndResolveDeeplink(adjustDeeplink, getApplicationContext(), new OnDeeplinkResolvedListener() { + @Override + public void onDeeplinkResolved(String s) { + + } +}); +``` + +### Global callback parameters {% #global-callback-parameters %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for the global callback parameters API from iOS SDK v5. To add global callbacks to your sessions, call the `Adjust.addGlobalCallbackParameter` method with the following arguments: + +{% deflist %} +`key`: `String` + +: The key of your parameter. + +`value`: `String` + +: The value of your parameter. +{% /deflist %} + +```java +Adjust.addGlobalCallbackParameter("key", "value"); +Adjust.addGlobalCallbackParameter("user_id", "855"); +``` + +Learn how to [set up global callback](/en/sdk/adobe-extension/ios/global-parameters#global-callback-parameters). + +### Global partner parameters {% #global-partner-parameters %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for the global partner parameters API from iOS SDK v5. To add global partner parameters, call the `Adjust.addGlobalPartnerParameter` method with the following arguments: + +{% deflist %} +`key`: `String` + +: The key of your parameter. + +`value`: `String` + +: The value of your parameter. +{% /deflist %} + +```java +Adjust.addGlobalPartnerParameter("key", "value"); +Adjust.addGlobalPartnerParameter("user_id", "855"); +``` + +Learn how to [set up global partner parameters](/en/sdk/adobe-extension/ios/global-parameters#global-partner-parameters). + +### Set external device ID {% #set-external-device-id %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for setting [external device identifiers](https://help.adjust.com/en/article/external-device-identifiers). To set an external device ID, call the `setExternalDeviceId` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`externalDeviceId`: `String` + +: Your external device identifier. +{% /deflist %} + +```java +String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); +config.setExternalDeviceId("{YourExternalDeviceId}"); +AdjustAdobeExtension.setConfiguration(config); +``` + +Learn how to [configure external device IDs](/en/sdk/adobe-extension/ios/external-device-id). + +### Set default link token for preinstalled apps {% #set-default-link-token-preinstalled-apps %} + +v3 of the Adjust Extension for Adobe Experience SDK adds support for setting a default [link token](https://help.adjust.com/en/article/links) for recording preinstalled app installs to a default campaign. To set a default link token, call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with the following argument: + +{% deflist %} +`defaultTracker`: `String` + +: The alphanumeric link token of your preinstall campaign. +{% /deflist %} + +```java +String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); +config.setDefaultTracker("{Token}"); +AdjustAdobeExtension.setConfiguration(config); +``` + +Learn how to [send preinstalled app activity](/en/sdk/adobe-extension/ios/preinstalled). + +## Changed APIs {% #changed-apis %} + +{% minorversion changed="v3" size="large" /%} + +The following APIs have changed in v3. + +### Retrieve device ADID {% #retrieve-device-adid %} + +In SDK v2, the `AdjustAttribution` class has a property called `adid`. This property has been removed. You can retrieve the device's ADID asynchronously, by calling `Adjust.getAdid`. + +```java +Adjust.getAdid(new OnAdidReadListener() { + @Override + public void onAdidRead(String adid) { + // Your callback function + } +}); +``` + +### Direct deep linking {% #direct-deep-linking %} + +In SDK v2, you can open deep links for attribution by calling the `AdjustAdobeExtension.openUrl` method with the deep link data as an argument. + +```java +Intent intent = getIntent(); +Uri data = intent.getData(); +AdjustAdobeExtension.openUrl(data, getApplicationContext()); +``` + +SDK v3 has been updated to use the Adjust iOS SDK's `processDeeplink` method. To open direct deep links: + +1. Create a new `AdjustDeeplink` instance with the deep link URL. +1. Pass your `AdjustDeeplink` instance to the `Adjust.processDeeplink` method. + +```java +Intent intent = getIntent(); +Uri data = intent.getData(); +AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); +Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); +``` + +Learn how to [reattribute users with direct deep links](/en/sdk/adobe-extension/ios/deep-linking#reattribute-users-with-direct-deep-links). + +### Deferred deep linking callback {% #deferred-deep-linking-callback %} + +In SDK v2, you can configure the SDK to launch a callback function when a deferred deep link is opened by passing a function to the `setOnDeeplinkResponseListener` method of your `AdjustAdobeExtensionConfig` instance. + +```java +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); + +config.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() { + @Override + public boolean launchReceivedDeeplink(Uri deeplink) { + if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { + return true; + } else { + return false; + } + } +}); + +AdjustAdobeExtension.setConfiguration(config); +``` + +In SDK v3, the `setOnDeeplinkResponseListener` method has been renamed to `setOnDeferredDeeplinkResponseListener`. + +```java +AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); + +config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { + @Override + public boolean launchReceivedDeeplink(Uri deeplink) { + if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { + return true; + } else { + return false; + } + } +}); + +AdjustAdobeExtension.setConfiguration(config); +``` + +Learn how to [work with deferred deep link callbacks](/en/sdk/adobe-extension/ios/deep-linking#deferred-deep-link-callbacks). From 6af6fe15ea3d82d879a2a162a6d297c6d4bb12fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Thu, 14 Nov 2024 12:32:16 +0100 Subject: [PATCH 2/6] Add some updates --- .../sdk/adobe-extension/ios/attribution.mdoc | 141 ++++--- .../en/sdk/adobe-extension/ios/index.mdoc | 2 +- .../sdk/adobe-extension/ios/integration.mdoc | 343 +++++++++++------- 3 files changed, 301 insertions(+), 185 deletions(-) diff --git a/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc index 7eab55016..0d0576bd7 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc @@ -4,7 +4,7 @@ description: Set up an attribution callback to respond to attribution changes. sidebar-position: 2 --- -When Adjust receives install data from the Adjust Android Extension for Adobe Experience SDK, the device is attributed to the source of the install. This attribution information can change if the user is retargeted or interacts with another campaign. +When Adjust receives install data from the Adjust iOS Extension for Adobe Experience SDK, the device is attributed to the source of the install. This attribution information can change if the user is retargeted or interacts with another campaign. You can configure a callback function to respond to attribution changes. When Adjust receives new attribution information, it sends the data asynchronously back to the device. The callback function receives the device's attribution data as an argument. @@ -12,73 +12,104 @@ Read Adjust's [attribution data policies](https://github.com/adjust/sdks/blob/ma ## Reference {% #reference %} -To set a callback function to listen for attribution changes, call the `setOnAttributionChangedListener` method of your `AdjustAdobeExtensionConfig` instance with the following argument: +To set a callback function to listen for attribution changes, call the `setAttributionChangedBlock` method of your `AdjustAdobeExtensionConfig` instance with the following argument: {% deflist %} -`onAttributionChangedListener`: `OnAttributionChangedListener` +`attributionChangedBlock`: `OnAttributionChangedListener` -: A function that returns `void` and receives device attribution information as a serialized JSON object. +: A function that returns `void` and receives device attribution information as a serialized `ADJAttribution` object. {% /deflist %} ## Tutorial: Create an attribution callback {% #tutorial %} To configure an attribution callback, you need to create a function and assign it to your `AdjustAdobeExtensionConfig` instance. In this tutorial, you'll build on `MainApp.java` from the [integration guide](/en/sdk/adobe-extension/android/integration) and add an `onAttributionChanged` callback function that outputs the user's attribution information to logs as a string. The final result looks like this: -```java -import android.app.Application; -import android.util.Log; - -import com.adjust.adobeextension.AdjustAdobeExtension; -import com.adjust.adobeextension.AdjustAdobeExtensionConfig; -import com.adobe.marketing.mobile.AdobeCallback; -import com.adobe.marketing.mobile.Extension; -import com.adobe.marketing.mobile.Analytics; -import com.adobe.marketing.mobile.Identity; -import com.adobe.marketing.mobile.LoggingMode; -import com.adobe.marketing.mobile.MobileCore; - -public class MainApp extends Application { - @Override - public void onCreate() { - super.onCreate(); - - MobileCore.setApplication(this); - MobileCore.setLogLevel(LoggingMode.VERBOSE); - - try { - MobileCore.configureWithAppID("your_adobe_app_id"); - - AdjustAdobeExtensionConfig config = - new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); - config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution adjustAttribution) { - Log.d("example", "Attribution information updated"); - Log.d("example", "Attribution: " + attribution.toString()); - } - }); - AdjustAdobeExtension.setConfiguration(config); - } catch (Exception e) { - Log.e("example", "Exception occurred during configuration: " + e.getMessage()); - } +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// AppDelegate.swift +import UIKit +import AEPCore +import AEPServices +import AdjustAdobeExtension + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + AdjustAdobeExtension.setConfiguration(config) + } + + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { + MobileCore.configureWith(appId: "{your_adobe_app_id}") + if appState != .background { + MobileCore.lifecycleStart(additionalContextData: nil) + } + } + return true + } - try { - List> extensions = Arrays.asList( - Analytics.EXTENSION, - Identity.EXTENSION, - AdjustAdobeExtension.EXTENSION); - MobileCore.registerExtensions(extensions, new AdobeCallback() { - @Override - public void call(Object o) { - Log.d("example", "Adjust Adobe Extension SDK initialized"); - } - }); - } catch (Exception e) { - Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); - } + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + return AdjustAdobeExtension.application(app, open: url, options: options) } + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + return AdjustAdobeExtension.application(application, continue: userActivity) + } +} +``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +// AppDelegate.m +#import "AppDelegate.h" +@import AEPCore; +@import AEPServices; +#import + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + // Adjust Adobe Extension configuration + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:{environment}]; + [AdjustAdobeExtension setConfiguration:config]; + + // Adjust Adobe Extension registration + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] + completion:^{ + [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; + + if (appState != UIApplicationStateBackground) { + // only start lifecycle if the application is not in the background + [AEPMobileCore lifecycleStart:nil]; + } + }]; + + return YES; +} + +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + return [AdjustAdobeExtension application:app openURL:url options:options]; +} + +- (BOOL)application:(UIApplication *)application +continueUserActivity:(NSUserActivity *)userActivity + restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + return [AdjustAdobeExtension application:application + continueUserActivity:userActivity]; } +@end ``` +{% /tab %} +{% /tabs %} Here's what you need to do: diff --git a/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc index 05d34d3f8..12837d05b 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc @@ -46,4 +46,4 @@ After you've integrated the Adjust iOS Extension for Adobe Experience and comple - [ ] Ask your marketing team to set up all necessary campaigns in Adjust. - [ ] Set your [logging level](/en/sdk/adobe-extension/ios/integration#integration-guide) according to your needs. -- [ ] Change [your environment](/en/sdk/adobe-extension/ios/integration#configure-the-adjust-extension) to `AdjustAdobeExtensionConfig.ENVIRONMENT_PRODUCTION` to allow the extension to send data in your production environment. +- [ ] Change [your environment](/en/sdk/adobe-extension/ios/integration#configure-the-adjust-extension) to `ADJEnvironmentProduction` to allow the extension to send data in your production environment. diff --git a/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc index 085bc134d..7f028d96f 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc @@ -98,7 +98,7 @@ For the purposes of this guide, use the following header files: ### Import classes {% #import-classes %} -First, you need to import some classes into your application files. Import the following classes into your app delegate: +First, you need to import some classes into your application files. Import the following classes into your App Delegate: {% deflist %} `AEPCore` @@ -135,6 +135,37 @@ import AdjustAdobeExtension {% /tab %} {% /tabs %} +Next, import the following classes into your View Controller: + +{% deflist %} +`AEPCore` + +: Contains the implementation of the Event Hub. + +`AdjustAdobeExtension` + +: The Adjust Extension for Adobe Experience SDK. +{% /deflist %} + +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// ViewController.swift +import AEPCore +import AdjustAdobeExtension +``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +// ViewController.m +#import "ViewController.h" +@import AEPCore; +#import +``` +{% /tab %} +{% /tabs %} + ### Create an App Delegate {% #create-an-app-delegate %} To register the Adjust iOS Extension for Adobe Experience SDK, you need to create an App Delegate. If you've not yet created an App Delegate, follow these steps: @@ -148,7 +179,7 @@ To register the Adjust iOS Extension for Adobe Experience SDK, you need to creat import AEPCore import AEPServices import AdjustAdobeExtension - + @main class AppDelegate: UIResponder, UIApplicationDelegate {} ``` @@ -162,7 +193,7 @@ To register the Adjust iOS Extension for Adobe Experience SDK, you need to creat @import AEPCore; @import AEPServices; #import - + @implementation AppDelegate ``` {% /codeblock %} @@ -203,7 +234,7 @@ To register the Adjust iOS Extension for Adobe Experience SDK, you need to creat startLineNumber=6 %} ```objc @implementation AppDelegate - + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {} ``` {% /codeblock %} @@ -308,7 +339,7 @@ Once you've created the App Delegate, follow these steps to configure the Adjust func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { MobileCore.setLogLevel(LogLevel.trace) let appState = application.applicationState - + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) {} } ``` @@ -324,7 +355,7 @@ Once you've created the App Delegate, follow these steps to configure the Adjust - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [AEPMobileCore setLogLevel: AEPLogLevelTrace]; const UIApplicationState appState = application.applicationState; - + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; } ``` @@ -344,7 +375,7 @@ Once you've created the App Delegate, follow these steps to configure the Adjust func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { MobileCore.setLogLevel(LogLevel.trace) let appState = application.applicationState - + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { AdjustAdobeExtension.setConfiguration(config) } @@ -362,7 +393,7 @@ Once you've created the App Delegate, follow these steps to configure the Adjust - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [AEPMobileCore setLogLevel: AEPLogLevelTrace]; const UIApplicationState appState = application.applicationState; - + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; [AdjustAdobeExtension setConfiguration:config]; } @@ -399,11 +430,11 @@ Once you've configured the Adjust Extension, you need to register it with the Ad func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { MobileCore.setLogLevel(LogLevel.trace) let appState = application.applicationState - + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { AdjustAdobeExtension.setConfiguration(config) } - + MobileCore.registerExtensions([AdjustAdobeExtension.self]) {} } ``` @@ -419,10 +450,10 @@ Once you've configured the Adjust Extension, you need to register it with the Ad - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [AEPMobileCore setLogLevel: AEPLogLevelTrace]; const UIApplicationState appState = application.applicationState; - + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; [AdjustAdobeExtension setConfiguration:config]; - + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] completion: ^{}]; } @@ -443,11 +474,11 @@ Once you've configured the Adjust Extension, you need to register it with the Ad func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { MobileCore.setLogLevel(LogLevel.trace) let appState = application.applicationState - + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { AdjustAdobeExtension.setConfiguration(config) } - + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { MobileCore.configureWith(appId: "{your_adobe_app_id}") } @@ -465,10 +496,10 @@ Once you've configured the Adjust Extension, you need to register it with the Ad - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [AEPMobileCore setLogLevel: AEPLogLevelTrace]; const UIApplicationState appState = application.applicationState; - + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; [AdjustAdobeExtension setConfiguration:config]; - + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] completion: ^{ [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; @@ -491,11 +522,11 @@ Once you've configured the Adjust Extension, you need to register it with the Ad func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { MobileCore.setLogLevel(LogLevel.trace) let appState = application.applicationState - + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { AdjustAdobeExtension.setConfiguration(config) } - + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { MobileCore.configureWith(appId: "{your_adobe_app_id}") if appState != .background { @@ -516,10 +547,10 @@ Once you've configured the Adjust Extension, you need to register it with the Ad - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [AEPMobileCore setLogLevel: AEPLogLevelTrace]; const UIApplicationState appState = application.applicationState; - + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; [AdjustAdobeExtension setConfiguration:config]; - + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] completion: ^{ [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; @@ -545,11 +576,11 @@ Once you've configured the Adjust Extension, you need to register it with the Ad func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { MobileCore.setLogLevel(LogLevel.trace) let appState = application.applicationState - + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { AdjustAdobeExtension.setConfiguration(config) } - + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { MobileCore.configureWith(appId: "{your_adobe_app_id}") if appState != .background { @@ -591,162 +622,216 @@ Once you've configured the Adjust Extension, you need to register it with the Ad {% /tab %} {% /tabs %} -### Set up your activity file {% #set-up-your-activity-file %} +### Set up deep link handling {% #set-up-deep-link-handling %} + +To configure the Adjust iOS Extension for Adobe Experience SDK to open deep links, follow these steps: + +1. Within your `AppDelegate` implementation, create a new boolean function called `application` to handle opening deep links. Thie function takes the following arguments: + + {% deflist %} + `app`: `UIApplication` -Next, you need to set up your `MainActivity.java` file. You'll use this file to set up your Adjust features later. For the purposes of this guide, you're only going to set up the `onCreate` function to handle application startup. + : The singleton app object. + + `url`: `NSURL` + + : The URL resource to open in the app. -1. Create a new public class called `MainActivity`. This class should extend the `AppCompatActivity` class. + `options`: `[UIApplicationOpenURLOptionsKey : id]` - {% codeblock title="MainActivity.java" startLineNumber=11 %} - ```java - public class MainActivity extends AppCompatActivity {} + : A dictionary of options for handling the URL, containing keys that specify options related to the URL. + {% /deflist %} + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 1}" + startLineNumber=25 %} + ```swift + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {} ``` {% /codeblock %} + {% /tab %} -1. Create a new protected override function called `onCreate`. This function receives the `savedInstanceState` and returns `void`. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 2-3}" - startLineNumber=11 %} - ```java - public class MainActivity extends AppCompatActivity { - @Override - protected void onCreate(Bundle savedInstanceState) {} - } + title="AppDelegate.m" + highlight="{range: 1}" + startLineNumber=27 %} + ```objc + - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options {} ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -1. Within your `onCreate` function, call `super.onCreate` with the `savedInstanceState` to create your activity. +1. Inside this function, return a call to `AdjustAdobeExtension.application` with each parameter passed in the parent function. + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 3}" - startLineNumber=12 %} - ```java - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + title="AppDelegate.swift" + highlight="{range: 2}" + startLineNumber=25 %} + ```swift + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + return AdjustAdobeExtension.application(app, open: url, options: options) } ``` {% /codeblock %} + {% /tab %} -1. Next, call `setContentView` to map your activity to your app layout. In this example, the layout file is called `activity_main.xml`. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 4}" - startLineNumber=12 %} - ```java - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); + title="AppDelegate.m" + highlight="{range: 2}" + startLineNumber=27 %} + ```objc + - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + return [AdjustAdobeExtension application:app openURL:url options:options]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -### Set up deep link handling {% #set-up-deep-link-handling %} +1. Next, create another boolean function called `application` to handle resuming user activity. This function takes the following arguments: -To configure the Adjust iOS Extension for Adobe Experience SDK to open deep links, follow these steps: + {% deflist %} + `application`: `UIApplication` + + : The singleton app object. + + `userActivity`: `NSUserActivity` + + : The user activity object that represents the activity to continue. -1. Create a new `Intent` variable called `intent` inside your `onCreate` function and assign it the output of `getIntent()`. + `restorationHandler`: `void (^)(NSArray> * _Nullable)` + : A handler block to use for restoring the app’s state if needed. + {% /deflist %} + + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 6}" - startLineNumber=12 %} - ```java - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - } + title="AppDelegate.swift" + highlight="{range: 1}" + startLineNumber=29 %} + ```swift + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {} ``` {% /codeblock %} + {% /tab %} -1. Create a new `Uri` variable called `data` and assign it the output of `intent.getData()`. + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 1}" + startLineNumber=31 %} + ```objc + - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler {} + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} +1. Inside this function, return a call to `AdjustAdobeExtension.application` with each parameter passed in the parent function. + + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 7}" - startLineNumber=12 %} - ```java - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); + title="AppDelegate.swift" + highlight="{range: 2}" + startLineNumber=29 %} + ```swift + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + return AdjustAdobeExtension.application(application, continue: userActivity) } ``` {% /codeblock %} + {% /tab %} -1. Construct a new `AdjustDeeplink` instance with your `data` variable. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 8}" - startLineNumber=12 %} - ```java - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + title="AppDelegate.m" + highlight="{range: 2}" + startLineNumber=31 %} + ```objc + - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + return [AdjustAdobeExtension application:application continueUserActivity:userActivity]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} + +### Set up your View Controller {% #set-up-your-view-controller %} -1. To open the URL, pass your `AdjustDeeplink` instance and `getApplicationContext()` to the `Adjust.processDeeplink` method. +Next, you need to set up your View Controller. You'll use this file to set up your Adjust features later. For the purposes of this guide, you're only going to set up the `viewDidLoad` function to handle application startup. +1. Inside your View Controller file, createa a new `ViewController` class implementation. + + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 9}" - startLineNumber=12 %} - ```java - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); + title="ViewController.swift" + highlight="{range: 1}" + startLineNumber=4 %} + ```swift + class ViewController: UIViewController {} + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="ViewController.m" + highlight="{range: 1-2}" + startLineNumber=5 %} + ```objc + @implementation ViewController + @end + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + +1. Inside your `ViewController` class, create a void function that calls `super.viewDidLoad` to initialize your view. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="ViewController.swift" + highlight="{range: 3-5}" + startLineNumber=4 %} + ```swift + class ViewController: UIViewController { - Intent intent = getIntent(); - Uri data = intent.getData(); - AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); - Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); + override func viewDidLoad() { + super.viewDidLoad() + } } ``` {% /codeblock %} + {% /tab %} - If you use [short branded links](https://help.adjust.com/en/article/short-branded-links), you can alternatively use the `Adjust.processAndResolveDeeplink` method to resolve your shortened link and return it to a callback function. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 9-14}" - startLineNumber=12 %} - ```java - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); + title="ViewController.m" + highlight="{range: 3-5}" + startLineNumber=5 %} + ```objc + @implementation ViewController - Intent intent = getIntent(); - Uri data = intent.getData(); - AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); - Adjust.processAndResolveDeeplink(adjustDeeplink, getApplicationContext(), new OnDeeplinkResolvedListener() { - @Override - public void onDeeplinkResolved(String s) { - Log.d("example", "Unwrapped short link: " + s); - } - }); + - (void)viewDidLoad { + [super viewDidLoad]; } + + @end ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -Once you've completed these steps, build and run your app. In your log viewer, set the filter `tag:Adjust` to show only logs relating to the Adjust Extension. After you launch your app, you should see the message `Install tracked`. +Once you've completed these steps, build and run your app. After you launch your app, you should see the message `Install tracked` in your Xcode logs. From 7e61c89cd11b82262c11c198c97d5a0cbad842fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 15 Nov 2024 12:59:32 +0100 Subject: [PATCH 3/6] Update guides --- .../en/sdk/adobe-extension/_codeblocks.mdoc | 113 ----- .../sdk/adobe-extension/ios/attribution.mdoc | 127 ++++-- .../sdk/adobe-extension/ios/deep-linking.mdoc | 322 +++++++++----- .../en/sdk/adobe-extension/ios/events.mdoc | 402 +++++++++++------- .../ios/external-device-id.mdoc | 176 +++++--- .../ios/global-parameters.mdoc | 237 +++++++---- .../en/sdk/adobe-extension/ios/index.mdoc | 2 +- .../sdk/adobe-extension/ios/integration.mdoc | 88 +++- .../sdk/adobe-extension/ios/preinstalled.mdoc | 212 ++++----- .../sdk/adobe-extension/ios/push-tokens.mdoc | 227 +++++----- 10 files changed, 1110 insertions(+), 796 deletions(-) delete mode 100644 src/content/docs/en/sdk/adobe-extension/_codeblocks.mdoc diff --git a/src/content/docs/en/sdk/adobe-extension/_codeblocks.mdoc b/src/content/docs/en/sdk/adobe-extension/_codeblocks.mdoc deleted file mode 100644 index 54ffd31cb..000000000 --- a/src/content/docs/en/sdk/adobe-extension/_codeblocks.mdoc +++ /dev/null @@ -1,113 +0,0 @@ -```objc -#import "AppDelegate.h" -@import AEPCore; -@import AEPServices; -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [AEPMobileCore setLogLevel: AEPLogLevelTrace]; - const UIApplicationState appState = application.applicationState; - - // Adjust Adobe Extension configuration - AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:{environment}]; - [AdjustAdobeExtension setConfiguration:config]; - - // Adjust Adobe Extension registration - [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] - completion:^{ - [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; - - if (appState != UIApplicationStateBackground) { - // only start lifecycle if the application is not in the background - [AEPMobileCore lifecycleStart:nil]; - } - }]; - - return YES; -} - -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - return [AdjustAdobeExtension application:app openURL:url options:options]; -} - -- (BOOL)application:(UIApplication *)application -continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { - return [AdjustAdobeExtension application:application - continueUserActivity:userActivity]; -} - - -#pragma mark - UISceneSession lifecycle - -- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; -} - -1 -- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. -} - - -@end -``` - -```swift -import UIKit -import AEPCore -import AEPServices -import AdjustAdobeExtension - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - MobileCore.setLogLevel(LogLevel.trace) - let appState = application.applicationState - - // Adjust Adobe Extension configuration - if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { - AdjustAdobeExtension.setConfiguration(config) - } - - // Adjust Adobe Extension registration - MobileCore.registerExtensions([AdjustAdobeExtension.self]) { - MobileCore.configureWith(appId: "{your_adobe_app_id}") - if appState != .background { - // Only start lifecycle if the application is not in the background - MobileCore.lifecycleStart(additionalContextData: nil) - } - } - return true - } - - func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { - return AdjustAdobeExtension.application(app, open: url, options: options) - } - - func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { - return AdjustAdobeExtension.application(application, continue: userActivity) - } - - // MARK: UISceneSession Lifecycle - - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } - - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - // Called when the user discards a scene session. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. - } -} - -``` diff --git a/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc index 0d0576bd7..d340542f8 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc @@ -17,12 +17,12 @@ To set a callback function to listen for attribution changes, call the `setAttri {% deflist %} `attributionChangedBlock`: `OnAttributionChangedListener` -: A function that returns `void` and receives device attribution information as a serialized `ADJAttribution` object. +: A function that returns `void` and receives device attribution information as a serialized attribution object. {% /deflist %} ## Tutorial: Create an attribution callback {% #tutorial %} -To configure an attribution callback, you need to create a function and assign it to your `AdjustAdobeExtensionConfig` instance. In this tutorial, you'll build on `MainApp.java` from the [integration guide](/en/sdk/adobe-extension/android/integration) and add an `onAttributionChanged` callback function that outputs the user's attribution information to logs as a string. The final result looks like this: +To configure an attribution callback, you need to create a function and assign it to your `AdjustAdobeExtensionConfig` instance. In this tutorial, you'll build on the App Delegate from the [integration guide](/en/sdk/adobe-extension/ios/integration) and create a completion function that outputs the user's attribution information to logs as a string. The final result looks like this: {% tabs %} {% tab title="Swift" sync="swift" %} @@ -41,6 +41,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let appState = application.applicationState if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setAttributionChangedBlock({ attribution in + print("Adjust Attribution Callback received: [\(attribution.description)]") + }) AdjustAdobeExtension.setConfiguration(config) } @@ -54,11 +57,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { - return AdjustAdobeExtension.application(app, open: url, options: options) + if let deeplink = ADJDeeplink(deeplink: url) { + Adjust.processDeeplink(deeplink) + } + return true } func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { - return AdjustAdobeExtension.application(application, continue: userActivity) + if userActivity.activityType == NSUserActivityTypeBrowsingWeb { + if let incomingUrl = userActivity.webpageUrl { + if let deeplink = ADJDeeplink(deeplink: incomingUrl) { + Adjust.processDeeplink(deeplink) + } + } + } + return true } } ``` @@ -79,16 +92,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate { const UIApplicationState appState = application.applicationState; // Adjust Adobe Extension configuration - AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:{environment}]; + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [adjustConfig setAttributionChangedBlock:^(ADJAttribution * _Nullable attribution) { + NSLog(@"Adjust Attribution Callback received:[%@]", attribution.description); + }]; [AdjustAdobeExtension setConfiguration:config]; - // Adjust Adobe Extension registration [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] completion:^{ [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; if (appState != UIApplicationStateBackground) { - // only start lifecycle if the application is not in the background [AEPMobileCore lifecycleStart:nil]; } }]; @@ -97,14 +111,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - return [AdjustAdobeExtension application:app openURL:url options:options]; + [Adjust processDeeplink: [[ADJDeeplink alloc] initWithDeeplink:url]]; + return YES; } -- (BOOL)application:(UIApplication *)application -continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { - return [AdjustAdobeExtension application:application - continueUserActivity:userActivity]; +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + [Adjust proceessDeeplink:[[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]]]; + } + return YES; } @end ``` @@ -113,52 +128,70 @@ continueUserActivity:(NSUserActivity *)userActivity Here's what you need to do: -1. Inside the `try...catch` block, call the `setOnAttributionChangedListener` method of your `AdjustAdobeExtensionConfig` instance. Pass an `OnAttributionChangedListener` instance as an argument. - - {% codeblock highlight="{range: 6}" startLineNumber=21 %} - ```java - try { - MobileCore.configureWithAppID("your_adobe_app_id"); - - AdjustAdobeExtensionConfig config = - new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); - config.setOnAttributionChangedListener(new OnAttributionChangedListener() {}); - AdjustAdobeExtension.setConfiguration(config); - } catch (Exception e) { - Log.e("example", "Exception occurred during configuration: " + e.getMessage()); +1. Inside your App Delegate, find your `AdjustAdobeExtensionConfig` instantiation. On the next line, call the `setAttributionChangedBlock` method with a function block as an argument. This function block receives the attribution information. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 2}" + startLineNumber=13 %} + ```swift + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setAttributionChangedBlock({ attribution in }) + AdjustAdobeExtension.setConfiguration(config) } ``` {% /codeblock %} + {% /tab %} -1. Create a new public function called `onAttributionChanged` inside your `setOnAttributionChangedListener` declaration. This method takes an `AdjustAttribution` argument and returns `void`. + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 2}" + startLineNumber=14 %} + ```objc + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [adjustConfig setAttributionChangedBlock:^(ADJAttribution * _Nullable attribution) {}]; + [AdjustAdobeExtension setConfiguration:config]; + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} +1. Inside the function block, output the attribution description to the Xcode logger. + + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainApp.java" + title="AppDelegate.swift" highlight="{range: 3}" - startLineNumber=26 %} - ```java - config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution adjustAttribution) {} - }); + startLineNumber=13 %} + ```swift + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setAttributionChangedBlock({ attribution in + print("Adjust Attribution Callback received: [\(attribution.description)]") + }) + AdjustAdobeExtension.setConfiguration(config) + } ``` {% /codeblock %} + {% /tab %} -1. Inside the `onAttributionChanged` function body, log the `AdjustAttribution` object by converting it to a string. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainApp.java" - highlight="{range: 4-5}" - startLineNumber=26 %} - ```java - config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution adjustAttribution) { - Log.d("example", "Attribution information updated"); - Log.d("example", "Attribution: " + attribution.toString()); - } - }); + title="AppDelegate.m" + highlight="{range: 2}" + startLineNumber=14 %} + ```objc + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [adjustConfig setAttributionChangedBlock:^(ADJAttribution * _Nullable attribution) { + NSLog(@"Adjust Attribution Callback received:[%@]", attribution.description); + }]; + [AdjustAdobeExtension setConfiguration:config]; ``` {% /codeblock %} + {% /tab %} + {% /tabs %} That's it! When a user's attribution information changes, this callback function writes out the updated attribution information to the system log. diff --git a/src/content/docs/en/sdk/adobe-extension/ios/deep-linking.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/deep-linking.mdoc index 5a651093f..69a29b3f8 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/deep-linking.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/deep-linking.mdoc @@ -6,7 +6,7 @@ sidebar-position: 6 Deep links are URIs (Uniform Resource Identifiers) that direct users to specific pages within your app. They enhance user experience by guiding them directly to relevant content after they interact with a link. -The Adjust Android Extension for the Adobe Experience SDK supports two types of deep linking, based on whether the user has already installed your app: +The Adjust iOS Extension for the Adobe Experience SDK supports two types of deep linking, based on whether the user has already installed your app: - **Direct deep links**: If the user already has your app installed, the link opens the specified page. - **Deferred deep links**: If the user doesn’t have your app installed, the link directs them to the app store to install it. After installation, the app opens the specified page. @@ -15,182 +15,272 @@ The Adjust Android Extension for the Adobe Experience SDK supports two types of You can reattribute your users by sending deep link information to Adjust. When a user engages with a deep link, you can send this data to Adjust to update their attribution information. -1. First, create an `AdjustDeeplink` instance with your deep link URI. The `AdjustDeeplink` class validates this URI and checks the formatted string to ensure successful processing. +1. First, create an `ADJDeeplink` instance with your deep link URI. The `ADJDeeplink` class validates this URI and checks the formatted string to ensure successful processing. -1. Then, call the `Adjust.processDeeplink` function to handle the deep link and pass the information to Adjust. +1. Then, call the `processDeeplink` function to handle the deep link and pass the information to Adjust. -The `AdjustDeeplink` class constructor requires the following argument: +The `ADJDeeplink` class constructor requires the following argument: {% deflist %} -`url`: `Uri` +`deeplink`: `NSURL` : The deep link URI that opens your app. {% /deflist %} -The `Adjust.processDeeplink` function requires the following arguments: +The `processDeeplink` function requires the following argument: {% deflist %} -`adjustDeeplink`: `AdjustDeeplink` +`adjustDeeplink`: `ADJDeeplink` -: The `AdjustDeeplink` instance you created. - -`context`: `Context` - -: The application context. +: The `ADJDeeplink` instance you created. {% /deflist %} ## Deferred deep link callbacks {% #deferred-deep-link-callbacks %} -The Adjust Android Extension for Adobe Experience SDK opens deferred deep links by default. To control this behavior, or perform validation before the deep link is opened, configure the extension to call a function when the app opens via a deferred deep link. +The Adjust iOS Extension for Adobe Experience SDK opens deferred deep links by default. To control this behavior, or perform validation before the deep link is opened, configure the extension to call a function when the app opens via a deferred deep link. -1. Call `setOnDeferredDeeplinkResponseListener` on your `AdjustAdobeExtensionConfig` instance. +1. Call `setDeferredDeeplinkReceivedBlock` on your `AdjustAdobeExtensionConfig` instance. 1. Call `AdjustAdobeExtension.setConfiguration` to set your configuration. -The `OnDeferredDeeplinkResponseListener` function requires the following argument: +The `setDeferredDeeplinkReceivedBlock` function requires the following argument: {% deflist %} -`onDeferredDeeplinkResponseListener`: `OnDeferredDeeplinkResponseListener` +`deeplinkResponseBlock`: `CallbackDeeplinkResponseBlock` : A function that returns a `boolean` value. If it returns `false`, the extension won't open the deferred deep link. {% /deflist %} ### Tutorial: Create a deferred deep link function {% #tutorial %} -If you followed the [integration guide](/en/sdk/adobe-extension/android/integration), you've already configured the Adjust Extension to process and open deep links. If you haven't done this, refer to [set up deep link handling](/en/sdk/adobe-extension/android/integration#set-up-deep-link-handling) for instructions. +If you followed the [integration guide](/en/sdk/adobe-extension/ios/integration), you've already configured the Adjust Extension to process and open deep links. If you haven't done this, refer to [set up deep link handling](/en/sdk/adobe-extension/ios/integration#set-up-deep-link-handling) for instructions. -In this tutorial, you'll learn how to create a callback function that controls deep linking functionality using the `setOnDeferredDeeplinkResponseListener` method. The function will open the link depending on the following condition: +In this tutorial, you'll learn how to create a callback function that controls deep linking functionality using the `setDeferredDeeplinkReceivedBlock` method. The function will open the link depending on the following condition: "If the deep link contains `"no_open"`, the app won't open it." The result looks like this: -```java -import android.app.Application; -import android.util.Log; - -import com.adjust.adobeextension.AdjustAdobeExtension; -import com.adjust.adobeextension.AdjustAdobeExtensionConfig; -import com.adobe.marketing.mobile.AdobeCallback; -import com.adobe.marketing.mobile.Extension; -import com.adobe.marketing.mobile.Analytics; -import com.adobe.marketing.mobile.Identity; -import com.adobe.marketing.mobile.LoggingMode; -import com.adobe.marketing.mobile.MobileCore; - -public class MainApp extends Application { - @Override - public void onCreate() { - super.onCreate(); - - MobileCore.setApplication(this); - MobileCore.setLogLevel(LoggingMode.VERBOSE); - - try { - MobileCore.configureWithAppID("your_adobe_app_id"); - - AdjustAdobeExtensionConfig config = - new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); - config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - if (deeplink.contains("no_open")) { - return false; - } else { - return true; - } - } - }); - AdjustAdobeExtension.setConfiguration(config); - } catch (Exception e) { - Log.e("example", "Exception occurred during configuration: " + e.getMessage()); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// AppDelegate.swift +import UIKit +import AEPCore +import AEPServices +import AdjustAdobeExtension + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setDeferredDeeplinkReceivedBlock { (deeplink: URL?) -> Bool in + if let deeplinkString = deeplink?.absoluteString.lowercased(), + deeplinkString.contains("no_open") { + return false + } + return true } + AdjustAdobeExtension.setConfiguration(config) + } + + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { + MobileCore.configureWith(appId: "{your_adobe_app_id}") + if appState != .background { + MobileCore.lifecycleStart(additionalContextData: nil) + } + } + return true + } + + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + if let deeplink = ADJDeeplink(deeplink: url) { + Adjust.processDeeplink(deeplink) + } + return true + } - try { - List> extensions = Arrays.asList( - Analytics.EXTENSION, - Identity.EXTENSION, - AdjustAdobeExtension.EXTENSION); - MobileCore.registerExtensions(extensions, new AdobeCallback() { - @Override - public void call(Object o) { - Log.d("example", "Adjust Adobe Extension SDK initialized"); + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + if userActivity.activityType == NSUserActivityTypeBrowsingWeb { + if let incomingUrl = userActivity.webpageUrl { + if let deeplink = ADJDeeplink(deeplink: incomingUrl) { + Adjust.processDeeplink(deeplink) + } } - }); - } catch (Exception e) { - Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); } + return true } } ``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +// AppDelegate.m +#import "AppDelegate.h" +@import AEPCore; +@import AEPServices; +#import + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [config setDeferredDeeplinkReceivedBlock:^BOOL(NSURL * _Nullable deeplink) { + if (deeplink && [[deeplink.absoluteString lowercaseString] containsString:@"no_open"]) { + return NO; + } + return YES; + }]; + [AdjustAdobeExtension setConfiguration:config]; + + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] + completion:^{ + [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; + + if (appState != UIApplicationStateBackground) { + [AEPMobileCore lifecycleStart:nil]; + } + }]; + + return YES; +} + +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + [Adjust processDeeplink: [[ADJDeeplink alloc] initWithDeeplink:url]]; + return YES; +} + +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + [Adjust proceessDeeplink:[[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]]]; + } + return YES; +} +@end +``` +{% /tab %} +{% /tabs %} Here's what you need to do: -1. Inside the `try...catch` block, call the `setOnDeferredDeeplinkResponseListener` method of your `AdjustAdobeExtensionConfig` instance. Pass an `OnDeferredDeeplinkResponseListener` instance as an argument. +1. Inside your App Delegate, find your `AdjustAdobeExtensionConfig` instantiation. On the next line, call the `setDeferredDeeplinkReceivedBlock` method with a function block as an argument. This function block receives the deep link as an argument. + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainApp.java" - highlight="{range: 6}" - startLineNumber=21 %} - ```java - try { - MobileCore.configureWithAppID("your_adobe_app_id"); - - AdjustAdobeExtensionConfig config = - new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); - config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() {}); - AdjustAdobeExtension.setConfiguration(config); - } catch (Exception e) { - Log.e("example", "Exception occurred during configuration: " + e.getMessage()); - } + title="AppDelegate.swift" + startLineNumber=13 + highlight="{range: 2}" %} + ```swift + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setDeferredDeeplinkReceivedBlock { (deeplink: URL?) -> Bool in } + AdjustAdobeExtension.setConfiguration(config) + } ``` {% /codeblock %} + {% /tab %} -1. Create a new public function called `launchReceivedDeeplink` inside your `OnDeferredDeeplinkResponseListener` declaration. This method takes a `Uri` argument and returns a `boolean`. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainApp.java" - highlight="{range: 3}" - startLineNumber=26 %} - ```java - config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { - @Override - public boolean launchReceivedDeeplink(Uri deeplink) {} - }); + title="AppDelegate.m" + startLineNumber=12 + highlight="{range: 2}" %} + ```objc + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [config setDeferredDeeplinkReceivedBlock:^BOOL(NSURL * _Nullable deeplink) {}]; + [AdjustAdobeExtension setConfiguration:config]; ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -1. Add an `if` condition to the `launchReceivedDeeplink` to check if the `deeplink` contains the value `"no_open"`. If the string is found, the function returns `false`, and the app shouldn't open the deferred deep link. +1. Inside the `setDeferredDeeplinkReceivedBlock` function block, add an `if` block to check whether the deep link contains the string `"no_open"`. If it does, return `false`. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + startLineNumber=13 + highlight="{range: 3-6}" %} + ```swift + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setDeferredDeeplinkReceivedBlock { (deeplink: URL?) -> Bool in + if let deeplinkString = deeplink?.absoluteString.lowercased(), + deeplinkString.contains("no_open") { + return false + } + } + AdjustAdobeExtension.setConfiguration(config) + } + ``` + {% /codeblock %} + {% /tab %} + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainApp.java" - highlight="{range: 3-5}" - startLineNumber=27 %} - ```java - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - if (deeplink.contains("no_open")) { - return false; + title="AppDelegate.m" + startLineNumber=12 + highlight="{range: 3-5}" %} + ```objc + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [config setDeferredDeeplinkReceivedBlock:^BOOL(NSURL * _Nullable deeplink) { + if (deeplink && [[deeplink.absoluteString lowercaseString] containsString:@"no_open"]) { + return NO; } - } + }]; + [AdjustAdobeExtension setConfiguration:config]; ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -1. Finally, add an `else` block to return `true` if the deep link doesn't contain `"no_open"`. +1. Finally, return `true` to open all deep links that don't contain `"no_open"`. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + startLineNumber=13 + highlight="{range: 7}" %} + ```swift + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setDeferredDeeplinkReceivedBlock { (deeplink: URL?) -> Bool in + if let deeplinkString = deeplink?.absoluteString.lowercased(), + deeplinkString.contains("no_open") { + return false + } + return true + } + AdjustAdobeExtension.setConfiguration(config) + } + ``` + {% /codeblock %} + {% /tab %} + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainApp.java" - highlight="{range: 5-7}" - startLineNumber=27 %} - ```java - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - if (deeplink.contains("no_open")) { - return false; - } else { - return true; + title="AppDelegate.m" + startLineNumber=12 + highlight="{range: 6}" %} + ```objc + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [config setDeferredDeeplinkReceivedBlock:^BOOL(NSURL * _Nullable deeplink) { + if (deeplink && [[deeplink.absoluteString lowercaseString] containsString:@"no_open"]) { + return NO; } - } + return YES; + }]; + [AdjustAdobeExtension setConfiguration:config]; ``` {% /codeblock %} + {% /tab %} + {% /tabs %} That's it! When a user opens your app with a deferred deep link, the Adjust Extension will check if the link contains the string `"no_open"`. If it does, the app won't open the deep link. diff --git a/src/content/docs/en/sdk/adobe-extension/ios/events.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/events.mdoc index 2ec90fc5c..7b549edc2 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/events.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/events.mdoc @@ -10,44 +10,44 @@ For more information on configuring events in Adjust, visit the [Add events guid ## How it works {% #how-it-works %} -Event information is sent to Adjust when the following information is passed to the `MobileCore.trackAction` API: +Event information is sent to Adjust when the following information is passed to the `MobileCore.track` API: -1. `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT`: a string value that maps to the Adjust `trackEvent` method. -1. `contextData`: a HashMap of values used to configure your event. +1. `ADJAdobeAdjustActionTrackEvent`: a string value that maps to the Adjust `trackEvent` method. +1. `data`: a dictionary of values used to configure your event. -When you call `MobileCore.trackAction` with these arguments, the Adjust extension creates an event instance, passes it to the `trackEvent` method, and sends the information to Adjust. +When you call `MobileCore.track` with these arguments, the Adjust extension creates an event instance, passes it to the `trackEvent` method, and sends the information to Adjust. ## Reference {% #reference %} -The `contextData` HashMap holds information about an event. Each event is represented by a unique `contextData` HashMap. To configure your event instance, add values to HashMap. +The `data` dictionary holds information about an event. Each event is represented by a unique `data` dictionary. To configure your event instance, add values to dictionary. The following keys are supported: {% deflist %} -`AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN` +`ADJAdobeAdjustEventToken` : Your Adjust event token. You MUST set this value to send event information to Adjust. Check out [add events](https://help.adjust.com/en/article/add-events#manage-your-events) for more information. -`AdjustAdobeExtension.ADOBE_ADJUST_REVENUE` +`ADJAdobeAdjustEventRevenue` : The amount of revenue associated with the event. This value should be a string that represents a numerical value. -`AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY`. +`ADJAdobeAdjustEventCurrency`. : An [ISO 4217](https://www.iban.com/currency-codes) currency code. -`AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX` +`ADJAdobeAdjustEventCallbackParamPrefix` : Append a callback parameter key to this prefix and add your callback parameter value to send callbacks to Adjust. -`AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX` +`ADJAdobeAdjustEventPartnerParamPrefix` : Append a partner parameter key to this prefix and add your partner parameter value to send callbacks to third parties. {% /deflist %} ## Tutorial: Send an event {% #tutorial %} -To send event information, you need to add a function to your main activity. In this tutorial, you'll build on `MainActivity.java` from the [integration guide](/en/sdk/adobe-extension/android/integration) and add a new function called `sendEventToAdjust` which will send an event with the following properties: +To send event information, you need to add a function to your main activity. In this tutorial, you'll build on your View Controller from the [integration guide](/en/sdk/adobe-extension/ios/integration) and send a new event to Adjust with the following properties - An event token: `"g3mfiw"`. - 1 Euro of event revenue. @@ -56,204 +56,302 @@ To send event information, you need to add a function to your main activity. In The final result looks like this: -```java -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.view.View; - -import androidx.appcompat.app.AppCompatActivity; - -import com.adjust.sdk.Adjust; -import com.adjust.sdk.AdjustDeeplink; -import com.adobe.marketing.mobile.MobileCore; - -import java.util.HashMap; -import java.util.Map; - -public class MainActivity extends AppCompatActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); - Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); - } - - public void sendEventToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "user_id", "855"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "event_token", "g3mfiw"); - - MobileCore.trackAction(action, contextData); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// ViewController.swift +import AEPCore +import AdjustAdobeExtension + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + var dataDict: Dictionary = [String : String]() + dataDict[ADJAdobeAdjustEventToken] = "g3mfiw" + dataDict[ADJAdobeAdjustEventRevenue] = "0.01" + dataDict[ADJAdobeAdjustEventCurrency] = "EUR" + dataDict[ADJAdobeAdjustEventCallbackParamPrefix.appending("user_id")] = "855" + dataDict[ADJAdobeAdjustEventPartnerParamPrefix.appending("event_token")] = "g3mfiw" + MobileCore.track(action: ADJAdobeAdjustActionTrackEvent, data: dataDict) } } ``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +// ViewController.m +#import "ViewController.h" +@import AEPCore; +#import + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + [dataDict setValue:@"g3mfiw" forKey:ADJAdobeAdjustEventToken]; + [dataDict setValue:@"1.0" forKey:ADJAdobeAdjustEventRevenue]; + [dataDict setValue:@"EUR" forKey:ADJAdobeAdjustEventCurrency]; + [dataDict setValue:@"855" forKey:[ADJAdobeAdjustEventCallbackParamPrefix stringByAppendingString:@"user_id"]]; + [dataDict setValue:@"855" forKey:[ADJAdobeAdjustEventPartnerParamPrefix stringByAppendingString:@"event_token"]]; + [AEPMobileCore trackAction:ADJAdobeAdjustActionTrackEvent + data:dataDict]; + [dataDict removeAllObjects]; +} + +@end +``` +{% /tab %} +{% /tabs %} Here's what you need to do: -1. First, import the following classes: +1. Inside your `viewDidLoad` function block, create a new dictionary called `dataDict`. This is used to hold the properties of the event. - - `com.adobe.marketing.mobile.MobileCore`: this class is used to send information to Adobe and Adjust. - - `java.util.HashMap`: this class is used to generate the `contextData` HashMap. - - `java.util.Map`: this class is used to type the `contextData` HashMap. + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="ViewController.swift" + startLineNumber=6 + highlight="{range: 4}" %} + ```swift + override func viewDidLoad() { + super.viewDidLoad() + + var dataDict: Dictionary = [String : String]() + } + ``` + {% /codeblock %} + {% /tab %} - ```java - // MainActivity.java - import com.adobe.marketing.mobile.MobileCore; + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="ViewController.m" + startLineNumber=6 + highlight="{range: 4}" %} + ```objc + - (void)viewDidLoad { + [super viewDidLoad]; - import java.util.HashMap; - import java.util.Map; + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + } ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} -1. Next, create a new function inside the `MainActivity` class called `sendEventToAdjust`. This function takes [the application `View`](https://developer.android.com/reference/android/view/View) as an argument and returns `void.` +1. Add your Adjust event token to the dictionary using the `ADJAdobeAdjustEventToken` key. This is required to inform Adjust which event you're trying to send. + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 13}" - startLineNumber=15 %} - ```java - public class MainActivity extends AppCompatActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); + title="ViewController.swift" + startLineNumber=6 + highlight="{range: 5}" %} + ```swift + override func viewDidLoad() { + super.viewDidLoad() - Intent intent = getIntent(); - Uri data = intent.getData(); - AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); - Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); - } + var dataDict: Dictionary = [String : String]() + dataDict[ADJAdobeAdjustEventToken] = "g3mfiw" + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="ViewController.m" + startLineNumber=6 + highlight="{range: 5}" %} + ```objc + - (void)viewDidLoad { + [super viewDidLoad]; - public void sendEventToAdjust(View view) {} + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + [dataDict setValue:@"g3mfiw" forKey:ADJAdobeAdjustEventToken]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -1. Inside the `sendEventToAdjust` function, declare a new `String` variable called `action` and assign it the value `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT`. This is used to tell `MobileCore.trackAction` which action to handle. +1. Add the event revenue amount using `ADJAdobeAdjustEventRevenue` for the amount and `ADJAdobeAdjustEventCurrency` for the currency. Both values MUST be passed as strings. + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 2}" - startLineNumber=27 %} - ```java - public void sendEventToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; + title="ViewController.swift" + startLineNumber=6 + highlight="{range: 6-7}" %} + ```swift + override func viewDidLoad() { + super.viewDidLoad() + + var dataDict: Dictionary = [String : String]() + dataDict[ADJAdobeAdjustEventToken] = "g3mfiw" + dataDict[ADJAdobeAdjustEventRevenue] = "0.01" + dataDict[ADJAdobeAdjustEventCurrency] = "EUR" } ``` {% /codeblock %} + {% /tab %} -1. Create a new HashMap variable called `contextData`. This is used to hold the properties of the event. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 3}" - startLineNumber=27 %} - ```java - public void sendEventToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); + title="ViewController.m" + startLineNumber=6 + highlight="{range: 6-7}" %} + ```objc + - (void)viewDidLoad { + [super viewDidLoad]; + + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + [dataDict setValue:@"g3mfiw" forKey:ADJAdobeAdjustEventToken]; + [dataDict setValue:@"1.0" forKey:ADJAdobeAdjustEventRevenue]; + [dataDict setValue:@"EUR" forKey:ADJAdobeAdjustEventCurrency]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -Now that the `contextData` HashMap is initialized, add values to build the event. You can refer back to the [`contextData` reference](#reference) for more information about the uses of each key. +1. Add a callback parameter using the `ADJAdobeAdjustEventCallbackParamPrefix` key. Append a callback identifier to the key to match the parameter in your callback URL. -1. Add your Adjust event token to the HashMap using the `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN` key. This is required to inform Adjust which event you're trying to send. + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="ViewController.swift" + startLineNumber=6 + highlight="{range: 8}" %} + ```swift + override func viewDidLoad() { + super.viewDidLoad() + + var dataDict: Dictionary = [String : String]() + dataDict[ADJAdobeAdjustEventToken] = "g3mfiw" + dataDict[ADJAdobeAdjustEventRevenue] = "0.01" + dataDict[ADJAdobeAdjustEventCurrency] = "EUR" + dataDict[ADJAdobeAdjustEventCallbackParamPrefix.appending("user_id")] = "855" + } + ``` + {% /codeblock %} + {% /tab %} + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 4}" - startLineNumber=27 %} - ```java - public void sendEventToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); + title="ViewController.m" + startLineNumber=6 + highlight="{range: 8}" %} + ```objc + - (void)viewDidLoad { + [super viewDidLoad]; + + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + [dataDict setValue:@"g3mfiw" forKey:ADJAdobeAdjustEventToken]; + [dataDict setValue:@"1.0" forKey:ADJAdobeAdjustEventRevenue]; + [dataDict setValue:@"EUR" forKey:ADJAdobeAdjustEventCurrency]; + [dataDict setValue:@"855" forKey:[ADJAdobeAdjustEventCallbackParamPrefix stringByAppendingString:@"user_id"]]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -1. Add the event revenue amount using `AdjustAdobeExtension.ADOBE_ADJUST_REVENUE` for the amount and `AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY` for the currency. Both values MUST be passed as strings. +1. Add a partner parameter using the `ADJAdobeAdjustEventPartnerParamPrefix` key. Append a callback identifier to the key to map it to your partner's placeholder. + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 5-6}" - startLineNumber=27 %} - ```java - public void sendEventToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); + title="ViewController.swift" + startLineNumber=6 + highlight="{range: 9}" %} + ```swift + override func viewDidLoad() { + super.viewDidLoad() + + var dataDict: Dictionary = [String : String]() + dataDict[ADJAdobeAdjustEventToken] = "g3mfiw" + dataDict[ADJAdobeAdjustEventRevenue] = "0.01" + dataDict[ADJAdobeAdjustEventCurrency] = "EUR" + dataDict[ADJAdobeAdjustEventCallbackParamPrefix.appending("user_id")] = "855" + dataDict[ADJAdobeAdjustEventPartnerParamPrefix.appending("event_token")] = "g3mfiw" } ``` {% /codeblock %} + {% /tab %} -1. Add a callback parameter using the `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX` key. Append a callback identifier to the key to match the parameter in your callback URL. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 7}" - startLineNumber=27 %} - ```java - public void sendEventToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "user_id", "855"); + title="ViewController.m" + startLineNumber=6 + highlight="{range: 9}" %} + ```objc + - (void)viewDidLoad { + [super viewDidLoad]; + + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + [dataDict setValue:@"g3mfiw" forKey:ADJAdobeAdjustEventToken]; + [dataDict setValue:@"1.0" forKey:ADJAdobeAdjustEventRevenue]; + [dataDict setValue:@"EUR" forKey:ADJAdobeAdjustEventCurrency]; + [dataDict setValue:@"855" forKey:[ADJAdobeAdjustEventCallbackParamPrefix stringByAppendingString:@"user_id"]]; + [dataDict setValue:@"855" forKey:[ADJAdobeAdjustEventPartnerParamPrefix stringByAppendingString:@"event_token"]]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -1. Add a partner parameter using the `AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX` key. Append a callback identifier to the key to map it to your partner's placeholder. +1. Finally, to send the event information to Adjust, call `MobileCore.track` with `ADJAdobeAdjustActionTrackEvent` and your `dataDict` dictionary. If you're using Objective-C, call `removeAllObjects` on your `dataDict` dictionary to deallocate it. + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 8}" - startLineNumber=27 %} - ```java - public void sendEventToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "user_id", "855"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "event_token", "g3mfiw"); + title="ViewController.swift" + startLineNumber=6 + highlight="{range: 10}" %} + ```swift + override func viewDidLoad() { + super.viewDidLoad() + + var dataDict: Dictionary = [String : String]() + dataDict[ADJAdobeAdjustEventToken] = "g3mfiw" + dataDict[ADJAdobeAdjustEventRevenue] = "0.01" + dataDict[ADJAdobeAdjustEventCurrency] = "EUR" + dataDict[ADJAdobeAdjustEventCallbackParamPrefix.appending("user_id")] = "855" + dataDict[ADJAdobeAdjustEventPartnerParamPrefix.appending("event_token")] = "g3mfiw" + MobileCore.track(action: ADJAdobeAdjustActionTrackEvent, data: dataDict) } ``` {% /codeblock %} + {% /tab %} -1. Finally, to send the event information to Adjust, call `MobileCore.trackAction` with your `action` and `contextData` variables. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 10}" - startLineNumber=27 %} - ```java - public void sendEventToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "g3mfiw"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "1.00"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "user_id", "855"); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "event_token", "g3mfiw"); + title="ViewController.m" + startLineNumber=6 + highlight="{range: 10-12}" %} + ```objc + - (void)viewDidLoad { + [super viewDidLoad]; - MobileCore.trackAction(action, contextData); + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + [dataDict setValue:@"g3mfiw" forKey:ADJAdobeAdjustEventToken]; + [dataDict setValue:@"1.0" forKey:ADJAdobeAdjustEventRevenue]; + [dataDict setValue:@"EUR" forKey:ADJAdobeAdjustEventCurrency]; + [dataDict setValue:@"855" forKey:[ADJAdobeAdjustEventCallbackParamPrefix stringByAppendingString:@"user_id"]]; + [dataDict setValue:@"855" forKey:[ADJAdobeAdjustEventPartnerParamPrefix stringByAppendingString:@"event_token"]]; + [AEPMobileCore trackAction:ADJAdobeAdjustActionTrackEvent + data:dataDict]; + [dataDict removeAllObjects]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -That's it! When the user performs an action that maps to the `sendEventToAdjust` function, an event is constructed and sent to Adjust. +That's it! Your View Controller constructs an event and sends to Adjust. diff --git a/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc index dc76ab81f..26028809d 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc @@ -8,90 +8,146 @@ An [external device identifier](https://help.adjust.com/en/article/external-devi Using external device IDs can produce different results depending on your setup. If you want to use them, contact your Adjust representative. They will talk you through the best approach for your use case. -You must set your external device ID in your `AdjustAdobeExtensionConfig` instance before you call `AdjustAdobeExtension.setConfiguration`. You can't change this property after you've initialized the extension. +You must set your external device ID in your `AdjustAdobeExtensionConfig` instance before you call `setConfiguration`. You can't change this property after you've initialized the extension. ## Reference {% #reference %} To set an external device ID, call the `setExternalDeviceId` method of your `AdjustAdobeExtensionConfig` instance with the following argument: {% deflist %} -`externalDeviceId`: `String` +`externalDeviceId`: `NSString` : Your external device identifier. {% /deflist %} ## Tutorial: Set an external device ID {% #tutorial %} -To set an external device ID, you need to set the ID using your `AdjustAdobeExtensionConfig` instance. If you followed the [integration guide](/en/sdk/adobe-extension/android/integration), your `MainApp.java` file should look something like this: - -```java -// MainApp.java -import android.app.Application; -import android.util.Log; - -import com.adjust.adobeextension.AdjustAdobeExtension; -import com.adjust.adobeextension.AdjustAdobeExtensionConfig; -import com.adobe.marketing.mobile.AdobeCallback; -import com.adobe.marketing.mobile.Extension; -import com.adobe.marketing.mobile.Analytics; -import com.adobe.marketing.mobile.Identity; -import com.adobe.marketing.mobile.LoggingMode; -import com.adobe.marketing.mobile.MobileCore; - -public class MainApp extends Application { - @Override - public void onCreate() { - super.onCreate(); - - MobileCore.setApplication(this); - MobileCore.setLogLevel(LoggingMode.VERBOSE); - - try { - MobileCore.configureWithAppID("your_adobe_app_id"); - - AdjustAdobeExtensionConfig config = - new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); - AdjustAdobeExtension.setConfiguration(config); - } catch (Exception e) { - Log.e("example", "Exception occurred during configuration: " + e.getMessage()); +To set an external device ID, you need to set the ID using your `AdjustAdobeExtensionConfig` instance. If you followed the [integration guide](/en/sdk/adobe-extension/ios/integration), your App Delegate should look something like this: + +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// AppDelegate.swift +import UIKit +import AEPCore +import AEPServices +import AdjustAdobeExtension + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + AdjustAdobeExtension.setConfiguration(config) } - try { - List> extensions = Arrays.asList( - Analytics.EXTENSION, - Identity.EXTENSION, - AdjustAdobeExtension.EXTENSION); - MobileCore.registerExtensions(extensions, new AdobeCallback() { - @Override - public void call(Object o) { - Log.d("example", "Adjust Adobe Extension SDK initialized"); - } - }); - } catch (Exception e) { - Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { + MobileCore.configureWith(appId: "{your_adobe_app_id}") + if appState != .background { + MobileCore.lifecycleStart(additionalContextData: nil) + } } + return true } + + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + if let deeplink = ADJDeeplink(deeplink: url) { + Adjust.processDeeplink(deeplink) + } + return true + } + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + if userActivity.activityType == NSUserActivityTypeBrowsingWeb { + if let incomingUrl = userActivity.webpageUrl { + if let deeplink = ADJDeeplink(deeplink: incomingUrl) { + Adjust.processDeeplink(deeplink) + } + } + } + return true + } } ``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +// AppDelegate.m +#import "AppDelegate.h" +@import AEPCore; +@import AEPServices; +#import + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [AdjustAdobeExtension setConfiguration:config]; + + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] + completion:^{ + [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; + + if (appState != UIApplicationStateBackground) { + [AEPMobileCore lifecycleStart:nil]; + } + }]; + + return YES; +} + +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + [Adjust processDeeplink: [[ADJDeeplink alloc] initWithDeeplink:url]]; + return YES; +} + +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + [Adjust proceessDeeplink:[[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]]]; + } + return YES; +} +@end +``` +{% /tab %} +{% /tabs %} To set a default link token for preinstalled apps, pass the link token to the `setExternalDeviceId` method of the `AdjustAdobeExtensionConfig` instance. The ID is sent to Adjust with each session. In this example, the external device ID is set to _{% $variables.config.externalDeviceId %}_. +{% tabs %} +{% tab title="Swift" sync="swift" %} {% codeblock - title="MainApp.java" - highlight="{range: 6}" - startLineNumber=21 %} -```java -try { - MobileCore.configureWithAppID("your_adobe_app_id"); - - AdjustAdobeExtensionConfig config = - new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); - config.setExternalDeviceId("{% $variables.config.externalDeviceId %}"); - AdjustAdobeExtension.setConfiguration(config); -} catch (Exception e) { - Log.e("example", "Exception occurred during configuration: " + e.getMessage()); + title="AppDelegate.swift" + highlight="{range: 2}" + startLineNumber=13 %} +```swift +if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setExternalDeviceId("{% $variables.config.externalDeviceId %}") + AdjustAdobeExtension.setConfiguration(config) } ``` {% /codeblock %} +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +{% codeblock + title="AppDelegate.m" + highlight="{range: 2}" + startLineNumber=12 %} +```objc +AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; +[adjustConfig setExternalDeviceId:@"{% $variables.config.externalDeviceId %}"]; +[AdjustAdobeExtension setConfiguration:config]; +``` +{% /codeblock %} +{% /tab %} +{% /tabs %} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/global-parameters.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/global-parameters.mdoc index 9ca2106aa..5dd7daa57 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/global-parameters.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/global-parameters.mdoc @@ -17,54 +17,85 @@ The `Adjust` class methods manage the global callback parameters. You can add an ### Add a global callback parameter {% #add-global-callback-parameter %} -To add a global callback parameter, call the `Adjust.addGlobalCallbackParameter` method with the following arguments: +To add a global callback parameter, call the `addGlobalCallbackParameter` method with the following arguments: {% deflist %} -`key`: `String` +`key`: `NSString` : The parameter key. -`value`: `String` +`value`: `NSString` : The parameter value. {% /deflist %} -You can add multiple parameters by calling the `Adjust.addGlobalCallbackParameter` method multiple times. +You can add multiple parameters by calling the `addGlobalCallbackParameter` method multiple times. -```java -Adjust.addGlobalCallbackParameter("key", "value"); -Adjust.addGlobalCallbackParameter("user_id", "855"); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +Adjust.addGlobalCallbackParameter("value", forKey: "key") +Adjust.addGlobalCallbackParameter("855", forKey: "user_id") ``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +[Adjust addGlobalCallbackParameter:@"value" forKey:@"key"]; +[Adjust addGlobalCallbackParameter:@"855" forKey:@"user_id"]; +``` +{% /tab %} +{% /tabs %} ### Remove a global callback parameter {% #remove-global-callback-parameter %} -To remove a global callback parameter, call the `Adjust.removeGlobalCallbackParameter` method with the following argument: +To remove a global callback parameter, call the `removeGlobalCallbackParameter` method with the following argument: {% deflist %} -`key`: `String` +`key`: `NSString` : The key of the parameter you want to remove. {% /deflist %} -```java -Adjust.removeGlobalCallbackParameter("key"); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +Adjust.removeGlobalCallbackParameter(forkey: "key") +``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +[Adjust removeGlobalCallbackParameterForKey:@"key"]; ``` +{% /tab %} +{% /tabs %} ### Remove all global callback parameters {% #remove-all-global-callback-parameter %} -To remove all global callback parameters at once, call the `Adjust.removeGlobalCallbackParameters` method. +To remove all global callback parameters at once, call the `removeGlobalCallbackParameters` method. This method removes all active global callback parameters, meaning you won't receive any parameters in callbacks from Adjust. -```java -Adjust.removeGlobalCallbackParameters(); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +Adjust.removeGlobalCallbackParameters() ``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +[Adjust removeGlobalCallbackParameters]; +``` +{% /tab %} +{% /tabs %} ## Global partner parameters {% #global-partner-parameters %} You can send extra information to your network partners by adding partner parameters. Sharing additional parameters with your external partners enables more granular analysis and facilitates retargeting. -When the Adjust Android Extension for Adobe Experience SDK sends session data, Adjust's servers forward any global partner parameters to any partners you've configured. +When the Adjust iOS Extension for Adobe Experience SDK sends session data, Adjust's servers forward any global partner parameters to any partners you've configured. Read [choose data sharing options](https://help.adjust.com/en/article/data-sharing-ad-network) to learn how to configure what data you share with external partners. @@ -77,35 +108,56 @@ The `Adjust` class methods manage the global partner parameters. You can add and To add a global partner parameter, call the `Adjust.addGlobalPartnerParameter` method with the following arguments: {% deflist %} -`key`: `String` +`key`: `NSString` : The parameter key. -`value`: `String` +`value`: `NSString` : The parameter value. {% /deflist %} You can add multiple parameters by calling the `Adjust.addGlobalPartnerParameter` method multiple times. -```java -Adjust.addGlobalPartnerParameter("key", "value"); -Adjust.addGlobalPartnerParameter("user_id", "855"); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +Adjust.addGlobalPartnerParameter("value", forKey: "key") +Adjust.addGlobalPartnerParameter("855", forKey: "user_id") ``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +[Adjust addGlobalPartnerParameter:@"value" forKey:@"key"]; +[Adjust addGlobalPartnerParameter:@"855" forKey:@"user_id"]; +``` +{% /tab %} +{% /tabs %} ### Remove a global partner parameter {% #remove-global-partner-parameter %} To remove a global partner parameter, call the `Adjust.removeGlobalPartnerParameter` method with the following argument: {% deflist %} -`key`: `String` +`key`: `NSString` : The key of the parameter you want to remove. {% /deflist %} -```java -Adjust.removeGlobalPartnerParameter("key"); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +Adjust.removeGlobalPartnerParameter(forkey: "key") +``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +[Adjust removeGlobalPartnerParameterForKey:@"key"]; ``` +{% /tab %} +{% /tabs %} ### Remove all global partner parameters {% #remove-all-global-partner-parameter %} @@ -113,93 +165,102 @@ To remove all global partner parameters at once, call the `Adjust.removeGlobalPa This method removes all active global partner parameters, meaning no parameters will be sent to network partners. -```java -Adjust.removeGlobalPartnerParameters(); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +Adjust.removeGlobalPartnerParameters() ``` +{% /tab %} -## Tutorial: Add and remove global parameters {% #tutorial %} - -You can change your global callback and partner parameters at any time by calling the methods described on this page. If you followed the [integration guide](/en/sdk/adobe-extension/android/integration), your `MainActivity.java` file should look something like this: +{% tab title="Objective-C" sync="objc" %} +```objc +[Adjust removeGlobalPartnerParameters]; +``` +{% /tab %} +{% /tabs %} -```java -// MainActivity.java -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.view.View; +## Tutorial: Add global parameters {% #tutorial %} -import androidx.appcompat.app.AppCompatActivity; +You can change your global callback and partner parameters at any time by calling the methods described on this page. If you followed the [integration guide](/en/sdk/adobe-extension/ios/integration), your View Controller should look something like this: -import com.adjust.sdk.Adjust; -import com.adjust.sdk.AdjustDeeplink; +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// ViewController.swift +import AEPCore +import AdjustAdobeExtension -public class MainActivity extends AppCompatActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); +class ViewController: UIViewController { - Intent intent = getIntent(); - Uri data = intent.getData(); - AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); - Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); + override func viewDidLoad() { + super.viewDidLoad() } } ``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +// ViewController.m +#import "ViewController.h" +@import AEPCore; +#import -Add new functions to update global parameters: +@implementation ViewController -- `addAdjustGlobalCallback`: This function adds a new global callback. -- `removeAdjustGlobalCallback`: This function removes a global callback added by `addAdjustGlobalCallback`. -- `removeAllAdjustGlobalCallbacks`: This function removes all global callbacks. -- `addAdjustGlobalPartnerParam`: This function adds a new global partner parameter. -- `removeAdjustGlobalPartnerParam`: This function removes the global partner parameter added by `addAdjustGlobalPartnerParam`. -- `removeAllAdjustGlobalPartnerParams`: This function removes all global partner parameter. +- (void)viewDidLoad { + [super viewDidLoad]; +} -These functions take [a `View`](https://developer.android.com/reference/android/view/View) as an argument and return `void`. To handle the update, call the relevant `Adjust` class method within the body of each function. +@end +``` +{% /tab %} +{% /tabs %} -Here's the updated `MainActivity.java` file: +Add some global parameters and global partner parameters to send them to Adjust with each session. -{% codeblock - title="MainActivity.java" - highlight="{range: 13-35}" - startLineNumber=11 %} -```java -public class MainActivity extends AppCompatActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// ViewController.swift +import AEPCore +import AdjustAdobeExtension - Intent intent = getIntent(); - Uri data = intent.getData(); - AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); - Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); - } +class ViewController: UIViewController { - public void addAdjustGlobalCallback(View view) { - Adjust.addGlobalCallbackParameter("user_id", "855"); - } + override func viewDidLoad() { + super.viewDidLoad() - public void removeAdjustGlobalCallback(View view) { - Adjust.removeGlobalCallbackParameter("user_id"); - } + Adjust.addGlobalCallbackParameter("value", forKey: "key") + Adjust.addGlobalCallbackParameter("855", forKey: "user_id") - public void removeAllAdjustGlobalCallbacks(View view) { - Adjust.removeGlobalPartnerParameters(); + Adjust.addGlobalPartnerParameter("value", forKey: "key") + Adjust.addGlobalPartnerParameter("855", forKey: "user_id") } +} +``` +{% /tab %} - public void addAdjustGlobalPartnerParam(View view) { - Adjust.addGlobalPartnerParameter("user_id", "855"); - } +{% tab title="Objective-C" sync="objc" %} +```objc +// ViewController.m +#import "ViewController.h" +@import AEPCore; +#import - public void removeAdjustGlobalPartnerParam(View view) { - Adjust.removeGlobalPartnerParameter("user_id"); - } +@implementation ViewController - public void removeAllAdjustGlobalPartnerParams(View view) { - Adjust.removeGlobalPartnerParameters(); - } +- (void)viewDidLoad { + [super viewDidLoad]; + + [Adjust addGlobalCallbackParameter:@"value" forKey:@"key"]; + [Adjust addGlobalCallbackParameter:@"855" forKey:@"user_id"]; + + [Adjust addGlobalPartnerParameter:@"value" forKey:@"key"]; + [Adjust addGlobalPartnerParameter:@"855" forKey:@"user_id"]; } + +@end ``` -{% /codeblock %} +{% /tab %} +{% /tabs %} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc index 12837d05b..89f304942 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/index.mdoc @@ -18,7 +18,7 @@ The full source code is available [on GitHub](https://github.com/adjust/ios_adob Follow the [integration guide](/en/sdk/adobe-extension/ios/integration) to add the Adjust iOS Extension for Adobe Experience SDK to your app. This guide covers the following: 1. [Install dependencies](/en/sdk/adobe-extension/ios/integration#install-the-adjust-extension) -1. [Configure permissions](/en/sdk/adobe-extension/ios/integration#configure-permissions) +1. [Add iOS frameworks](/en/sdk/adobe-extension/ios/integration#add-ios-frameworks) 1. [Integrate the Adjust iOS Extension for Adobe Experience SDK](/en/sdk/adobe-extension/ios/integration#integration-guide) ## Set up features {% #set-up-features %} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc index 7f028d96f..31bdd2d69 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/integration.mdoc @@ -666,17 +666,20 @@ To configure the Adjust iOS Extension for Adobe Experience SDK to open deep link {% /tab %} {% /tabs %} -1. Inside this function, return a call to `AdjustAdobeExtension.application` with each parameter passed in the parent function. +1. Inside this function, call the `processDeeplink` method of the `Adjust` class to open the deep link and return a true value. {% tabs %} {% tab title="Swift" sync="swift" %} {% codeblock title="AppDelegate.swift" - highlight="{range: 2}" + highlight="{range: 2-5}" startLineNumber=25 %} ```swift func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { - return AdjustAdobeExtension.application(app, open: url, options: options) + if let deeplink = ADJDeeplink(deeplink: url) { + Adjust.processDeeplink(deeplink) + } + return true } ``` {% /codeblock %} @@ -685,11 +688,12 @@ To configure the Adjust iOS Extension for Adobe Experience SDK to open deep link {% tab title="Objective-C" sync="objc" %} {% codeblock title="AppDelegate.m" - highlight="{range: 2}" + highlight="{range: 2-3}" startLineNumber=27 %} ```objc - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - return [AdjustAdobeExtension application:app openURL:url options:options]; + [Adjust processDeeplink: [[ADJDeeplink alloc] initWithDeeplink:url]]; + return YES; } ``` {% /codeblock %} @@ -717,7 +721,7 @@ To configure the Adjust iOS Extension for Adobe Experience SDK to open deep link {% codeblock title="AppDelegate.swift" highlight="{range: 1}" - startLineNumber=29 %} + startLineNumber=32 %} ```swift func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {} ``` @@ -728,7 +732,7 @@ To configure the Adjust iOS Extension for Adobe Experience SDK to open deep link {% codeblock title="AppDelegate.m" highlight="{range: 1}" - startLineNumber=31 %} + startLineNumber=32 %} ```objc - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler {} ``` @@ -736,17 +740,24 @@ To configure the Adjust iOS Extension for Adobe Experience SDK to open deep link {% /tab %} {% /tabs %} -1. Inside this function, return a call to `AdjustAdobeExtension.application` with each parameter passed in the parent function. +1. Inside this function, add a check to see if the app was opened by a link and call `processDeeplink` if it is. {% tabs %} {% tab title="Swift" sync="swift" %} {% codeblock title="AppDelegate.swift" - highlight="{range: 2}" - startLineNumber=29 %} + highlight="{range: 2-9}" + startLineNumber=32 %} ```swift func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { - return AdjustAdobeExtension.application(application, continue: userActivity) + if userActivity.activityType == NSUserActivityTypeBrowsingWeb { + if let incomingUrl = userActivity.webpageUrl { + if let deeplink = ADJDeeplink(deeplink: incomingUrl) { + Adjust.processDeeplink(deeplink) + } + } + } + return true } ``` {% /codeblock %} @@ -755,11 +766,60 @@ To configure the Adjust iOS Extension for Adobe Experience SDK to open deep link {% tab title="Objective-C" sync="objc" %} {% codeblock title="AppDelegate.m" - highlight="{range: 2}" - startLineNumber=31 %} + highlight="{range: 2-5}" + startLineNumber=32 %} + ```objc + - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + [Adjust proceessDeeplink:[[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]]]; + } + return YES; + } + ``` + {% /codeblock %} + {% /tab %} + {% /tabs %} + + If you use [short branded links](https://help.adjust.com/en/article/short-branded-links), you can alternatively use the `Adjust.processAndResolveDeeplink` method to resolve your shortened link and return it to a callback function. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + {% codeblock + title="AppDelegate.swift" + highlight="{range: 4-8}" + startLineNumber=32 %} + ```swift + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + if userActivity.activityType == NSUserActivityTypeBrowsingWeb { + if let incomingUrl = userActivity.webpageUrl { + if let deeplink = ADJDeeplink(deeplink: incomingUrl) { + Adjust.processAndResolveDeeplink(deeplink) { resolveDeeplink in + print("[\(resolveDeeplink)]") + } + } + } + } + return true + } + ``` + {% /codeblock %} + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + {% codeblock + title="AppDelegate.m" + highlight="{range: 4-7}" + startLineNumber=32 %} ```objc - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { - return [AdjustAdobeExtension application:application continueUserActivity:userActivity]; + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]]; + [Adjust processAndResolveDeeplink:deeplink + withCompletionHandler:^(NSString * _Nullable resolvedLink) { + NSLog(@"[%@]", resolvedLink); + }]; + } + return YES; } ``` {% /codeblock %} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc index 9a2fa5d12..6fe632c4b 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc @@ -14,117 +14,139 @@ You can send data from preinstalled apps to a predefined default link. When a us To set your default link token, call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with the following argument: {% deflist %} -`token`: `String` +`token`: `NSString` : Your alphanumeric Adjust link token. {% /deflist %} ## Tutorial: Set a default link token {% #tutorial %} -To set your default link token, you need to add the token to your `AdjustAdobeExtensionConfig` instance. If you followed the [integration guide](/en/sdk/adobe-extension/android/integration), your `MainApp.java` file should look something like this: - -```java -// MainApp.java -import android.app.Application; -import android.util.Log; - -import com.adjust.adobeextension.AdjustAdobeExtension; -import com.adjust.adobeextension.AdjustAdobeExtensionConfig; -import com.adobe.marketing.mobile.AdobeCallback; -import com.adobe.marketing.mobile.Extension; -import com.adobe.marketing.mobile.Analytics; -import com.adobe.marketing.mobile.Identity; -import com.adobe.marketing.mobile.LoggingMode; -import com.adobe.marketing.mobile.MobileCore; - -public class MainApp extends Application { - @Override - public void onCreate() { - super.onCreate(); - - MobileCore.setApplication(this); - MobileCore.setLogLevel(LoggingMode.VERBOSE); - - try { - MobileCore.configureWithAppID("your_adobe_app_id"); - - AdjustAdobeExtensionConfig config = - new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); - AdjustAdobeExtension.setConfiguration(config); - } catch (Exception e) { - Log.e("example", "Exception occurred during configuration: " + e.getMessage()); +To set your default link token, you need to add the token to your `AdjustAdobeExtensionConfig` instance. If you followed the [integration guide](/en/sdk/adobe-extension/ios/integration), your App Delegate file should look something like this: + +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// AppDelegate.swift +import UIKit +import AEPCore +import AEPServices +import AdjustAdobeExtension + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + MobileCore.setLogLevel(LogLevel.trace) + let appState = application.applicationState + + if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + AdjustAdobeExtension.setConfiguration(config) } - try { - List> extensions = Arrays.asList( - Analytics.EXTENSION, - Identity.EXTENSION, - AdjustAdobeExtension.EXTENSION); - MobileCore.registerExtensions(extensions, new AdobeCallback() { - @Override - public void call(Object o) { - Log.d("example", "Adjust Adobe Extension SDK initialized"); - } - }); - } catch (Exception e) { - Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); + MobileCore.registerExtensions([AdjustAdobeExtension.self]) { + MobileCore.configureWith(appId: "{your_adobe_app_id}") + if appState != .background { + MobileCore.lifecycleStart(additionalContextData: nil) + } } + return true } + + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + if let deeplink = ADJDeeplink(deeplink: url) { + Adjust.processDeeplink(deeplink) + } + return true + } + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + if userActivity.activityType == NSUserActivityTypeBrowsingWeb { + if let incomingUrl = userActivity.webpageUrl { + if let deeplink = ADJDeeplink(deeplink: incomingUrl) { + Adjust.processDeeplink(deeplink) + } + } + } + return true + } } ``` +{% /tab %} -To set a default link token for preinstalled apps, pass the link token to the `setDefaultTracker` method of the `AdjustAdobeExtensionConfig` instance. When Adjust receives the install session information, it attributes the install to the default link. +{% tab title="Objective-C" sync="objc" %} +```objc +// AppDelegate.m +#import "AppDelegate.h" +@import AEPCore; +@import AEPServices; +#import -In this example, the default link token is set to `"abc123"`. - -{% codeblock title="MainApp.java" highlight="{range: 26}" %} -```java -import android.app.Application; -import android.util.Log; - -import com.adjust.adobeextension.AdjustAdobeExtension; -import com.adjust.adobeextension.AdjustAdobeExtensionConfig; -import com.adobe.marketing.mobile.AdobeCallback; -import com.adobe.marketing.mobile.Extension; -import com.adobe.marketing.mobile.Analytics; -import com.adobe.marketing.mobile.Identity; -import com.adobe.marketing.mobile.LoggingMode; -import com.adobe.marketing.mobile.MobileCore; - -public class MainApp extends Application { - @Override - public void onCreate() { - super.onCreate(); - - MobileCore.setApplication(this); - MobileCore.setLogLevel(LoggingMode.VERBOSE); - - try { - MobileCore.configureWithAppID("your_adobe_app_id"); - - AdjustAdobeExtensionConfig config = - new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); - config.setDefaultTracker("abc123"); - AdjustAdobeExtension.setConfiguration(config); - } catch (Exception e) { - Log.e("example", "Exception occurred during configuration: " + e.getMessage()); - } +@implementation AppDelegate - try { - List> extensions = Arrays.asList( - Analytics.EXTENSION, - Identity.EXTENSION, - AdjustAdobeExtension.EXTENSION); - MobileCore.registerExtensions(extensions, new AdobeCallback() { - @Override - public void call(Object o) { - Log.d("example", "Adjust Adobe Extension SDK initialized"); - } - }); - } catch (Exception e) { - Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); - } +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [AEPMobileCore setLogLevel: AEPLogLevelTrace]; + const UIApplicationState appState = application.applicationState; + + AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; + [AdjustAdobeExtension setConfiguration:config]; + + [AEPMobileCore registerExtensions:@[AdjustAdobeExtension.class] + completion:^{ + [AEPMobileCore configureWithAppId: @"{your_adobe_app_id}"]; + + if (appState != UIApplicationStateBackground) { + [AEPMobileCore lifecycleStart:nil]; + } + }]; + + return YES; +} + +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + [Adjust processDeeplink: [[ADJDeeplink alloc] initWithDeeplink:url]]; + return YES; +} + +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + [Adjust proceessDeeplink:[[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]]]; } + return YES; } +@end +``` +{% /tab %} +{% /tabs %} + +To set a default link token for preinstalled apps, pass the link token to the `setDefaultTracker` method of the `AdjustAdobeExtensionConfig` instance. When Adjust receives the install session information, it attributes the install to the default link. + +In this example, the external device ID is set to _abc123_. + +{% tabs %} +{% tab title="Swift" sync="swift" %} +{% codeblock + title="AppDelegate.swift" + highlight="{range: 2}" + startLineNumber=13 %} +```swift +if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setDefaultTracker("abc123") + AdjustAdobeExtension.setConfiguration(config) +} +``` +{% /codeblock %} +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +{% codeblock + title="AppDelegate.m" + highlight="{range: 2}" + startLineNumber=12 %} +```objc +AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; +[adjustConfig setDefaultTracker:@"abc123"]; +[AdjustAdobeExtension setConfiguration:config]; ``` {% /codeblock %} +{% /tab %} +{% /tabs %} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/push-tokens.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/push-tokens.mdoc index 4788ff505..acace8f0b 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/push-tokens.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/push-tokens.mdoc @@ -11,174 +11,181 @@ Push notifications enable you to deliver personalized content to your users. You ## How it works {% #how-it-works %} -Each device generates a unique push token that's used to target it. The push token is sent to Adjust when the following information is passed to the `MobileCore.trackAction` API: +Each device generates a unique push token that's used to target it. The push token is sent to Adjust when the following information is passed to the `MobileCore.track` API: -1. `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN`: a string constant that maps to the `setPushToken` method. -1. `contextData`: a HashMap of values used to configure your push token. +1. `ADJAdobeAdjustActionSetPushToken`: a string constant that maps to the `setPushToken` method. +1. `data`: a dictionary of values used to configure your push token. -When you call `MobileCore.trackAction` with these arguments, the Adjust extension the token to the `setPushToken` method and sends the information to Adjust. +When you call `MobileCore.track` with these arguments, the Adjust extension the token to the `setPushToken` method and sends the information to Adjust. ## Reference {% #reference %} -The `contextData` HashMap holds information about an action. To configure your push token, add the following key-value pair to your HashMap. +The `data` dictionary holds information about an action. To configure your push token, add the following key-value pair to your dictionary. {% deflist %} -`AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN` +`ADJAdobeAdjustPushToken` : The device's push token. {% /deflist %} ## Example: Send a push token {% #example-send-push-token %} -To send a push token to Adjust, you need to add a function to your main activity. In this tutorial, you'll build on `MainActivity.java` from the [integration guide](/en/sdk/adobe-extension/android/integration) and add a new function called `sendPushTokenToAdjust` which will send an updated push token to Adjust. The final result looks like this: +To send a push token to Adjust, you need to add a function to your main activity. In this tutorial, you'll build on your ViewController from the [integration guide](/en/sdk/adobe-extension/ios/integration) and send an updated push token to Adjust. The final result looks like this: -```java -// MainActivity.java -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.view.View; +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +// ViewController.swift +import AEPCore +import AdjustAdobeExtension -import androidx.appcompat.app.AppCompatActivity; +class ViewController: UIViewController { -import com.adjust.sdk.Adjust; -import com.adjust.sdk.AdjustDeeplink; -import com.adobe.marketing.mobile.MobileCore; + override func viewDidLoad() { + super.viewDidLoad() -import java.util.HashMap; -import java.util.Map; + var dataDict: Dictionary = [String : String]() + dataDict[ADJAdobeAdjustPushToken:"de18dbf8-f38a-4962-8f1e-44abcf43055d"] + MobileCore.track(action: ADJAdobeAdjustActionSetPushToken, data: dataDict) + } +} +``` +{% /tab %} -public class MainActivity extends AppCompatActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); +{% tab title="Objective-C" sync="objc" %} +```objc +// ViewController.m +#import "ViewController.h" +@import AEPCore; +#import - Intent intent = getIntent(); - Uri data = intent.getData(); - AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); - Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); - } +@implementation ViewController - public void sendPushTokenToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "de18dbf8-f38a-4962-8f1e-44abcf43055d"); +- (void)viewDidLoad { + [super viewDidLoad]; - MobileCore.trackAction(action, contextData); - } + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + [dataDict setValue:@"de18dbf8-f38a-4962-8f1e-44abcf43055d" forKey:ADJAdobeAdjustPushToken]; + [AEPMobileCore trackAction:ADJAdobeAdjustActionSetPushToken + data:dataDict]; + [dataDict removeAllObjects]; } + +@end ``` +{% /tab %} +{% /tabs %} Here's what you need to do: -1. First, import the following classes: - - - `com.adobe.marketing.mobile.MobileCore`: this class is used to send information to Adobe and Adjust. - - `java.util.HashMap`: this class is used to generate the `contextData` HashMap. - - `java.util.Map`: this class is used to type the `contextData` HashMap. +1. Inside your `viewDidLoad` function block, create a new dictionary called `dataDict`. This is used to hold the properties of the action. + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 10}, {range: 12-13}" %} - ```java - import android.content.Intent; - import android.net.Uri; - import android.os.Bundle; - import android.view.View; - - import androidx.appcompat.app.AppCompatActivity; - - import com.adjust.sdk.Adjust; - import com.adjust.sdk.AdjustDeeplink; - import com.adobe.marketing.mobile.MobileCore; + title="ViewController.swift" + highlight="{range: 4}" + startLineNumber=6 %} + ```swift + override func viewDidLoad() { + super.viewDidLoad() - import java.util.HashMap; - import java.util.Map; + var dataDict: Dictionary = [String : String]() + } ``` {% /codeblock %} + {% /tab %} -1. Next, create a new function inside the `MainActivity` class called `sendPushTokenToAdjust`. This function takes [a `View`](https://developer.android.com/reference/android/view/View) as an argument and returns `void.` - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 13}" - startLineNumber=15 %} - ```java - public class MainActivity extends AppCompatActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); - Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); - } + title="ViewController.m" + highlight="{range: 4}" + startLineNumber=7 %} + ```objc + - (void)viewDidLoad { + [super viewDidLoad]; - public void sendPushTokenToAdjust(View view) {} + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -1. Inside the `sendPushTokenToAdjust` function, declare a new `String` variable called `action` and assign it the value `AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN`. This is used to tell `MobileCore.trackAction` which action to handle. +1. Add your push token to the dictionary using the `ADJAdobeAdjustPushToken` key. This example sets the push token to `"de18dbf8-f38a-4962-8f1e-44abcf43055d"`. + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 2}" - startLineNumber=27 %} - ```java - public void sendPushTokenToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN; + title="ViewController.swift" + highlight="{range: 5}" + startLineNumber=6 %} + ```swift + override func viewDidLoad() { + super.viewDidLoad() + + var dataDict: Dictionary = [String : String]() + dataDict[ADJAdobeAdjustPushToken:"de18dbf8-f38a-4962-8f1e-44abcf43055d"] } ``` {% /codeblock %} + {% /tab %} -1. Create a new HashMap variable called `contextData`. This is used to hold the properties of the action. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 3}" - startLineNumber=27 %} - ```java - public void sendPushTokenToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN; - Map contextData = new HashMap(); + title="ViewController.m" + highlight="{range: 5}" + startLineNumber=7 %} + ```objc + - (void)viewDidLoad { + [super viewDidLoad]; + + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + [dataDict setValue:@"de18dbf8-f38a-4962-8f1e-44abcf43055d" forKey:ADJAdobeAdjustPushToken]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -1. Add your push token to the HashMap using the `AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN` key. This example sets the push token to `"de18dbf8-f38a-4962-8f1e-44abcf43055d"`. +1. Finally, call `MobileCore.trackAction` with `ADJAdobeAdjustActionSetPushToken` and your `dataDict` dictionary to send the push token to Adjust. If you're using Objective-C, call `removeAllObjects` on your `dataDict` dictionary to deallocate it. + {% tabs %} + {% tab title="Swift" sync="swift" %} {% codeblock - title="MainActivity.java" - highlight="{range: 4}" - startLineNumber=27 %} - ```java - public void sendPushTokenToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "de18dbf8-f38a-4962-8f1e-44abcf43055d"); + title="ViewController.swift" + highlight="{range: 6}" + startLineNumber=6 %} + ```swift + override func viewDidLoad() { + super.viewDidLoad() + + var dataDict: Dictionary = [String : String]() + dataDict[ADJAdobeAdjustPushToken:"de18dbf8-f38a-4962-8f1e-44abcf43055d"] + MobileCore.track(action: ADJAdobeAdjustActionSetPushToken, data: dataDict) } ``` {% /codeblock %} + {% /tab %} -1. Finally, call `MobileCore.trackAction` with your `action` and `contextData` variables to send the push token to Adjust. - + {% tab title="Objective-C" sync="objc" %} {% codeblock - title="MainActivity.java" - highlight="{range: 6}" - startLineNumber=27 %} - ```java - public void sendPushTokenToAdjust(View view) { - String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; - Map contextData = new HashMap(); - contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "de18dbf8-f38a-4962-8f1e-44abcf43055d"); + title="ViewController.m" + highlight="{range: 6-8}" + startLineNumber=7 %} + ```objc + - (void)viewDidLoad { + [super viewDidLoad]; - MobileCore.trackAction(action, contextData); + NSMutableDictionary * dataDict = [NSMutableDictionary dictionary]; + [dataDict setValue:@"de18dbf8-f38a-4962-8f1e-44abcf43055d" forKey:ADJAdobeAdjustPushToken]; + [AEPMobileCore trackAction:ADJAdobeAdjustActionSetPushToken + data:dataDict]; + [dataDict removeAllObjects]; } ``` {% /codeblock %} + {% /tab %} + {% /tabs %} -That's it! When the user performs an action that maps to the `sendPushTokenToAdjust` function, your push token is sent to Adjust. +That's it! Your push token is sent to Adjust when the view loads. From 90eba5771e5dd5d84612fd31cf6b5814e50acad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 15 Nov 2024 13:12:47 +0100 Subject: [PATCH 4/6] Update migration guide --- .../migration/adobe-extension/ios/index.mdoc | 316 ++++++++++++------ 1 file changed, 211 insertions(+), 105 deletions(-) diff --git a/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc b/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc index 97c2a1b1b..bf29bf12d 100644 --- a/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc +++ b/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc @@ -8,22 +8,22 @@ sidebar-position: 1 The [Adjust Extension for Adobe Experience SDK](https://github.com/adjust/ios_adobe_extension) has been updated to v3 to support Adjust iOS SDK v5. Follow this guide to migrate from v2 to v3. {% callout type="important" %} -You need to update your app to support [iOS API 21](https://developer.ios.com/tools/releases/platforms#5.0) or above before migrating. +You need to update your app to support iOS 12 or above before migrating. {% /callout %} -To install v3 of the Adjust iOS Extension for Adobe Experience, update the dependency declarations in your `build.gradle` as follows: +To install v3 of the Adjust iOS Extension for Adobe Experience using Swift Package Manager, enter the following URL: -1. `com.adjust.adobeextension:adobeextension` MUST be updated to 3.0.0 or later. -1. `com.adjust.sdk:adjust-ios` MUST be updated to 5.0.0 or later. +```txt +https://github.com/adjust/ios_adobe_extension.git +``` -```groovy -dependencies { - implementation 'com.adjust.adobeextension:adobeextension:{% $versions.ios_adobe_extension.v3 %}' - implementation 'com.adjust.sdk:adjust-ios:{% $versions.ios.v5 %}' - implementation 'com.adobe.marketing.mobile:core:3.2.0' - implementation 'com.ios.installreferrer:installreferrer:2.2' -} +If you're using CocoaPods, add the following line to your `Podfile`: + +{% codeblock title="Podfile" showLineNumbers=false %} +```rb +pod 'AdjustAdobeExtension' ``` +{% /codeblock %} For a complete guide to setting up the Adjust iOS Extension for Adobe Experience, see the [integration guide](/en/sdk/adobe-extension/ios/integration). @@ -38,49 +38,78 @@ The following APIs have been added in v3. v3 of the Adjust Extension for Adobe Experience SDK adds support for resolving [short branded links](https://help.adjust.com/en/article/short-branded-links). To resolve shortened links, call the `Adjust.processAndResolveDeeplink` method with the following arguments: {% deflist %} -`adjustDeeplink`: `AdjustDeeplink` +`deeplink`: `NSURL` : The deep link that opened the app. -`context`: `Context` - -: The app context. Call `getApplicationContext()` to fill this value. +`withCompletionHandler`: `ADJResolvedDeeplinkBlock` -`callback`: `OnDeeplinkResolvedListener` - -: A callback function that receives the resolved short link as an argument. +: A completion function that receives the resolved short link as an argument. {% /deflist %} -```java -Intent intent = getIntent(); -Uri data = intent.getData(); -AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); -Adjust.processAndResolveDeeplink(adjustDeeplink, getApplicationContext(), new OnDeeplinkResolvedListener() { - @Override - public void onDeeplinkResolved(String s) { - - } -}); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + if userActivity.activityType == NSUserActivityTypeBrowsingWeb { + if let incomingUrl = userActivity.webpageUrl { + if let deeplink = ADJDeeplink(deeplink: incomingUrl) { + Adjust.processAndResolveDeeplink(deeplink) { resolveDeeplink in + print("[\(resolveDeeplink)]") + } + } + } + } + return true +} ``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]]; + [Adjust processAndResolveDeeplink:deeplink + withCompletionHandler:^(NSString * _Nullable resolvedLink) { + NSLog(@"[%@]", resolvedLink); + }]; + } + return YES; +} +``` +{% /tab %} +{% /tabs %} ### Global callback parameters {% #global-callback-parameters %} v3 of the Adjust Extension for Adobe Experience SDK adds support for the global callback parameters API from iOS SDK v5. To add global callbacks to your sessions, call the `Adjust.addGlobalCallbackParameter` method with the following arguments: {% deflist %} -`key`: `String` +`key`: `NSString` : The key of your parameter. -`value`: `String` +`value`: `NSString` : The value of your parameter. {% /deflist %} -```java -Adjust.addGlobalCallbackParameter("key", "value"); -Adjust.addGlobalCallbackParameter("user_id", "855"); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +Adjust.addGlobalCallbackParameter("value", forKey: "key") +Adjust.addGlobalCallbackParameter("855", forKey: "user_id") ``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +[Adjust addGlobalCallbackParameter:@"value" forKey:@"key"]; +[Adjust addGlobalCallbackParameter:@"855" forKey:@"user_id"]; +``` +{% /tab %} +{% /tabs %} Learn how to [set up global callback](/en/sdk/adobe-extension/ios/global-parameters#global-callback-parameters). @@ -98,10 +127,21 @@ v3 of the Adjust Extension for Adobe Experience SDK adds support for the global : The value of your parameter. {% /deflist %} -```java -Adjust.addGlobalPartnerParameter("key", "value"); -Adjust.addGlobalPartnerParameter("user_id", "855"); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +Adjust.addGlobalPartnerParameter("value", forKey: "key") +Adjust.addGlobalPartnerParameter("855", forKey: "user_id") +``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +[Adjust addGlobalPartnerParameter:@"value" forKey:@"key"]; +[Adjust addGlobalPartnerParameter:@"855" forKey:@"user_id"]; ``` +{% /tab %} +{% /tabs %} Learn how to [set up global partner parameters](/en/sdk/adobe-extension/ios/global-parameters#global-partner-parameters). @@ -110,17 +150,29 @@ Learn how to [set up global partner parameters](/en/sdk/adobe-extension/ios/glob v3 of the Adjust Extension for Adobe Experience SDK adds support for setting [external device identifiers](https://help.adjust.com/en/article/external-device-identifiers). To set an external device ID, call the `setExternalDeviceId` method of your `AdjustAdobeExtensionConfig` instance with the following argument: {% deflist %} -`externalDeviceId`: `String` +`externalDeviceId`: `NSString` : Your external device identifier. {% /deflist %} -```java -String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; -AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); -config.setExternalDeviceId("{YourExternalDeviceId}"); -AdjustAdobeExtension.setConfiguration(config); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setExternalDeviceId("{% $variables.config.externalDeviceId %}") + AdjustAdobeExtension.setConfiguration(config) +} +``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; +[adjustConfig setExternalDeviceId:@"{% $variables.config.externalDeviceId %}"]; +[AdjustAdobeExtension setConfiguration:config]; ``` +{% /tab %} +{% /tabs %} Learn how to [configure external device IDs](/en/sdk/adobe-extension/ios/external-device-id). @@ -129,17 +181,29 @@ Learn how to [configure external device IDs](/en/sdk/adobe-extension/ios/externa v3 of the Adjust Extension for Adobe Experience SDK adds support for setting a default [link token](https://help.adjust.com/en/article/links) for recording preinstalled app installs to a default campaign. To set a default link token, call the `setDefaultTracker` method of your `AdjustAdobeExtensionConfig` instance with the following argument: {% deflist %} -`defaultTracker`: `String` +`defaultTracker`: `NSString` : The alphanumeric link token of your preinstall campaign. {% /deflist %} -```java -String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; -AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); -config.setDefaultTracker("{Token}"); -AdjustAdobeExtension.setConfiguration(config); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setDefaultTracker("abc123") + AdjustAdobeExtension.setConfiguration(config) +} +``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; +[adjustConfig setDefaultTracker:@"abc123"]; +[AdjustAdobeExtension setConfiguration:config]; ``` +{% /tab %} +{% /tabs %} Learn how to [send preinstalled app activity](/en/sdk/adobe-extension/ios/preinstalled). @@ -149,81 +213,123 @@ Learn how to [send preinstalled app activity](/en/sdk/adobe-extension/ios/preins The following APIs have changed in v3. -### Retrieve device ADID {% #retrieve-device-adid %} +### Direct deep linking {% #direct-deep-linking %} -In SDK v2, the `AdjustAttribution` class has a property called `adid`. This property has been removed. You can retrieve the device's ADID asynchronously, by calling `Adjust.getAdid`. +In SDK v2, you can open deep links for attribution by calling the `AdjustAdobeExtension.application` method with the deep link data as an argument. -```java -Adjust.getAdid(new OnAdidReadListener() { - @Override - public void onAdidRead(String adid) { - // Your callback function - } -}); +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + return AdjustAdobeExtension.application(app, open: url, options: options) +} ``` +{% /tab %} -### Direct deep linking {% #direct-deep-linking %} - -In SDK v2, you can open deep links for attribution by calling the `AdjustAdobeExtension.openUrl` method with the deep link data as an argument. - -```java -Intent intent = getIntent(); -Uri data = intent.getData(); -AdjustAdobeExtension.openUrl(data, getApplicationContext()); +{% tab title="Objective-C" sync="objc" %} +```objc +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + return [AdjustAdobeExtension application:app openURL:url options:options]; +} ``` +{% /tab %} +{% /tabs %} SDK v3 has been updated to use the Adjust iOS SDK's `processDeeplink` method. To open direct deep links: -1. Create a new `AdjustDeeplink` instance with the deep link URL. -1. Pass your `AdjustDeeplink` instance to the `Adjust.processDeeplink` method. +1. Create a new `ADJDeeplink` instance with the deep link URL. -```java -Intent intent = getIntent(); -Uri data = intent.getData(); -AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); -Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); -``` +1. Pass your `ADJDeeplink` instance to the `Adjust.processDeeplink` method. + + {% tabs %} + {% tab title="Swift" sync="swift" %} + ```swift + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + if let deeplink = ADJDeeplink(deeplink: url) { + Adjust.processDeeplink(deeplink) + } + return true + } + ``` + {% /tab %} + + {% tab title="Objective-C" sync="objc" %} + ```objc + - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + [Adjust processDeeplink: [[ADJDeeplink alloc] initWithDeeplink:url]]; + return YES; + } + ``` + {% /tab %} + {% /tabs %} Learn how to [reattribute users with direct deep links](/en/sdk/adobe-extension/ios/deep-linking#reattribute-users-with-direct-deep-links). ### Deferred deep linking callback {% #deferred-deep-linking-callback %} -In SDK v2, you can configure the SDK to launch a callback function when a deferred deep link is opened by passing a function to the `setOnDeeplinkResponseListener` method of your `AdjustAdobeExtensionConfig` instance. - -```java -AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); - -config.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() { - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { - return true; - } else { - return false; - } +In SDK v2, you can configure the SDK to launch a callback function when a deferred deep link is opened by passing a function to the `setDeeplinkResponseBlock` method of your `AdjustAdobeExtensionConfig` instance. + +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setDeeplinkResponseBlock { deepLink in + // Deep link response received + // Apply your logic to determine whether the Adjust SDK should try to open the deep link + return true; + // or + // return false; } -}); - -AdjustAdobeExtension.setConfiguration(config); + AdjustAdobeExtension.setConfiguration(config) +} ``` - -In SDK v3, the `setOnDeeplinkResponseListener` method has been renamed to `setOnDeferredDeeplinkResponseListener`. - -```java -AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); - -config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { - return true; - } else { - return false; +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; +[config setDeeplinkResponseBlock:^BOOL(NSURL * _Nullable deeplink) { + // Deep link response received + // Apply your logic to determine whether the Adjust SDK should try to open the deep link + return YES; + // or + // return NO; +}]; +[AdjustAdobeExtension setConfiguration:config]; +``` +{% /tab %} +{% /tabs %} + +In SDK v3, the `setDeeplinkResponseBlock` method has been renamed to `setDeferredDeeplinkReceivedBlock`. + +{% tabs %} +{% tab title="Swift" sync="swift" %} +```swift +if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { + config.setDeferredDeeplinkReceivedBlock { (deeplink: URL?) -> Bool in + if let deeplinkString = deeplink?.absoluteString.lowercased(), + deeplinkString.contains("no_open") { + return false } + return true } -}); - -AdjustAdobeExtension.setConfiguration(config); + AdjustAdobeExtension.setConfiguration(config) +} +``` +{% /tab %} + +{% tab title="Objective-C" sync="objc" %} +```objc +AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; +[config setDeferredDeeplinkReceivedBlock:^BOOL(NSURL * _Nullable deeplink) { + if (deeplink && [[deeplink.absoluteString lowercaseString] containsString:@"no_open"]) { + return NO; + } + return YES; +}]; +[AdjustAdobeExtension setConfiguration:config]; ``` +{% /tab %} +{% /tabs %} Learn how to [work with deferred deep link callbacks](/en/sdk/adobe-extension/ios/deep-linking#deferred-deep-link-callbacks). From 7bd29b9172ca8846521278d4b12903afcbafafd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Wed, 20 Nov 2024 10:57:22 +0100 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Aditi Agrawal --- .../docs/en/sdk/adobe-extension/ios/attribution.mdoc | 6 +++--- .../docs/en/sdk/adobe-extension/ios/external-device-id.mdoc | 2 +- .../docs/en/sdk/adobe-extension/ios/preinstalled.mdoc | 2 +- .../docs/en/sdk/migration/adobe-extension/ios/index.mdoc | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc index d340542f8..190b7519f 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/attribution.mdoc @@ -93,7 +93,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Adjust Adobe Extension configuration AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; - [adjustConfig setAttributionChangedBlock:^(ADJAttribution * _Nullable attribution) { + [config setAttributionChangedBlock:^(ADJAttribution * _Nullable attribution) { NSLog(@"Adjust Attribution Callback received:[%@]", attribution.description); }]; [AdjustAdobeExtension setConfiguration:config]; @@ -152,7 +152,7 @@ Here's what you need to do: startLineNumber=14 %} ```objc AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; - [adjustConfig setAttributionChangedBlock:^(ADJAttribution * _Nullable attribution) {}]; + [config setAttributionChangedBlock:^(ADJAttribution * _Nullable attribution) {}]; [AdjustAdobeExtension setConfiguration:config]; ``` {% /codeblock %} @@ -185,7 +185,7 @@ Here's what you need to do: startLineNumber=14 %} ```objc AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; - [adjustConfig setAttributionChangedBlock:^(ADJAttribution * _Nullable attribution) { + [config setAttributionChangedBlock:^(ADJAttribution * _Nullable attribution) { NSLog(@"Adjust Attribution Callback received:[%@]", attribution.description); }]; [AdjustAdobeExtension setConfiguration:config]; diff --git a/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc index 26028809d..bc4d3dfba 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/external-device-id.mdoc @@ -145,7 +145,7 @@ if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { startLineNumber=12 %} ```objc AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; -[adjustConfig setExternalDeviceId:@"{% $variables.config.externalDeviceId %}"]; +[config setExternalDeviceId:@"{% $variables.config.externalDeviceId %}"]; [AdjustAdobeExtension setConfiguration:config]; ``` {% /codeblock %} diff --git a/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc index 6fe632c4b..45908bb8b 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/preinstalled.mdoc @@ -144,7 +144,7 @@ if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { startLineNumber=12 %} ```objc AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; -[adjustConfig setDefaultTracker:@"abc123"]; +[config setDefaultTracker:@"abc123"]; [AdjustAdobeExtension setConfiguration:config]; ``` {% /codeblock %} diff --git a/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc b/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc index bf29bf12d..163d551d1 100644 --- a/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc +++ b/src/content/docs/en/sdk/migration/adobe-extension/ios/index.mdoc @@ -168,7 +168,7 @@ if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { {% tab title="Objective-C" sync="objc" %} ```objc AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; -[adjustConfig setExternalDeviceId:@"{% $variables.config.externalDeviceId %}"]; +[config setExternalDeviceId:@"{% $variables.config.externalDeviceId %}"]; [AdjustAdobeExtension setConfiguration:config]; ``` {% /tab %} @@ -199,7 +199,7 @@ if let config = AdjustAdobeExtensionConfig(environment: ADJEnvironmentSandbox) { {% tab title="Objective-C" sync="objc" %} ```objc AdjustAdobeExtensionConfig *config = [AdjustAdobeExtensionConfig configWithEnvironment:ADJEnvironmentSandbox]; -[adjustConfig setDefaultTracker:@"abc123"]; +[config setDefaultTracker:@"abc123"]; [AdjustAdobeExtension setConfiguration:config]; ``` {% /tab %} From aedd06ff8909d58153c5c85519cab37a6c6d74f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Wed, 20 Nov 2024 11:00:03 +0100 Subject: [PATCH 6/6] docs: Update iOS example permalinks --- src/content/docs/en/sdk/adobe-extension/ios/example.mdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/docs/en/sdk/adobe-extension/ios/example.mdoc b/src/content/docs/en/sdk/adobe-extension/ios/example.mdoc index b2c6d3fe9..bdacb2fb1 100644 --- a/src/content/docs/en/sdk/adobe-extension/ios/example.mdoc +++ b/src/content/docs/en/sdk/adobe-extension/ios/example.mdoc @@ -10,17 +10,17 @@ This page contains a full example implementation of the Adjust iOS Extension for You can see [the full example on GitHub](https://github.com/adjust/ios_adobe_extension/tree/main/AdjustAdobeExtension). {% exampleapp - permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtension/Classes/AdjustAdobeExtensionConfig.h" + permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtensionApp/AdjustAdobeExtensionApp/AppDelegate.h" lang="objc" /%} {% exampleapp - permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtension/Classes/AdjustAdobeExtensionConfig.m" + permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtensionApp/AdjustAdobeExtensionApp/AppDelegate.m" lang="objc" /%} {% exampleapp - permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtension/Classes/AdjustAdobeExtension.h" + permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtensionApp/AdjustAdobeExtensionApp/ViewController.h" lang="objc" /%} {% exampleapp - permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtension/Classes/AdjustAdobeExtension.m" + permalink="https://github.com/adjust/ios_adobe_extension/blob/main/AdjustAdobeExtensionApp/AdjustAdobeExtensionApp/ViewController.m" lang="objc" /%}