Login strategies
Authentication Required (default): The login dialog opens automatically whenPlaytoliaGameObject initializes. This strategy is best for games that require login from the start.
Manual: Disable “Authentication Required” under Playtolia → Features in Project Settings. Then call PromptLogin() at the moment that you select, for example after a tutorial or at a gated feature.
Prompting login
Non-dismissable dialogs block all touch input on the game scene behind them.
Listening to auth state
Reading the auth state
The SDK refreshes the tokens automatically in the background. You do not have to handle token expiry.
Logout
Authentication providers
Enable each provider under Playtolia → Features in Project Settings: Google, Facebook, Apple (required on iOS), Discord, Email/Password, and Guest.Password reset
The login overlay handles password reset without any code in your game. A player who taps FORGOT PASSWORD enters their email, receives a one-time code, and sets a new password in the overlay. The backend decides how the code behaves, and the overlay follows it:- Code length. The number of digit boxes comes from the server response, not from a constant in the SDK. If your team changes the code length in the backend, players see the new length without a game update. When the server sends no length, the overlay asks for 6 digits.
- Validity. The countdown under the digit boxes is the real lifetime of the code, as reported by the server. When it reaches zero, the overlay tells the player the code expired and blocks the confirm button.
- Resend. A RESEND CODE button sends a new code and restarts both countdowns. The button stays disabled during a cooldown. If the server rejects a request as too early, the overlay uses the wait time from the server response for the countdown.
The same rules apply to the email verification code, because both codes come from the same backend contract.
Terms of Service & Privacy Policy links
The sign-up screen shows a consent line with Terms of Service and Privacy Policy labels next to the acknowledgment checkbox. Set the destinations under Legal on the Playtolia → Features page:- Terms of Service URL
- Privacy Policy URL
Account Management
Access user profile data after login