From 1b83fd0ee31bc67cbb2bf620280e834fbfd7e3c1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 15 Oct 2025 21:27:17 +0000 Subject: [PATCH 1/2] Add iOS identify userId UUID warning Co-authored-by: duncan --- content/docs/ios/sdk-reference/identify.mdx | 6 ++++++ .../user-management/identity-management.mdx | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/content/docs/ios/sdk-reference/identify.mdx b/content/docs/ios/sdk-reference/identify.mdx index 48494714..0d61a0dd 100644 --- a/content/docs/ios/sdk-reference/identify.mdx +++ b/content/docs/ios/sdk-reference/identify.mdx @@ -26,6 +26,12 @@ public func identify( | `options` | `IdentityOptions?` | Optional configuration for identity behavior. Set `restorePaywallAssignments` to `true` to wait for paywall assignments from the server. Use only in advanced cases where users frequently switch accounts. Defaults to `nil`. | + + iOS only: `appAccountToken` must be a UUID. If the `userId` you pass to `identify` is not a valid UUID string, StoreKit will not accept it for `appAccountToken` and the SDK will fall back to the anonymous alias UUID. This can cause the identifier in App Store Server Notifications to differ from the `userId` you passed. + + For consistency, always use a v4 UUID for `userId` on iOS. See Apple's docs: [appAccountToken](https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken). + + ## Returns / State This function returns `Void`. After calling, [`isLoggedIn`](/ios/sdk-reference/userId) will return `true` and [`userId`](/ios/sdk-reference/userId) will return the provided user ID. diff --git a/content/shared/user-management/identity-management.mdx b/content/shared/user-management/identity-management.mdx index f34b538f..ddfb34b2 100644 --- a/content/shared/user-management/identity-management.mdx +++ b/content/shared/user-management/identity-management.mdx @@ -114,5 +114,18 @@ On iOS, Superwall always supplies an [`appAccountToken`](https://developer.apple | You’ve called `Superwall.shared.identify(userId:)` | The exact `userId` you passed | | You *haven’t* called `identify` yet | The UUID automatically generated for the anonymous user (the **alias ID**), **without** the `$SuperwallAlias:` prefix | -Because the SDK falls back to the alias UUID, purchase notifications sent to your server always include a stable, unique identifier—even before the user signs in. -Make sure any `userId` you pass to `identify` is a valid UUID string, as Apple requires `appAccountToken` values to follow the UUID format. +| You passed a non‑UUID `userId` to `identify` | StoreKit rejects it; Superwall falls back to the alias UUID | + +Because the SDK falls back to the alias UUID, purchase notifications sent to your server always include a stable, unique identifier—even before the user signs in. + + + On iOS, `appAccountToken` must be a UUID. If the `userId` you pass to `identify` is not a valid UUID string, StoreKit will not accept it for `appAccountToken` and transactions will instead contain the anonymous alias UUID. This can make the identifier you see in App Store Server Notifications differ from the `userId` you passed to `identify`. + + To avoid confusion, always use a v4 UUID for your `userId` on iOS. + + +```swift +// Generate and use a UUID user ID in Swift +let userId = UUID().uuidString +Superwall.shared.identify(userId: userId) +``` From eaed19f6806e473ce3f4fc4573d404d2b1c67d8f Mon Sep 17 00:00:00 2001 From: Duncan Crawbuck Date: Mon, 20 Oct 2025 15:06:49 -0700 Subject: [PATCH 2/2] fix: formatting and copy improvements --- content/docs/ios/sdk-reference/identify.mdx | 6 ++--- .../user-management/identity-management.mdx | 23 +++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/content/docs/ios/sdk-reference/identify.mdx b/content/docs/ios/sdk-reference/identify.mdx index 0d61a0dd..02d07b39 100644 --- a/content/docs/ios/sdk-reference/identify.mdx +++ b/content/docs/ios/sdk-reference/identify.mdx @@ -27,9 +27,9 @@ public func identify( - iOS only: `appAccountToken` must be a UUID. If the `userId` you pass to `identify` is not a valid UUID string, StoreKit will not accept it for `appAccountToken` and the SDK will fall back to the anonymous alias UUID. This can cause the identifier in App Store Server Notifications to differ from the `userId` you passed. - - For consistency, always use a v4 UUID for `userId` on iOS. See Apple's docs: [appAccountToken](https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken). + `appAccountToken` must be a UUID to be accepted by StoreKit. + + If the `userId` you pass to `identify` is not a valid UUID string, StoreKit will not accept it for `appAccountToken` and the SDK will fall back to the anonymous alias UUID. This can cause the identifier in App Store Server Notifications to differ from the `userId` you passed. See Apple's docs: [appAccountToken](https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken). ## Returns / State diff --git a/content/shared/user-management/identity-management.mdx b/content/shared/user-management/identity-management.mdx index ddfb34b2..e836d784 100644 --- a/content/shared/user-management/identity-management.mdx +++ b/content/shared/user-management/identity-management.mdx @@ -113,16 +113,31 @@ On iOS, Superwall always supplies an [`appAccountToken`](https://developer.apple |----------|----------------------------------| | You’ve called `Superwall.shared.identify(userId:)` | The exact `userId` you passed | | You *haven’t* called `identify` yet | The UUID automatically generated for the anonymous user (the **alias ID**), **without** the `$SuperwallAlias:` prefix | - | You passed a non‑UUID `userId` to `identify` | StoreKit rejects it; Superwall falls back to the alias UUID | Because the SDK falls back to the alias UUID, purchase notifications sent to your server always include a stable, unique identifier—even before the user signs in. +:::ios - On iOS, `appAccountToken` must be a UUID. If the `userId` you pass to `identify` is not a valid UUID string, StoreKit will not accept it for `appAccountToken` and transactions will instead contain the anonymous alias UUID. This can make the identifier you see in App Store Server Notifications differ from the `userId` you passed to `identify`. - - To avoid confusion, always use a v4 UUID for your `userId` on iOS. + `appAccountToken` must be a UUID to be accepted by StoreKit. + + If the `userId` you pass to `identify` is not a valid UUID string, StoreKit will not accept it for `appAccountToken` and the SDK will fall back to the anonymous alias UUID. This can cause the identifier in App Store Server Notifications to differ from the `userId` you passed. See Apple's docs: [appAccountToken](https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken). + +::: +:::flutter + + On iOS, `appAccountToken` must be a UUID to be accepted by StoreKit. + + If the `userId` you pass to `identify` is not a valid UUID string, StoreKit will not accept it for `appAccountToken` and the SDK will fall back to the anonymous alias UUID. This can cause the identifier in App Store Server Notifications to differ from the `userId` you passed. See Apple's docs: [appAccountToken](https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken). + +::: +:::expo + + On iOS, `appAccountToken` must be a UUID to be accepted by StoreKit. + + If the `userId` you pass to `identify` is not a valid UUID string, StoreKit will not accept it for `appAccountToken` and the SDK will fall back to the anonymous alias UUID. This can cause the identifier in App Store Server Notifications to differ from the `userId` you passed. See Apple's docs: [appAccountToken](https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken). +::: ```swift // Generate and use a UUID user ID in Swift