Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions content/docs/ios/sdk-reference/identify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`. |
</ParamTable>

<Warning>
`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).
</Warning>

## 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.

Expand Down
32 changes: 30 additions & 2 deletions content/shared/user-management/identity-management.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
<Warning>
`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).
</Warning>
:::
:::flutter
<Warning>
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).
</Warning>
:::
:::expo
<Warning>
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).
</Warning>
:::

```swift
// Generate and use a UUID user ID in Swift
let userId = UUID().uuidString
Superwall.shared.identify(userId: userId)
```