From 8ce24bc808145f47113c7d1c74e54a7c6dfa3110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 21 Oct 2024 14:53:47 +0200 Subject: [PATCH] Update instructions for signature integration --- .../sdk/android/v5/{index.mdx => index.mdoc} | 273 +++++++----------- src/content/docs/en/sdk/cordova/v5/index.mdoc | 7 +- src/content/docs/en/sdk/flutter/v5/index.mdoc | 7 +- .../en/sdk/ios/v5/{index.mdx => index.mdoc} | 220 ++++++-------- .../docs/en/sdk/react-native/v5/index.mdoc | 7 +- src/content/docs/en/sdk/unity/v5/index.mdoc | 7 +- 6 files changed, 206 insertions(+), 315 deletions(-) rename src/content/docs/en/sdk/android/v5/{index.mdx => index.mdoc} (61%) rename src/content/docs/en/sdk/ios/v5/{index.mdx => index.mdoc} (66%) diff --git a/src/content/docs/en/sdk/android/v5/index.mdx b/src/content/docs/en/sdk/android/v5/index.mdoc similarity index 61% rename from src/content/docs/en/sdk/android/v5/index.mdx rename to src/content/docs/en/sdk/android/v5/index.mdoc index fad3383d3..b9d23ae50 100644 --- a/src/content/docs/en/sdk/android/v5/index.mdx +++ b/src/content/docs/en/sdk/android/v5/index.mdoc @@ -16,14 +16,11 @@ redirects: The Adjust Android SDK enables you to record attribution, events, and more in your Android app. Follow the steps in this guide to set up your app to work with the Adjust SDK. -## Before you begin {#before-you-begin} +{% callout type="important" %} +The Adjust SDK supports Android API level 21 (Lollipop) or later. +{% /callout %} -Here's what you need to do before updating to SDK v5: - -1. SDK v5 supports [SDK signature verification](https://help.adjust.com/en/article/sdk-signature) natively. If you currently use the SDK signature library, you need to uninstall this first. -2. If your app targets API versions lower than [**21**](https://developer.android.com/tools/releases/platforms#5.0) you need to update your app before you can use SDK v5. - -## 1. Set up your environment {#set-up-your-environment} +## 1. Set up your environment {% #set-up-your-environment %} To use the Adjust SDK, you need to add it to your project as a dependency. The Adjust SDK is available on [Maven](https://maven.apache.org). @@ -31,76 +28,54 @@ To add the Adjust SDK to your project: 1. Add the Adjust SDK and Android install referrer implementations to your `build.gradle` file. Optionally add the Adjust web view bridge if you use web views in your app. - - ```groovy dependencies { - implementation 'com.adjust.sdk:adjust-android:5.0.0' + implementation 'com.adjust.sdk:adjust-android:{% $versions.android.v5 %}' implementation 'com.android.installreferrer:installreferrer:2.2' // Add the following if you are using the Adjust SDK inside web views on your app - implementation 'com.adjust.sdk:adjust-android-webbridge:5.0.0' + implementation 'com.adjust.sdk:adjust-android-webbridge:{% $versions.android.v5 %}' } ``` - - -## 2. Add Google Play Services {#add-google-play-services} +## 2. Add Google Play Services {% #add-google-play-services %} Apps that target the Google Play Store must use the `gps_adid` (Google Advertising ID) to identify devices. You need to add the `play-services-ads-identifier` AAR to your project to access the `gps_adid`. If you're using Maven, add the following to your `build.gradle` file: - - ```groovy dependencies { implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' } ``` - - -## 3. Add permissions {#add-permissions} +## 3. Add permissions {% #add-permissions %} To give the Adjust SDK access to device information, you need to declare which permissions your app requires. To do this, add permissions to your `AndroidManifest.xml` file. Add the following permissions to get access to online features: - - ```xml ``` - - If your app doesn't target the Google Play Store, add the following permission to access the device's network state: - - ```xml ``` - - The Adjust SDK includes the `com.google.android.gms.AD_ID` permission by default. If you need to make your app COPPA (Children's Online Privacy Protection Act) compliant or if your app doesn't target the Google Play Store, you must remove this permission using a `remove` directive. - - ```xml ``` - - -## 4. Set up Proguard {#set-up-proguard} +## 4. Set up Proguard {% #set-up-proguard %} If you're using Proguard to optimize your app, you must add rules to prevent Proguard from removing classes. - - ```java -keep class com.adjust.sdk.** { *; } -keep class com.google.android.gms.common.ConnectionResult { @@ -116,99 +91,76 @@ If you're using Proguard to optimize your app, you must add rules to prevent Pro -keep public class com.android.installreferrer.** { *; } ``` - - If you're not publishing your app in the Google Play Store, add the following rule: - - ```java -keep public class com.adjust.sdk.** { *; } ``` - - -## 5. Set up install referrer {#set-up-install-referrer} +## 5. Set up install referrer {% #set-up-install-referrer %} An install referrer is a unique identifier used to attribute an install to a source. The Adjust SDK requires this information to perform attribution. Use one of the following methods to retrieve the install referrer information: -### Google Play Referrer API {#google-play-referrer-api} +### Google Play Referrer API {% #google-play-referrer-api %} The Google Play Referrer API is available to apps that target the Google Play Store. To support the Google Play Referrer API, add the following to your `build.gradle` file: - - ```groovy dependencies { implementation 'com.android.installreferrer:installreferrer:2.2' } ``` - - If you're using Proguard, remember to add a rule to prevent the dependency from being removed. - - ```java -keep public class com.android.installreferrer.** { *; } ``` - - -### Huawei Referrer API {#huawei-referrer-api} +### Huawei Referrer API {% #huawei-referrer-api %} The Huawei Referrer API is available to apps that target Huawei devices. The Adjust SDK can record installs on Huawei devices using the Adjust Huawei Referrer plugin. To install this plugin, add the following dependency to your `build.gradle` file: - - ```groovy dependencies { implementation: "com.adjust.sdk:adjust-android-huawei-referrer:5.0.0" } ``` - - -### Xiaomi referrer plugin {#xiaomi-referrer-plugin} +### Xiaomi referrer plugin {% #xiaomi-referrer-plugin %} The Xiaomi referrer plugin enables you to record install referrer values for apps that target Xiaomi devices. See the [plugin documentation](/en/sdk/android/plugins/xiaomi-referrer) for install information. -### Samsung referrer plugin {#samsung-referrer-plugin} +### Samsung referrer plugin {% #samsung-referrer-plugin %} The Samsung referrer plugin enables you to record install referrer values for apps that target the Samsung Galaxy store. See the [plugin documentation](/en/sdk/android/plugins/samsung-referrer-plugin) for install information. -### Meta referrer integration {#meta-referrer-integration} +### Meta referrer integration {% #meta-referrer-integration %} The Adjust SDK supports the [Meta Install Referrer](https://developers.facebook.com/docs/app-ads/meta-install-referrer) using the Adjust Meta Install Referrer plugin. [See the documentation for integration details](/en/sdk/android/plugins/meta-referrer-plugin). -## 6. Set up SDK Signature {#set-up-sdk-signature} - -SDK v5 includes the [SDK signature library](https://help.adjust.com/en/article/sdk-signature). Follow [the testing guide](/en/sdk/android/integrations/signature-library#test-your-app) to ensure your integration works. +## 6. Set up SDK Signature {% #set-up-sdk-signature %} -Signature protection is inactive by default. To enable it, you need to: +If you want to use the SDK signature library to secure communications between the Adjust SDK and Adjust's servers, follow the instructions in the [SDK signature guide on the Adjust Help Center](https://help.adjust.com/en/article/sdk-signature). -1. [Enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation). -2. [Provide your app's SHA-1 fingerprints](https://help.adjust.com/en/article/sdk-signature#manage-your-certificate-fingerprints) prior to testing. - -## 7. Integrate the Adjust SDK {#integrate-the-adjust-sdk} +## 7. Integrate the Adjust SDK {% #integrate-the-adjust-sdk %} The following information is required to initialize the Adjust SDK: -- `appToken`: Your [Adjust app token](https://help.adjust.com/en/article/app-settings#view-your-app-token). -- `environment`: The environment your app is running in. Set this to `AdjustConfig.ENVIRONMENT_SANDBOX` to test your app locally. +- `appToken`: Your [Adjust app token](https://help.adjust.com/en/article/app-settings#view-your-app-token). +- `environment`: The environment your app is running in. Set this to `AdjustConfig.ENVIRONMENT_SANDBOX` to test your app locally. The recommended way to initialize the Adjust SDK is inside a global Android [Application class](http://developer.android.com/reference/android/app/Application.html). If you haven't already set this up for your app, follow these steps: 1. Create a class that extends the `Application`. -2. Open the `AndroidManifest.xml` file and locate the `` element. -3. Add the `android:name` attribute to the `` element and set it to the name of your application class. For example, if your `Application` class is named `GlobalApplication`, you would set the following: - +1. Open the `AndroidManifest.xml` file and locate the `` element. + +1. Add the `android:name` attribute to the `` element and set it to the name of your application class. For example, if your `Application` class is named `GlobalApplication`, you would set the following: ```xml @@ -216,17 +168,14 @@ The recommended way to initialize the Adjust SDK is inside a global Android [App ``` - - -4. Find the `initSdk` method in your `Application` class or add one if it doesn't exist. Pass the following parameters to initialize the Adjust SDK: - - - Your `appToken` - - The `environment` you want to run the app in - - The `LogLevel` you want to record +1. Find the `initSdk` method in your `Application` class or add one if it doesn't exist. Pass the following parameters to initialize the Adjust SDK: - - + - Your `appToken` + - The `environment` you want to run the app in + - The `LogLevel` you want to record +{% tabs %} +{% tab title="Kotlin" sync="kotlin" %} ```kotlin import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustConfig; @@ -243,10 +192,9 @@ class GlobalApplication : Application () { } } ``` +{% /tab %} - - - +{% tab title="Java" sync="java" %} ```java import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustConfig; @@ -264,86 +212,86 @@ public class GlobalApplication extends Application { } } ``` +{% /tab %} +{% /tabs %} - - - -### Integrate the Adjust Web View SDK {#integrate-the-adjust-web-view-sdk} +### Integrate the Adjust Web View SDK {% #integrate-the-adjust-web-view-sdk %} If your app uses web views, you need to use the Adjust Web View SDK to record information. You need to obtain the reference to your `WebView` object. Once you've done this, follow these steps: 1. Call `webView.getSettings().setJavaScriptEnabled(true)` to enable Javascript in the web view. -2. Start the default `AdjustBridgeInstance` by calling `AdjustBridge.registerAndGetInstance(getApplication(), webview)`. This registers the Adjust bridge as a Javascript interface in the web view. -3. Call `AdjustBridge.setWebView()` to set a new `WebView`. -4. Call `AdjustBridge.unregister()` to unregister the `AdjustBridgeInstance` and the `WebView`. -5. Here's an example of a full setup: - - - -```kotlin -class MainActivity : Activity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - val webView = findViewById(R.id.webView) - webView.settings.javaScriptEnabled = true - webView.webChromeClient = WebChromeClient() - webView.webViewClient = WebViewClient() - - AdjustBridge.registerAndGetInstance(application, webView) +1. Start the default `AdjustBridgeInstance` by calling `AdjustBridge.registerAndGetInstance(getApplication(), webview)`. This registers the Adjust bridge as a Javascript interface in the web view. + +1. Call `AdjustBridge.setWebView()` to set a new `WebView`. + +1. Call `AdjustBridge.unregister()` to unregister the `AdjustBridgeInstance` and the `WebView`. + +1. Here's an example of a full setup: + + {% tabs %} + {% tab title="Kotlin" sync="kotlin" %} + ```kotlin + class MainActivity : Activity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + val webView = findViewById(R.id.webView) + webView.settings.javaScriptEnabled = true + webView.webChromeClient = WebChromeClient() + webView.webViewClient = WebViewClient() + + AdjustBridge.registerAndGetInstance(application, webView) + try { + webView.loadUrl("file:///android_asset/AdjustExample-WebView.html") + } catch (e: Exception) { + e.printStackTrace() + } + } + + override fun onDestroy() { + AdjustBridge.unregister() + + super.onDestroy() + } + } + ``` + {% /tab %} + + {% tab title="Java" sync="java" %} + ```java + public class MainActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + WebView webView = (WebView) findViewById(R.id.webView); + webView.getSettings().setJavaScriptEnabled(true); + webView.setWebChromeClient(new WebChromeClient()); + webView.setWebViewClient(new WebViewClient()); + + AdjustBridge.registerAndGetInstance(getApplication(), webview); try { - webView.loadUrl("file:///android_asset/AdjustExample-WebView.html") - } catch (e: Exception) { - e.printStackTrace() + webView.loadUrl("file:///android_asset/AdjustExample-WebView.html"); + } catch (Exception e) { + e.printStackTrace(); } - } - - override fun onDestroy() { - AdjustBridge.unregister() - - super.onDestroy() - } -} -``` - - - - -```java -public class MainActivity extends Activity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - WebView webView = (WebView) findViewById(R.id.webView); - webView.getSettings().setJavaScriptEnabled(true); - webView.setWebChromeClient(new WebChromeClient()); - webView.setWebViewClient(new WebViewClient()); - - AdjustBridge.registerAndGetInstance(getApplication(), webview); - try { - webView.loadUrl("file:///android_asset/AdjustExample-WebView.html"); - } catch (Exception e) { - e.printStackTrace(); + } + + @Override + protected void onDestroy() { + AdjustBridge.unregister(); + + super.onDestroy(); } } + ``` + {% /tab %} + {% /tabs %} - @Override - protected void onDestroy() { - AdjustBridge.unregister(); - - super.onDestroy(); - } -} -``` - - - - -6. Import the Adjust Javascript files in your HTML: +1. Import the Adjust Javascript files in your HTML: ```html @@ -352,7 +300,7 @@ public class MainActivity extends Activity { ``` -7. You can now initialize the Adjust SDK in your web view by passing your `appToken` and `environment` to the `AdjustConfig` class: +1. You can now initialize the Adjust SDK in your web view by passing your `appToken` and `environment` to the `AdjustConfig` class: ```js let yourAppToken = "{YourAppToken}"; @@ -362,16 +310,15 @@ public class MainActivity extends Activity { Adjust.initSdk(adjustConfig); ``` -## 8. Build your app for production {#build-your-app-for-production} +## 8. Build your app for production {% #build-your-app-for-production %} Once you've finished your testing, you can build your app for production. To do this, you need to update your config object. 1. Adjust your log level to return only what you need. -2. Set your `environment` to `AdjustConfig.ENVIRONMENT_PRODUCTION`. - - - +1. Set your `environment` to `AdjustConfig.ENVIRONMENT_PRODUCTION`. +{% tabs %} +{% tab title="Kotlin" sync="kotlin" %} ```kotlin val appToken = "{YourAppToken}" val environment = AdjustConfig.ENVIRONMENT_PRODUCTION; @@ -379,10 +326,9 @@ val config = AdjustConfig(this, appToken, environment) config.setLogLevel(LogLevel.WARN) Adjust.initSdk(config) ``` +{% /tab %} - - - +{% tab title="Java" sync="java" %} ```java String appToken = "{YourAppToken}"; String environment = AdjustConfig.ENVIRONMENT_PRODUCTION; @@ -390,6 +336,5 @@ AdjustConfig config = new AdjustConfig(this, appToken, environment); config.setLogLevel(LogLevel.WARN) Adjust.initSdk(config); ``` - - - +{% /tab %} +{% /tabs %} diff --git a/src/content/docs/en/sdk/cordova/v5/index.mdoc b/src/content/docs/en/sdk/cordova/v5/index.mdoc index 377d98c2a..d30c04a22 100644 --- a/src/content/docs/en/sdk/cordova/v5/index.mdoc +++ b/src/content/docs/en/sdk/cordova/v5/index.mdoc @@ -73,12 +73,7 @@ The Adjust SDK automatically links the frameworks listed below on iOS devices. ## 4. Set up SDK Signature {% #set-up-sdk-signature %} -SDK v5 includes the [SDK signature library](https://help.adjust.com/en/article/sdk-signature). Follow the testing guide for [iOS](/en/sdk/ios/integrations/signature-library#test-your-app) and [Android](/en/sdk/android/integrations/signature-library#test-your-app) to ensure your integration works. - -Signature protection is inactive by default. To enable it, you need to: - -1. [Enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation). -1. [Provide your app's SHA-1 fingerprints](https://help.adjust.com/en/article/sdk-signature#manage-your-certificate-fingerprints) prior to testing. +If you want to use the SDK signature library to secure communications between the Adjust SDK and Adjust's servers, follow the instructions in the [SDK signature guide on the Adjust Help Center](https://help.adjust.com/en/article/sdk-signature). ## 5. Initialize the Adjust SDK {% #initialize-the-adjust-sdk %} diff --git a/src/content/docs/en/sdk/flutter/v5/index.mdoc b/src/content/docs/en/sdk/flutter/v5/index.mdoc index 4ba930be3..d41a5d9d0 100644 --- a/src/content/docs/en/sdk/flutter/v5/index.mdoc +++ b/src/content/docs/en/sdk/flutter/v5/index.mdoc @@ -102,12 +102,7 @@ The Adjust SDK is able to get extra information when you include certain iOS fra ## 4. Set up SDK Signature {% #set-up-sdk-signature %} -SDK v5 includes the [SDK signature library](https://help.adjust.com/en/article/sdk-signature). Follow the testing guide for [iOS](/en/sdk/ios/integrations/signature-library#test-your-app) and [Android](/en/sdk/android/integrations/signature-library#test-your-app) to ensure your integration works. - -Signature protection is inactive by default. To enable it, you need to: - -1. [Enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation). -1. [Provide your app's SHA-1 fingerprints](https://help.adjust.com/en/article/sdk-signature#manage-your-certificate-fingerprints) prior to testing. +If you want to use the SDK signature library to secure communications between the Adjust SDK and Adjust's servers, follow the instructions in the [SDK signature guide on the Adjust Help Center](https://help.adjust.com/en/article/sdk-signature). ## 5. Initialize the Adjust SDK {% #initialize-the-adjust-sdk %} diff --git a/src/content/docs/en/sdk/ios/v5/index.mdx b/src/content/docs/en/sdk/ios/v5/index.mdoc similarity index 66% rename from src/content/docs/en/sdk/ios/v5/index.mdx rename to src/content/docs/en/sdk/ios/v5/index.mdoc index 96647282b..1d8a2c0d8 100644 --- a/src/content/docs/en/sdk/ios/v5/index.mdx +++ b/src/content/docs/en/sdk/ios/v5/index.mdoc @@ -16,28 +16,24 @@ redirects: The Adjust iOS SDK enables you to record attribution, events, and more in your iOS app. This guide shows you how to integrate the Adjust SDK with your app. -## Before you begin {#before-you-begin} +{% callout type="important" %} +The Adjust SDK supports iOS 12 or later. +{% /callout %} -Here's what you need to do before updating to SDK v5: - -1. SDK v5 supports [SDK signature verification](https://help.adjust.com/en/article/sdk-signature) natively. If you currently use the SDK signature library, you need to uninstall this first. -2. If your app targets iOS or tvOS earlier than version **12.0**, you need to update your app before you can use SDK v5. - -## 1. Add the SDK to your project {#add-the-sdk-to-your-project} +## 1. Add the SDK to your project {% #add-the-sdk-to-your-project %} To use the Adjust SDK in your iOS app, you need to add it to your Xcode project. To add the SDK using Swift's package manager: 1. Select **File --> Swift Packages --> Add Package Dependency** -2. In the box that appears, enter the SDK's GitHub address: `https://github.com/adjust/ios_sdk` -3. Select the version of the Adjust SDK you want to use in the **Version** dropdown. Check the [releases page](https://github.com/adjust/ios_sdk/releases) for the latest version. +1. In the box that appears, enter the SDK's GitHub address: `https://github.com/adjust/ios_sdk` +1. Select the version of the Adjust SDK you want to use in the **Version** dropdown. Check the [releases page](https://github.com/adjust/ios_sdk/releases) for the latest version. -### Alternative installation methods {#alternative-installation-methods} - - - +### Alternative installation methods {% #alternative-installation-methods %} +{% tabs %} +{% tab title="Cocoapods" sync="cocoapods" %} To add the SDK using Cocoapods, specify the version you want to use in your `Podfile`: ```rb @@ -53,79 +49,71 @@ If you're using web views in your app, add the Adjust Web Bridge by adding the f ```rb pod 'Adjust/AdjustWebBridge', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v5.0.0' ``` +{% /tab %} - - - +{% tab title="Carthage" sync="carthage" %} To add the SDK using Carthage, add the following to your `Cartfile`: ```text github "adjust/ios_sdk" ``` +{% /tab %} +{% /tabs %} - - - -## 2. Integrate the Adjust SDK {#integrate-the-adjust-sdk} +## 2. Integrate the Adjust SDK {% #integrate-the-adjust-sdk %} Once you've added the Adjust SDK to your `Xcode` project, you need to integrate it in your app. Add the relevant import statements in your project files. - - - +{% tabs %} +{% tab title="Swift" sync="swift" %} To import the Adjust SDK, add the following to your bridging header file: ```swift import AdjustSdk ``` +{% /tab %} - - - +{% tab title="Objective-C" sync="objc" %} To import the Adjust SDK, add the following to your `AppDelegate.h` file: ```objc #import ``` +{% /tab %} +{% /tabs %} - - - -## 3. Add iOS frameworks {#add-ios-frameworks} +## 3. Add iOS frameworks {% #add-ios-frameworks %} The Adjust SDK depends on frameworks to access certain device information. To enable reading this information, add the frameworks and mark them as **optional**. -| Framework | Description | Notes | -| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `AdSupport.framework` | Enables access to the device's IDFA. Also enables access to LAT information on devices running iOS 14 or earlier. | Don't add this framework if your app targets the "Kids" category. | -| `AdServices.framework` | Handles ASA attribution. | | -| `StoreKit.framework` | Enables access to the SKAdNetwork framework. | Required to allow the Adjust SDK to handle communication with SKAdNetwork on devices running iOS 14 or later. | -| `AppTrackingTransparency.framework` | Required to allow the Adjust SDK to wrap user ATT consent dialog and access consent responses on devices running iOS 14 or later | Don't add this framework if your app targets the "Kids" category | -| `WebKit.framework` | Enables the use of web views in your application | Only required if your app uses web views | +| Framework | Description | Notes | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `AdSupport.framework` | Enables access to the device's IDFA. Also enables access to LAT information on devices running iOS 14 or earlier. | Don't add this framework if your app targets the "Kids" category. | +| `AdServices.framework` | Handles ASA attribution. | | +| `StoreKit.framework` | Enables access to the SKAdNetwork framework. | Required to allow the Adjust SDK to handle communication with SKAdNetwork on devices running iOS 14 or later. | +| `AppTrackingTransparency.framework` | Required to allow the Adjust SDK to wrap user ATT consent dialog and access consent responses on devices running iOS 14 or later | Don't add this framework if your app targets the "Kids" category | +| `WebKit.framework` | Enables the use of web views in your application | Only required if your app uses web views | -## 4. Set up SDK signature {#set-up-sdk-signature} +## 4. Set up SDK signature {% #set-up-sdk-signature %} -SDK v5 includes the [SDK signature library](https://help.adjust.com/en/article/sdk-signature). Follow [the testing guide](/en/sdk/ios/integrations/signature-library#test-your-app) to ensure your integration works. +If you want to use the SDK signature library to secure communications between the Adjust SDK and Adjust's servers, follow the instructions in the [SDK signature guide on the Adjust Help Center](https://help.adjust.com/en/article/sdk-signature). -Signature protection is inactive by default. To enable it, you need to [enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation). - -## 5. (Optional) set up the Adjust Web Bridge {#set-up-web-bridge} +## 5. (Optional) set up the Adjust Web Bridge {% #set-up-web-bridge %} If your app uses web views, you must set up the Adjust Web Bridge to record activity inside the web view. -### Integrate `AdjustBridge` into your app {#integrate-adjustbridge-into-your-app} +### Integrate `AdjustBridge` into your app {% #integrate-adjustbridge-into-your-app %} In the Project Navigator: 1. Open the source file of your View Controller. -2. Add the `import` statement at the top of the file. -3. Add the following calls to `AdjustBridge` in the `viewDidLoad` or `viewWillAppear` method of your Web View Delegate: - - - +1. Add the `import` statement at the top of the file. +1. Add the following calls to `AdjustBridge` in the `viewDidLoad` or `viewWillAppear` method of your Web View Delegate: +{% tabs %} +{% tab title="Swift" sync="swift" %} ```swift import AdjustSdk @@ -136,10 +124,9 @@ func viewWillAppear(_ animated: Bool) { adjustBridge.loadWKWebViewBridge(webView) } ``` +{% /tab %} - - - +{% tab title="Objective-C" sync="objc" %} ```objc #import "" @@ -152,43 +139,39 @@ func viewWillAppear(_ animated: Bool) { // Your code here ``` +{% /tab %} +{% /tabs %} - - - -#### Integrate `AdjustBridge` into your web view {#integrate-adjustbridge-into-your-web-view} +#### Integrate `AdjustBridge` into your web view {% #integrate-adjustbridge-into-your-web-view %} To use the Javascript bridge in your web view, you need to configure the bridge. Add the following Javascript code to initialize the Adjust iOS web bridge: - - - +{% tabs %} +{% tab title="Javascript" sync="js" %} ```js var yourAppToken = yourAppToken; var environment = AdjustConfig.EnvironmentSandbox; var adjustConfig = new AdjustConfig(yourAppToken, environment); Adjust.initSdk(adjustConfig); ``` +{% /tab %} +{% /tabs %} - - - -## 6. Initialize the Adjust SDK {#initialize-the-adjust-sdk} +## 6. Initialize the Adjust SDK {% #initialize-the-adjust-sdk %} To initialize the Adjust SDK, you need to create a config object. This object contains configuration options that control how the Adjust SDK behaves. Pass the following arguments for a minimal setup: -- `appToken`: Your [app's token](https://help.adjust.com/en/article/app-settings#view-your-app-token). -- `environment`: The environment you want to run the SDK in. Set this to `ADJEnvironmentSandbox`. +- `appToken`: Your [app's token](https://help.adjust.com/en/article/app-settings#view-your-app-token). +- `environment`: The environment you want to run the SDK in. Set this to `ADJEnvironmentSandbox`. To initialize the Adjust SDK with this config object: 1. Declare your config object in the `didFinishLaunching` or `didFinishLaunchingWithOptions` method of your app delegate. -2. Set the `logLevel` property on your config object to `ADJLogLevelVerbose` (verbose). You must enable verbose logging to retrieve device information. -3. Pass the config object as an argument to the `initSdk` method. - - - +1. Set the `logLevel` property on your config object to `ADJLogLevelVerbose` (verbose). You must enable verbose logging to retrieve device information. +1. Pass the config object as an argument to the `initSdk` method. +{% tabs %} +{% tab title="Swift" sync="swift" %} ```swift import AdjustSdk @@ -204,10 +187,9 @@ func application(_ application: UIApplication, didFinishLaunchingWithOptions lau return true } ``` +{% /tab %} - - - +{% tab title="Objective-C" sync="objc" %} ```objc #import @@ -222,42 +204,37 @@ func application(_ application: UIApplication, didFinishLaunchingWithOptions lau return YES; } ``` +{% /tab %} - - - +{% tab title="Javascript" sync="js" %} ```js var yourAppToken = yourAppToken; var environment = AdjustConfig.EnvironmentSandbox; var adjustConfig = new AdjustConfig(yourAppToken, environment); Adjust.initSdk(adjustConfig); ``` +{% /tab %} +{% /tabs %} - - - -### Set up your iMessage app {#set-up-your-imessage-app} - - +### Set up your iMessage app {% #set-up-your-imessage-app %} +{% callout type="important" %} iMessage extensions have different bundle identifiers to apps and run in a different memory space. If you configure both with the same token, the SDK returns mixed data. You must create a separate app in the Adjust dashboard for your iMessage app and use its token when initializing the Adjust SDK. - - +{% /callout %} If your app targets iMessage, there are some additional settings you must configure: -- If you added the Adjust SDK from source, add the `ADJUST_IM=1` pre-processor macro to your iMessage project settings. -- If you added the Adjust SDK as a framework, make sure to add **New Copy Files Phase** in your **Build Phases** project settings. Set the `AdjustSdkIm.framework` to be copied to the Frameworks folder. +- If you added the Adjust SDK from source, add the `ADJUST_IM=1` pre-processor macro to your iMessage project settings. +- If you added the Adjust SDK as a framework, make sure to add **New Copy Files Phase** in your **Build Phases** project settings. Set the `AdjustSdkIm.framework` to be copied to the Frameworks folder. -#### Record sessions {#record-sessions} +#### Record sessions {% #record-sessions %} The Adjust SDK isn't subscribed to iOS system notifications in iMessage apps. To notify the Adjust SDK when your app has entered or left the foreground, you need to call the `trackSubsessionStart` and `trackSubsessionEnd` methods. Add a call to `trackSubsessionStart` inside your `didBecomeActiveWithConversation:` method: - - - +{% tabs %} +{% tab title="Swift" sync="swift" %} ```swift func didBecomeActive(with conversation: MSConversation) { // Called when the extension is about to move from the inactive to active state. @@ -267,10 +244,9 @@ func didBecomeActive(with conversation: MSConversation) { Adjust.trackSubsessionStart() } ``` +{% /tab %} - - - +{% tab title="Objective-C" sync="objc" %} ```objc -(void)didBecomeActiveWithConversation:(MSConversation *)conversation { // Called when the extension is about to move from the inactive to active state. @@ -280,15 +256,13 @@ func didBecomeActive(with conversation: MSConversation) { [Adjust trackSubsessionStart]; } ``` - - - +{% /tab %} +{% /tabs %} Add a call to `trackSubsessionEnd` inside your `willResignActiveWithConversation:` method: - - - +{% tabs %} +{% tab title="Swift" sync="swift" %} ```swift func willResignActive(with conversation: MSConversation) { // Called when the extension is about to move from the active to inactive state. @@ -302,10 +276,9 @@ func willResignActive(with conversation: MSConversation) { Adjust.trackSubsessionEnd() } ``` +{% /tab %} - - - +{% tab title="Objective-C" sync="objc" %} ```objc -(void)willResignActiveWithConversation:(MSConversation *)conversation { // Called when the extension is about to move from the active to inactive state. @@ -319,32 +292,30 @@ func willResignActive(with conversation: MSConversation) { [Adjust trackSubsessionEnd]; } ``` +{% /tab %} +{% /tabs %} - - - -## 7. Configure the Adjust SDK {#configure-the-adjust-sdk} +## 7. Configure the Adjust SDK {% #configure-the-adjust-sdk %} Once you've added your config object and initialization logic, you can configure the Adjust SDK to record information about different parts of your app. Check out the [configuration reference](/en/sdk/ios/configuration) and [feature guides](/en/sdk/ios/features) to set up exactly what you want to record. -## 8. Test the Adjust SDK {#test-the-adjust-sdk} +## 8. Test the Adjust SDK {% #test-the-adjust-sdk %} Now that you've configured the Adjust SDK to record information about your app, it's time to test it. Adjust offers a [testing console](https://help.adjust.com/en/article/testing-console) and a [Device API](https://help.adjust.com/en/article/device-api) to help you test your app. Follow the [testing guide](https://help.adjust.com/en/article/test-the-adjust-sdk) to make sure Adjust receives the expected values back from your app. -## 9. Build your app for production {#build-your-app-for-production} +## 9. Build your app for production {% #build-your-app-for-production %} Once you've finished your testing, you can build your app for production. To do this, you need to update your config object. Update the following values: -- `environment`: Set this to `ADJEnvironmentProduction`. -- `logLevel`: Choose a [logging level](/en/sdk/ios/configuration#set-your-logging-level), or disable logging completely by passing an `allowSuppressLogLevel` argument in your config object. - - - +- `environment`: Set this to `ADJEnvironmentProduction`. +- `logLevel`: Choose a [logging level](/en/sdk/ios/configuration#set-your-logging-level), or disable logging completely by passing an `allowSuppressLogLevel` argument in your config object. +{% tabs %} +{% tab title="Swift" sync="swift" %} ```swift import AdjustSdk @@ -363,10 +334,9 @@ func application(_ application: UIApplication, didFinishLaunchingWithOptions lau return true } ``` +{% /tab %} - - - +{% tab title="Objective-C" sync="objc" %} ```objc #import @@ -383,15 +353,13 @@ func application(_ application: UIApplication, didFinishLaunchingWithOptions lau return YES; } ``` - - - +{% /tab %} +{% /tabs %} You can use `Xcode`'s build flags to dynamically update your config depending on whether you create a debug build or a production build. - - - +{% tabs %} +{% tab title="Swift" sync="swift" %} ```swift func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. @@ -417,10 +385,9 @@ func application(_ application: UIApplication, didFinishLaunchingWithOptions lau return true } ``` +{% /tab %} - - - +{% tab title="Objective-C" sync="objc" %} ```objc #import @@ -445,6 +412,5 @@ func application(_ application: UIApplication, didFinishLaunchingWithOptions lau return YES; } ``` - - - +{% /tab %} +{% /tabs %} diff --git a/src/content/docs/en/sdk/react-native/v5/index.mdoc b/src/content/docs/en/sdk/react-native/v5/index.mdoc index 6086dfa2a..9345d65ba 100644 --- a/src/content/docs/en/sdk/react-native/v5/index.mdoc +++ b/src/content/docs/en/sdk/react-native/v5/index.mdoc @@ -168,12 +168,7 @@ The Adjust SDK is able to get extra information when you include certain iOS fra ## 6. Set up SDK Signature {% #set-up-sdk-signature %} -SDK v5 includes the [SDK signature library](https://help.adjust.com/en/article/sdk-signature). Follow the testing guide for [iOS](/en/sdk/ios/integrations/signature-library#test-your-app) and [Android](/en/sdk/android/integrations/signature-library#test-your-app) to ensure your integration works. - -Signature protection is inactive by default. To enable it, you need to: - -1. [Enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation). -1. [Provide your app's SHA-1 fingerprints](https://help.adjust.com/en/article/sdk-signature#manage-your-certificate-fingerprints) prior to testing. +If you want to use the SDK signature library to secure communications between the Adjust SDK and Adjust's servers, follow the instructions in the [SDK signature guide on the Adjust Help Center](https://help.adjust.com/en/article/sdk-signature). ## 7. Test your integration {% #test-your-integration %} diff --git a/src/content/docs/en/sdk/unity/v5/index.mdoc b/src/content/docs/en/sdk/unity/v5/index.mdoc index 54f155229..2452a9638 100644 --- a/src/content/docs/en/sdk/unity/v5/index.mdoc +++ b/src/content/docs/en/sdk/unity/v5/index.mdoc @@ -148,12 +148,7 @@ The Adjust SDK supports the [Meta Install Referrer](https://developers.facebook. ## 5. Set up SDK Signature {% #set-up-sdk-signature %} -SDK v5 includes the [SDK signature library](https://help.adjust.com/en/article/sdk-signature). Follow the testing guide for [iOS](/en/sdk/ios/integrations/signature-library#test-your-app) and [Android](/en/sdk/android/integrations/signature-library#test-your-app) to ensure your integration works. - -Signature protection is inactive by default. To enable it, you need to: - -1. [Enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation). -1. [Provide your app's SHA-1 fingerprints](https://help.adjust.com/en/article/sdk-signature#manage-your-certificate-fingerprints) prior to testing. +If you want to use the SDK signature library to secure communications between the Adjust SDK and Adjust's servers, follow the instructions in the [SDK signature guide on the Adjust Help Center](https://help.adjust.com/en/article/sdk-signature). ## 6. Build your app {% #build-your-app %}