User Management
Identify, reset, and attach attributes to Unity players.
Superwall starts with an anonymous user ID. Identify players after login or account creation so paywall assignments and analytics follow the same user across devices.
Identify a User
using Superwall;
public void OnLoginComplete(string userId)
{
Superwall.Shared.Identify(userId);
}If you want Superwall to restore paywall assignments after identifying the user, pass
IdentityOptions.
Superwall.Shared.Identify(
"user_123",
new IdentityOptions { RestorePaywallAssignments = true }
);Reset on Logout
Call Reset when the player logs out.
public void OnLogout()
{
Superwall.Shared.Reset();
}Set User Attributes
Use attributes to target audiences and personalize paywalls.
using System.Collections.Generic;
using Superwall;
Superwall.Shared.SetUserAttributes(new Dictionary<string, object>
{
{ "player_level", 42 },
{ "guild_id", "north_star" },
{ "completed_tutorial", true }
});You can read the current attributes from Unity:
var attributes = Superwall.Shared.GetUserAttributes();Read Identity State
var userId = Superwall.Shared.UserId;
var isLoggedIn = Superwall.Shared.IsLoggedIn;Avoid sending personally identifiable information as plain user attributes unless your privacy policy and data processing setup allow it.
How is this guide?