Skip to content

Commit 3d0aad5

Browse files
committed
Merge branch 'release/iOS-3.15.2' into develop
2 parents 6766beb + c2e2bc2 commit 3d0aad5

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

versioned_docs/version-3.0/ios-quickstart-identify.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ If you don't have backend authentication, **you don't need to handle authenticat
4141
3. When the user **re-installs** the app or installs it from a **new device**, Adapty **creates a new anonymous profile on activation**.
4242
4. If the user has previously made purchases in your app, by default, their purchases are automatically synced from the App Store on the SDK activation.
4343

44+
:::note
45+
Backup restores behave differently from reinstalls. By default, when a user restores from a backup, the SDK preserves cached data and does not create a new profile. You can configure this behavior using the `clearDataOnBackup` setting. [Learn more](sdk-installation-ios#clear-data-on-backup-restore).
46+
:::
47+
4448
So, with anonymous users, new profiles will be created on each installation, but that's not a problem because, in the Adapty analytics, you can [configure what will be considered a new installation](general#4-installs-definition-for-analytics).
4549

4650
For anonymous users, you need to count installs by **device IDs**. In this case, each app installation on a device is counted as an install, including reinstalls.

versioned_docs/version-3.0/sdk-installation-ios.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,21 @@ let configurationBuilder = AdaptyConfiguration
352352
```
353353

354354
See more details on how to finish transactions in the [guide](ios-transaction-management).
355+
356+
### Clear data on backup restore
357+
358+
When a user restores their app from an iOS backup, the Adapty SDK can detect this and automatically clear its cached data to start fresh. This prevents potential issues with duplicate profiles and ensures clean analytics data.
359+
360+
Enable this if you want to ensure a fresh SDK state after backup restoration. Keep it disabled (default) if you want to preserve SDK data when users restore from backups.
361+
362+
To enable automatic data clearing on backup restore, set `clearDataOnBackup` to `true`.
363+
364+
:::note
365+
This only clears the SDK's local cache. The user's actual purchases and subscriptions remain safe and are stored with Apple and in Adapty's servers.
366+
:::
367+
368+
```swift showLineNumbers
369+
let configurationBuilder = AdaptyConfiguration
370+
.builder(withAPIKey: "YOUR_PUBLIC_SDK_KEY")
371+
.with(clearDataOnBackup: true) // default – false
372+
```

0 commit comments

Comments
 (0)