From 1e983a048db0ba15a113324e9385e4a0dc609e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Wed, 18 Oct 2023 17:13:32 +0200 Subject: [PATCH] feat(docs): add setup method documentation --- .../ios/ADJConfig/_configWithAppToken.mdx | 40 +++ .../_setAllowAdServicesInfoReading.mdx | 31 ++ .../ios/ADJConfig/_setAllowIdfaReading.mdx | 31 ++ .../ios/ADJConfig/_setNeedsCost.mdx | 45 +++ .../en/sdk/ios/reference/adjconfig/index.mdx | 53 +++ .../en/sdk/ios/reference/adjconfig/setup.mdx | 333 ++++++++++++++++++ 6 files changed, 533 insertions(+) create mode 100644 src/content/docs/code-snippets/ios/ADJConfig/_configWithAppToken.mdx create mode 100644 src/content/docs/code-snippets/ios/ADJConfig/_setAllowAdServicesInfoReading.mdx create mode 100644 src/content/docs/code-snippets/ios/ADJConfig/_setAllowIdfaReading.mdx create mode 100644 src/content/docs/code-snippets/ios/ADJConfig/_setNeedsCost.mdx create mode 100644 src/content/docs/en/sdk/ios/reference/adjconfig/index.mdx create mode 100644 src/content/docs/en/sdk/ios/reference/adjconfig/setup.mdx diff --git a/src/content/docs/code-snippets/ios/ADJConfig/_configWithAppToken.mdx b/src/content/docs/code-snippets/ios/ADJConfig/_configWithAppToken.mdx new file mode 100644 index 000000000..fbb46a699 --- /dev/null +++ b/src/content/docs/code-snippets/ios/ADJConfig/_configWithAppToken.mdx @@ -0,0 +1,40 @@ + + + +### Swift + +```swift {3-5} +let yourAppToken = "{YourAppToken}" +let environment = ADJEnvironmentSandbox as? String +let adjustConfig = ADJConfig( + appToken: yourAppToken, + environment: environment) +``` + + + + +### Objective-C + +```objective-c {3-4} +NSString *yourAppToken = @"{YourAppToken}"; +NSString *environment = ADJEnvironmentSandbox; +*adjustConfig = [ADJConfig configWithAppToken:yourAppToken + environment:environment]; +``` + + + + +### Javascript + +```javascript {4} +setupWebViewJavascriptBridge(function(bridge) { + var yourAppToken = yourAppToken; + var environment = AdjustConfig.EnvironmentSandbox; + var adjustConfig = new AdjustConfig(yourAppToken, environment); +}); +``` + + + diff --git a/src/content/docs/code-snippets/ios/ADJConfig/_setAllowAdServicesInfoReading.mdx b/src/content/docs/code-snippets/ios/ADJConfig/_setAllowAdServicesInfoReading.mdx new file mode 100644 index 000000000..a01c32ddc --- /dev/null +++ b/src/content/docs/code-snippets/ios/ADJConfig/_setAllowAdServicesInfoReading.mdx @@ -0,0 +1,31 @@ + + + +### Swift + +```swift {6} +let yourAppToken = "{YourAppToken}" +let environment = ADJEnvironmentSandbox as? String +let adjustConfig = ADJConfig( + appToken: yourAppToken, + environment: environment) +adjustConfig?.allowAdServicesInfoReading = true; +//... +Adjust.appDidLaunch(adjustConfig) +``` + + + + +### Objective-C + +```objc {3} +*adjustConfig = [ADJConfig configWithAppToken:@"{YourAppToken}" + environment:ADJEnvironmentSandbox]; +[adjustConfig.setAllowAdServicesInfoReading:YES]; +//... +[Adjust appDidLaunch:adjustConfig]; +``` + + + diff --git a/src/content/docs/code-snippets/ios/ADJConfig/_setAllowIdfaReading.mdx b/src/content/docs/code-snippets/ios/ADJConfig/_setAllowIdfaReading.mdx new file mode 100644 index 000000000..42a70945b --- /dev/null +++ b/src/content/docs/code-snippets/ios/ADJConfig/_setAllowIdfaReading.mdx @@ -0,0 +1,31 @@ + + + +### Swift + +```swift {6} +let yourAppToken = "{YourAppToken}" +let environment = ADJEnvironmentSandbox as? String +let adjustConfig = ADJConfig( + appToken: yourAppToken, + environment: environment) +adjustConfig?.allowIdfaReading = true; +//... +Adjust.appDidLaunch(adjustConfig) +``` + + + + +### Objective-C + +```objc {3} +*adjustConfig = [ADJConfig configWithAppToken:@"{YourAppToken}" + environment:ADJEnvironmentSandbox]; +[adjustConfig.setAllowIdfaReading:YES]; +//... +[Adjust appDidLaunch:adjustConfig]; +``` + + + diff --git a/src/content/docs/code-snippets/ios/ADJConfig/_setNeedsCost.mdx b/src/content/docs/code-snippets/ios/ADJConfig/_setNeedsCost.mdx new file mode 100644 index 000000000..0a5123a2b --- /dev/null +++ b/src/content/docs/code-snippets/ios/ADJConfig/_setNeedsCost.mdx @@ -0,0 +1,45 @@ + + + +### Swift + +```swift {7} +let yourAppToken = "{YourAppToken}" +let environment = ADJEnvironmentSandbox as? String +let adjustConfig = ADJConfig( + appToken: yourAppToken, + environment: environment) +// ... +adjustConfig?.needsCost = true +``` + + + + +### Objective-C + +```objc {6} +NSString *yourAppToken = @"{YourAppToken}"; +NSString *environment = ADJEnvironmentSandbox; +*adjustConfig = [ADJConfig configWithAppToken:yourAppToken + environment:environment]; +// ... +[adjustConfig setNeedsCost:YES]; +``` + + + + +### Javascript + +```js {5} +setupWebViewJavascriptBridge(function(bridge) { + var yourAppToken = yourAppToken; + var environment = AdjustConfig.EnvironmentSandbox; + var adjustConfig = new AdjustConfig(yourAppToken, environment); + adjustConfig.setNeedsCost(true); +}); +``` + + + diff --git a/src/content/docs/en/sdk/ios/reference/adjconfig/index.mdx b/src/content/docs/en/sdk/ios/reference/adjconfig/index.mdx new file mode 100644 index 000000000..5a3030999 --- /dev/null +++ b/src/content/docs/en/sdk/ios/reference/adjconfig/index.mdx @@ -0,0 +1,53 @@ +--- +title: ADJConfig class +description: Use the methods in this class to set up the Adjust SDK. +category-title: ADJConfig class +slug: en/sdk/ios/reference/adjconfig +--- + +Use the methods in this class to set up the Adjust SDK. + + + + +The methods in this class must be called **before** you initialize the SDK. + + + + + +Initialize the configuration object with your Adjust app token. + + + +import ConfigWithAppToken from "@ios-fragments/ADJConfig/_configWithAppToken.mdx" + + + + + + + +`appToken` (NSString) +: Your Adjust app token. + +`environment` (NSString) +: The environment your app is running in. + +`allowSuppressLogLevel` (BOOL) +: Whether to allow all logging to be suppressed. + + + + + +`config` (ADJConfig) +: A config object initialized with the provided params. + + + + diff --git a/src/content/docs/en/sdk/ios/reference/adjconfig/setup.mdx b/src/content/docs/en/sdk/ios/reference/adjconfig/setup.mdx new file mode 100644 index 000000000..7246819d8 --- /dev/null +++ b/src/content/docs/en/sdk/ios/reference/adjconfig/setup.mdx @@ -0,0 +1,333 @@ +--- +title: Setup methods +description: Configure these properties to set up the Adjust SDK. +slug: en/sdk/ios/reference/adjconfig/setup +sidebar-position: 1 +--- + +Configure these properties to set up the Adjust SDK. + + + +Set the verbosity of logs you want to receive from the Adjust SDK. + + + +import SetLogLevel from "@ios-fragments/ADJConfig/_setLogLevel.mdx"; + + + + + + + +`logLevel` (ADJLogLevel) +: The level of logging output by the SDK. + + + +| Log level | Description | +| --------------------- | --------------------------------------------- | +| `ADJLogLevelVerbose` | Enable all logging | +| `AdjLogLevelDebug` | Enable debug logging | +| `ADJLogLevelInfo` | Only show info level logging (default option) | +| `ADJLogLevelWarn` | Disable informational warnings | +| `ADJLogLevelError` | Disable warning level logging and below | +| `ADJLogLevelAssert` | Disable error level logging and below | +| `ADJLogLevelSuppress` | Suppress all logging | + +
+ +
+ +
+ + + +Sets a default token to record installs against. + + + +import SetDefaultTracker from "@ios-fragments/ADJConfig/_setDefaultTracker.mdx" + + + + + + + +`defaultTracker` (NSString) +: The token to which all preinstalled sessions are attributed. + + + + + + + +Sets a delegate function that the SDK calls when the user's attribution changes. + + + +import SetDelegate from "@ios-fragments/ADJConfig/_setDelegate.mdx" + + + + + + + +`delegate` (NSObject) +: The delegate function that's called when attribution changes. + + + + + + + +Sets a delay before the SDK starts to allow data to load before session information is sent to Adjust's servers. + + + +You can delay the start of the SDK by up to **10 seconds**. + + + + + +import SetDelayStart from "@ios-fragments/ADJConfig/_setDelayStart.mdx" + + + + + + + +`delayStart` (double) +: The time (in seconds) to delay the start of the SDK by. + + + + + + + +Sets an external device identifier for reporting purposes. + + + +import SetExternalDeviceId from "@ios-fragments/ADJConfig/_setExternalDeviceId.mdx" + + + + + + + +`externalDeviceId` (NSString) +: The external device ID associated with the device. + + + + + + + +Sets event buffering. If enabled, the SDK stores events on the device and sends all requests once per minute. + + + +import SetEventBufferingEnabled from "@ios-fragments/ADJConfig/_setEventBufferingEnabled.mdx" + + + + + + + +`eventBufferingEnabled` (BOOL) +: Whether event buffering is enabled. + + + + + + + +Sets whether the SDK should send data while the app is running in the background. + + + +import SetSendInBackground from "@ios-fragments/ADJConfig/_sendInBackground.mdx" + + + + + + + +`sendInBackground` (BOOL) +: Whether the SDK should send information to Adjust when the app is running in the background. + + + + + + + +Sets whether the SDK should gather cost data. This is accessible in the user's attribution information. + + + +import SetNeedsCost from "@ios-fragments/ADJConfig/_setNeedsCost.mdx" + + + + + + + +`needsCost` (BOOL) +: Whether the SDK should gather cost data + + + + + +Optional slot for method return values + + + + + + + +Toggle support for Adjust's [LinkMe solution](https://help.adjust.com/en/article/linkme) for deep linking. + + + +import SetLinkMeEnabled from "@ios-fragments/ADJConfig/_setLinkMeEnabled.mdx" + + + + + + + +`linkMeEnabled` (BOOL) +: Whether to enable LinkMe. + + + + + + + +Turns off communication with SKAdNetwork. + + + +SKAdNetwork communication is enabled by default. + + + + + +import DeactivateSKAdNetworkHandling from "@ios-fragments/ADJConfig/_deactivateSKAdNetworkHandling.mdx" + + + + + + + + + +Sets whether the Adjust SDK can read the device IDFA (ID for Advertisers). + + + +import SetAllowIdfaReading from "@ios-fragments/ADJConfig/_setAllowIdfaReading.mdx" + + + + + + + +`allowIdfaReading` (BOOL) +: Whether to allow the SDK to read the device's IDFA. + + + + + + + +Sets whether the Adjust SDK can read AdServices framework data. Required for attribution. + + + +import SetAllowAdServicesInfoReading from "@ios-fragments/ADJConfig/_setAllowAdServicesInfoReading.mdx" + + + + + + + +`allowAdServicesInfoReading` (BOOL) +: Whether to allow the SDK to read AdServices information. + + + +