Configure
App configuration
Add app_config_name, client_id to AndroidManifest.xml.
Please, ask your release manager for app_config_name, client_id values
For app_config_name use the name in lowercase.
For example: use some_game_name not Some_Game_Name.
<meta-data
android:name="com.platform101xp.sdk.app_config_name"
android:value="@string/app_config_name" />
<meta-data
android:name="com.platform101xp.sdk.client_id"
android:value="@string/client_id" />
Setting up authorization providers
Users can authorize via the 101XP platform and social networks (Facebook, Vkontakte, Odnoklassniki, Google) or use a guest account.
Setting up checking token
Setting up automatic authorization
Automatic authorization is turned off by default.
If you need to turn on the automatic authorization, add the value auto_login_enabled = true to AndroidManifest: This functionality was invented for hypercasuals. Before enabling it, make sure that you definitely need it.
<meta-data
android:name="com.platform101xp.sdk.auto_login_enabled"
android:value="true" />
Guest authorization button
Guest authorization button is turned on by default.
To manage this option you need to add the following metadata to your AndroidManifest:
<meta-data
android:name="com.platform101xp.sdk.guest_enabled"
android:value="@bool/guest_enabled"/>
If automatic authorization is turned on, the guest authorization button will be displayed.
If you need to check whether a user has been authorized as a guest, use method isGuest()
if (Platform101XP.isGuest()) {
//TODO something
}
\"Only Guest\" Authorization
\"Only Guest\" Authorization flag. For hypercasuals create flag only guest authorization. On start SDK skip check token and all auth call just call guest authorization. \"Only Guest\" authorization is turned off by default.
<meta-data
android:name="com.platform101xp.sdk.guest_only_auth"
android:value="@bool/guest_only_auth" />
<bool name="guest_only_auth">false\/true</bool>
Setting up EULA window
The EULA window is displayed by default.
To turn it on\off you need to add license_agreement_enabled to AndroidManifest.
To change default url use license_agreement_url.
To turn it on\off you need to add license_agreement_auto_accept to AndroidManifest. (default: false)
If license_agreement_enabled == false and license_agreement_auto_accept == true your analytics be send always without EULA window but if license_agreement_enabled == true auto accept not working. Only handle user's Accept.
<meta-data android:name="com.platform101xp.sdk.license_agreement_enabled"
android:value="@bool/eula_show_enabled"/>
<meta-data android:name="com.platform101xp.sdk.license_agreement_url"
android:value="@string/eula_url" />
<meta-data android:name="com.platform101xp.sdk.license_agreement_auto_accept"
android:value="@bool/eula_auto_accept" />
Setting up a warning about linking a social network
This dialog is turned on by default and is shown to a user every 24h if they use a guest account.
To turn it on\off you need to add guest_timeout_enabled to AndroidManifest:
<meta-data
android:name="com.platform101xp.sdk.guest_timeout_enabled"
android:value="@bool/guest_timeout_enabled"/>