Authorization
Configure
Configuration by using the Unity Settings Inspector.
iOS
Base
Fill the following fields in the settings inspector, please (ask your release manager for those parameters):
- App Name - application name
- App Config Name - application config name
- Client Id - client id
For App Config Name use the name in lowercase.
For example: use some_game_name not Some_Game_Name.
Sign In with Facebook
Fill the following field in the settings inspector, please (ask your release manager for that parameter):
- Facebook App Id - id of your project on Facebook
Sign In with Game Center
Is enabled by default and do the following in XCode, please.
Sign In with Apple
For enabling that feature do the following in XCode, please.
Automatic Authorization
Turned on by default. To turn it on/off you need to set the following check box in the settings inspector:
- Auto Login Enabled - on/off automatic autorization
Device Token
Turned on by default. A constant token is used instead of a refresh token. To turn it on/off you need to set the following check box in the settings inspector:
- Device Token Enabled - on/off device token
EULA Window
Turned on by default. To configure the EULA window you need to fill the following parameters in the settings inspector:
- EULA Show Enabled - on/off the EULA window
- EULA Default Url - license agreement link
Guest Account Warning
Turned on by default. The warning is shown to a user every 24h if they use a guest account. To turn it on/off you need to set the following check box in settings inspector:
- Guest Timeout Enabled - on/off guest account warning
Android
Base
Fill the following fields in the settings inspector, please (ask your release manager for those parameters):
- App Name - application name
- App Config Name - application config name
- Client Id - client id
For App Config Name use the name in lowercase.
For example: use some_game_name not Some_Game_Name.
Sign In with Facebook
Fill the following fields in the settings inspector, please (ask your release manager for those parameters):
- Facebook App Id - id of your project on Facebook
- Facebook Provider App Id - provider (read more)
VK
Fill the following field in the settings inspector, please (ask your release manager for those parameters):
- VK Enabled - turn on/of allow to show/hide the Google authorization button
- VK App Id - VKontakte application id
Sign In with Google
Fill the following fields in the settings inspector, please (ask your release manager for those parameters):
- Google Play Enabled - turn on/of allow to show/hide the Google authorization button
- Google Client Id - Google client id
- Google Play Services App Id - Google Play Services application id
- Google Auth First Session - using of Google authorization from the first session
Automatic Authorization
Turned on by default. To turn it on/off you need to set the following check box in settings inspector:
- Auto Login Enabled - on/off automatic autorization
Gues Authorization Button
Guest authorization button is turned on by default. You can change authorization button enabling setting in the settings inspectors by changing the following setting:
- Guest Enabled - guest authorization button enabled
You also can handle guest authorization logic in code (read more).
EULA Window
Turned on by default. To configure the EULA window you need to fill the following parameters in the settings inspector:
- EULA Show Enabled - on/off the EULA window
- EULA Default Url - license agreement link
Guest Account Warning
Turned on by default. The warning is shown to a user every 24h if they use a guest account. To turn it on/off you need to set the following check box in settings inspector:
- Guest Timeout Enabled - on/off guest account warning
Device Token
Turned on by default. A constant token is used instead of a refresh token. To turn it on/off you need to set the following check box in settings inspector:
- Device Token Enabled - on/off device token
Usage
The result of methods is passed to event handler.
Authorize
To authorize use:
P101XP.GetInstance().Authorize();
ShowProfile
To show profile use:
P101XP.GetInstance().ShowProfile();
Event
Please, subscribe on the event:
private void AuthorizeResultHandler(AuthorizeResult authorizeResult)
{
}
P101XP.GetInstance().AuthorizeResultEvent += AuthorizeResultHandler;
AuthorizeResult
var name | description |
---|---|
access_token_id | string variable, access token id value |
is_guest | bool variable, if is true the authorized user is guest |
provider | string variable, name of social network, null if the user is guest or authorized by 101XP portal |
error_message | string variable, error message of authorize if the string is not null |
To determine that the user is logged in with the 101XP portal, you can check fields portal is empty and is_guest is false.