Skip to content

Commit

Permalink
feat(docs): add setup method documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sporiff committed Oct 18, 2023
1 parent 2503f53 commit 1e983a0
Show file tree
Hide file tree
Showing 6 changed files with 533 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {3-5}
let yourAppToken = "{YourAppToken}"
let environment = ADJEnvironmentSandbox as? String
let adjustConfig = ADJConfig(
appToken: yourAppToken,
environment: environment)
```

</Tab>
<Tab sync="objc">

### Objective-C

```objective-c {3-4}
NSString *yourAppToken = @"{YourAppToken}";
NSString *environment = ADJEnvironmentSandbox;
*adjustConfig = [ADJConfig configWithAppToken:yourAppToken
environment:environment];
```
</Tab>
<Tab sync="js">
### Javascript
```javascript {4}
setupWebViewJavascriptBridge(function(bridge) {
var yourAppToken = yourAppToken;
var environment = AdjustConfig.EnvironmentSandbox;
var adjustConfig = new AdjustConfig(yourAppToken, environment);
});
```

</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {6}
let yourAppToken = "{YourAppToken}"
let environment = ADJEnvironmentSandbox as? String
let adjustConfig = ADJConfig(
appToken: yourAppToken,
environment: environment)
adjustConfig?.allowAdServicesInfoReading = true;
//...
Adjust.appDidLaunch(adjustConfig)
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {3}
*adjustConfig = [ADJConfig configWithAppToken:@"{YourAppToken}"
environment:ADJEnvironmentSandbox];
[adjustConfig.setAllowAdServicesInfoReading:YES];
//...
[Adjust appDidLaunch:adjustConfig];
```
</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {6}
let yourAppToken = "{YourAppToken}"
let environment = ADJEnvironmentSandbox as? String
let adjustConfig = ADJConfig(
appToken: yourAppToken,
environment: environment)
adjustConfig?.allowIdfaReading = true;
//...
Adjust.appDidLaunch(adjustConfig)
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {3}
*adjustConfig = [ADJConfig configWithAppToken:@"{YourAppToken}"
environment:ADJEnvironmentSandbox];
[adjustConfig.setAllowIdfaReading:YES];
//...
[Adjust appDidLaunch:adjustConfig];
```
</Tab>
</Tabs>
45 changes: 45 additions & 0 deletions src/content/docs/code-snippets/ios/ADJConfig/_setNeedsCost.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Tabs>
<Tab sync="swift">

### Swift

```swift {7}
let yourAppToken = "{YourAppToken}"
let environment = ADJEnvironmentSandbox as? String
let adjustConfig = ADJConfig(
appToken: yourAppToken,
environment: environment)
// ...
adjustConfig?.needsCost = true
```

</Tab>
<Tab sync="objc">

### Objective-C

```objc {6}
NSString *yourAppToken = @"{YourAppToken}";
NSString *environment = ADJEnvironmentSandbox;
*adjustConfig = [ADJConfig configWithAppToken:yourAppToken
environment:environment];
// ...
[adjustConfig setNeedsCost:YES];
```
</Tab>
<Tab sync="js">
### Javascript
```js {5}
setupWebViewJavascriptBridge(function(bridge) {
var yourAppToken = yourAppToken;
var environment = AdjustConfig.EnvironmentSandbox;
var adjustConfig = new AdjustConfig(yourAppToken, environment);
adjustConfig.setNeedsCost(true);
});
```

</Tab>
</Tabs>
53 changes: 53 additions & 0 deletions src/content/docs/en/sdk/ios/reference/adjconfig/index.mdx
Original file line number Diff line number Diff line change
@@ -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.


<Callout type="important">

The methods in this class must be called **before** you initialize the SDK.

</Callout>

<Function
lang="objc"
name="configWithAppToken"
link="https://github.com/adjust/ios_sdk/blob/20c2666082c372f9f2c0adf871d8cef195d011f7/Adjust/ADJConfig.h#L253-L254"
>

Initialize the configuration object with your Adjust app token.

<slot slot="snippet">

import ConfigWithAppToken from "@ios-fragments/ADJConfig/_configWithAppToken.mdx"

<ConfigWithAppToken />

</slot>

<slot slot="parameters">

`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.

</slot>

<slot slot="returns">

`config` (ADJConfig)
: A config object initialized with the provided params.

</slot>

</Function>
Loading

0 comments on commit 1e983a0

Please sign in to comment.