diff --git a/content/docs/ios/sdk-reference/identify.mdx b/content/docs/ios/sdk-reference/identify.mdx index 48494714..02d07b39 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`. | + + `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 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..e836d784 100644 --- a/content/shared/user-management/identity-management.mdx +++ b/content/shared/user-management/identity-management.mdx @@ -113,6 +113,34 @@ 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. -Make sure any `userId` you pass to `identify` is a valid UUID string, as Apple requires `appAccountToken` values to follow the UUID format. +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 + + `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 +let userId = UUID().uuidString +Superwall.shared.identify(userId: userId) +```