Skip to content

Commit

Permalink
Merge branch 'eu-cluster' into develop - Merged comments for Android,…
Browse files Browse the repository at this point in the history
… added iOS
  • Loading branch information
Lutik-sun committed Nov 7, 2024
2 parents 9412623 + 55d75b4 commit a78d1a3
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 13 deletions.
79 changes: 73 additions & 6 deletions versioned_docs/version-3.0/eu-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,81 @@ After setup, you can use the Adapty Dashboard as usual at `app.adapty.io`.
## Step 1. Configure Adapty SDK for EU region

<Tabs>
<TabItem value="iOS" label="iOS">
Text
<TabItem value="iOS" label="iOS"> <Tabs>

Install Adapty SDK as described in [Adapty SDK Installation & Configuration](sdk-installation-android). During configuration, add the EU cluster as follows:

Include the `backendBaseUrl` parameter in your configuration:

<TabItem value="Swift" label="Swift" default>

```swift
// In your AppDelegate class:
import Adapty

let configurationBuilder =
Adapty.Configuration
.Builder(withAPIKey: "PUBLIC_SDK_KEY")
.with(observerMode: false)
.with(customerUserId: "YOUR_USER_ID")
.with(idfaCollectionDisabled: false)
.with(ipAddressCollectionDisabled: false)
// highlight-next-line
.with(backendBaseUrl: URL(string: "https://api-eu.adapty.io/api/v1")!)

Adapty.activate(with: configurationBuilder) { error in
// handle the error
}
```

</TabItem>
<TabItem value="SwiftUI" label="SwiftUI" default>

```swift
import Adapty

@main
struct SampleApp: App {
init()
let configurationBuilder =
Adapty.Configuration
.Builder(withAPIKey: "PUBLIC_SDK_KEY")
.with(observerMode: false) // optional
.with(customerUserId: "YOUR_USER_ID") // optional
.with(idfaCollectionDisabled: false) // optional
.with(ipAddressCollectionDisabled: false) // optional
// highlight-next-line
.with(backendBaseUrl: URL(string: "https://api-eu.adapty.io/api/v1")!)

Adapty.activate(with: configurationBuilder) { error in
// handle the error
}
}

var body: some Scene {
WindowGroup {
ContentView()
}
}
}
```

</TabItem>
</Tabs>

Parameters:

| Parameter | Description |
| ------------------ | ------------------------------------------------------------ |
| **backendBaseUrl** | Use the `URL(string: "https://api-eu.adapty.io/api/v1")!` value to connect your app to Adapty’s European servers. |


</TabItem>

<TabItem value="Android" label="Android" default>
Install Adapty SDK as described in [Adapty SDK Installation & Configuration](sdk-installation-android). During configuration, add the EU cluster as follows:

Include the `.withServerCluster` parameter in your configuration:
Use the `.withServerCluster` method in your configuration:

<Tabs>
<TabItem value="Kotlin" label="Kotlin" default>
Expand Down Expand Up @@ -69,11 +136,11 @@ public void onCreate() {
</TabItem>
</Tabs>

Added option:
Added method:

| Parameter | Description |
| Method | Description |
| --------------------- | ------------------------------------------------------------ |
| **withServerCluster** | Set to `AdaptyConfig.ServerCluster.EU` to connect your app to Adapty’s European servers. |
| **withServerCluster** | Pass the value `AdaptyConfig.ServerCluster.EU` to it to connect your app to Adapty’s European servers. |

</TabItem>

Expand Down
13 changes: 6 additions & 7 deletions versioned_docs/version-3.0/sdk-installation-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,12 @@ public void onCreate() {

Configurational options:

| Parameter | Presence | Description |
|---------|--------|-----------|
| **PUBLIC_SDK_KEY** | required | <p>The key you can find in the **Public SDK key** field of your app settings in Adapty: [**App settings**-> **General** tab -> **API keys** subsection](https://app.adapty.io/settings/general).</p><p>Make sure you use the **Public SDK key** for Adapty initialization, the **Secret key** should be used for [server-side API](getting-started-with-server-side-api) only.</p> |
| **observerMode** | optional | <p>A boolean value that controls [Observer mode](observer-vs-full-mode). Turn it on if you handle purchases and subscription status yourself and use Adapty for sending subscription events and analytics. The default value is `false`.</p><p></p><p>🚧 When running in Observer mode, Adapty SDK won't close any transactions, so make sure you're handling it.</p> |
| **customerUserId** | optional | An identifier of the user in your system. We send it in subscription and analytical events, to attribute events to the right profile. You can also find customers by `customerUserId` in the [**Profiles and Segments**](https://app.adapty.io/profiles/users) menu. If you don't have a user ID at the time of Adapty initialization, you can set it later using `.identify()` method. Read more in the [Identifying users](android-identifying-users) section. |
| **IpAddressCollectionDisabled** | optional | <p>A boolean parameter. Set to `true` to disable the collection of the user IP address. The default value is `false`.</p><p>Parameter works with `AdaptyConfig.Builder` only.</p> |

| Parameter | Presence | Description |
| ------------------------------- | -------- | ------------------------------------------------------------ |
| **PUBLIC_SDK_KEY** | required | <p>The key you can find in the **Public SDK key** field of your app settings in Adapty: [**App settings**-> **General** tab -> **API keys** subsection](https://app.adapty.io/settings/general).</p><p>Make sure you use the **Public SDK key** for Adapty initialization, the **Secret key** should be used for [server-side API](getting-started-with-server-side-api) only.</p> |
| **observerMode** | optional | <p>A boolean value that controls [Observer mode](observer-vs-full-mode). Turn it on if you handle purchases and subscription status yourself and use Adapty for sending subscription events and analytics. The default value is `false`.</p><p></p><p>🚧 When running in Observer mode, Adapty SDK won't close any transactions, so make sure you're handling it.</p> |
| **customerUserId** | optional | An identifier of the user in your system. We send it in subscription and analytical events, to attribute events to the right profile. You can also find customers by `customerUserId` in the [**Profiles and Segments**](https://app.adapty.io/profiles/users) menu. If you don't have a user ID at the time of Adapty initialization, you can set it later using `.identify()` method. Read more in the [Identifying users](identifying-users) section. |
| **ipAddressCollectionDisabled** | optional | <p>A boolean parameter. Set to `true` to disable the collection of the user IP address. The default value is `false`.</p><p>Parameter works with `AdaptyConfig.Builder` only.</p> |

:::note
**SDK keys** are unique for every app, so if you have multiple apps make sure you choose the right one.
Expand Down

0 comments on commit a78d1a3

Please sign in to comment.