Skip to content

Commit c3fb780

Browse files
eandreeva-twrclaude
andcommitted
fix: add missing CrossDeviceDetection reusable component
Seven docs (android/capacitor/flutter/kmp/react-native/unity/version-3.0 identifying-users.mdx) import this reusable from @site/src/components/reusable/CrossDeviceDetection.mdx, but the file was added on main in 218f3ba and never reached develop. Astro's MDX render fails at runtime with "Expected component CrossDeviceDetection to be defined". Copied verbatim from main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 878b28b commit c3fb780

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
no_index: true
3+
---
4+
5+
When the SDK is activated, it automatically reads the user's existing entitlements from StoreKit (iOS) or Google Play Billing (Android) and syncs them with the Adapty backend. An active subscription appears on the Adapty profile without the app calling `restorePurchases`.
6+
7+
What does **not** happen automatically is recognizing that a profile on a new device belongs to the same user as a profile on the original device. Adapty matches profiles by Customer User ID, so identity continuity depends on what you use as the CUID.
8+
9+
**What Adapty can detect across devices**
10+
11+
| Your setup | What Adapty detects | What you must do |
12+
| --- | --- | --- |
13+
| Customer User ID = `device_id` (no app login) | The new device gets a different CUID and therefore a different profile. The subscription syncs to the new profile via an **Access level updated** event, but `subscription_started` does not fire — the new profile is treated as an inheritor of the original purchase. Analytics keyed on `subscription_started` will undercount returning users. | Use a stable account ID as the Customer User ID so a returning user matches the existing profile across devices. |
14+
| Customer User ID = stable account ID (login on every device) | The SDK auto-syncs the subscription on `activate()`, and `identify()` matches the existing profile by CUID. | No additional setup needed — both identity and subscription resolve automatically. |
15+
| Apple Family Sharing inheritor | The family member receives the subscription through an **Access level updated** event only — `subscription_started` does not fire. | Listen for **Access level updated**. See [Apple Family Sharing](apple-family-sharing) for the full event matrix. |
16+
| Same Apple/Google account, different in-app users | The first profile to record the purchase becomes the parent. Subsequent profiles see the subscription through an inheritor chain, with one **Access level updated** event. | Require login, then choose a [sharing mode](sharing-paid-access-between-user-accounts) that fits your model. |
17+
18+
**Restoring purchases on a new device**
19+
20+
Expose a user-initiated "Restore purchases" button on your paywall. Apple App Review (guideline 3.1.1) requires one, and it acts as a fallback when the automatic sync misses an edge case. The button should call `restorePurchases` on your SDK.
21+
22+
A programmatic `restorePurchases` call on first launch is not required for normal use — the SDK already runs the equivalent on `activate()`. Reserve programmatic calls for forcing a fresh receipt check, for example when debugging missing access after `activate()` completed.

0 commit comments

Comments
 (0)