Overview
Encore requires user identification to track entitlements and prevent abuse across devices. You can also set user attributes to enable targeted offers and personalization.Anonymous Users
Encore automatically generates a random user ID that persists until the user deletes/reinstalls your app or callsreset().
This anonymous ID is stored securely and allows entitlement tracking to work immediately without requiring explicit user identification. The auto-generated ID is a standard UUID (e.g., 550e8400-e29b-41d4-a716-446655440000).
You can call Encore.shared.reset() to reset this ID and clear any entitlement data.
Identified Users
If you use your own user management system, callidentify(userId:) when you have a user’s identity:
- Associate promotional access with your user account
- Sync entitlements across devices when the user logs in
- Track conversion attribution accurately
Resetting User Identity
When a user logs out, callreset():
- Reset the user ID to a new auto-generated anonymous ID
- Clear cached entitlement data
- Clear all user attributes
Setting User Attributes
User attributes enable:- Personalized offers based on user data (subscription tier, usage, etc.)
- Audience targeting with specific offers in the Encore dashboard
- Conversion context tracking for analytics
Usage
Set attributes using theEncoreAttributes struct. All values are strings; use the custom dictionary for app-specific fields:
setUserAttributes() merges with existing attributes - it does not replace them.
See the SDK Reference for details: identify(), setUserAttributes(), and the full EncoreAttributes field list and formats.
Implementation Examples
SwiftUI with Login
UIKit with Login
Apps Without Login
If your app doesn’t require users to log in, you don’t need to do anything special:Next Steps
- Presenting Offers - Show promotional offers to your users
- Tracking Entitlements - Learn how to check user entitlements