3. SDK Features

Extend

Activity using SDK must be extend FragmentActivity by Java or AppcompatActivity by Kotlin

public class MainActivity extends FragmentActivity {
 ...
}

Login

  • This function will initialize the default configuration for the SDK and call the login/register form automatically.

  • Upon successful login/registration the SDK returns a model containing the user's data as result in callback onSuccess(). Handling of successful login/registration here

  • When login / registration is not successful, it will be handled at the callback onFail()

 FID.INSTANCE.login(new FIDCallBack<FIDUser>() {

            @Override
            public void onFail(@Nullable String error) {

            }

            @Override
            public void onSuccess(FIDUser result) {

            }

            @Override
            public void onCancel() {
               
            }
 });

Logout

  • When successful logout will be processed in callback onSuccess()

  • When the logout fails, it will be handled at the callback onFail()

Refresh token (manual)

Get user information

  • Call the function to Refresh token before call getCurrentAccount with the syntax

  • Then call the function to get user information with the syntax

In app purchase

  • Before using payment, dev needs to call setPlayerInfo function. Where: server_nameis the identifier of the game server and character_nameis the name of the game character.

The partner side uses the available UI

  • Function to get list of items:

  • Item purchase handler function, passing in the paymentWithoutUISDK function the productInfo object is taken from the list item list in getListProduct function.

  • The onSuccess callback returns a list of items as listProductItem. Dev takes this data to self build interface.

  • When the item list cannot be obtained, the dev will process it in the onFail callback.

  • Upon successful item purchase, it will be processed in the onSuccess callback. In this callback return 1 transaction code.

  • In case of unsuccessful item purchase, it will be handled at the onFailure' callback.

  • When purchasing items that the user cancels will be handled in the onCancel callback.

How does the payment flow work?

All payment methods share the same flow of operations as follows:

Game calls the payment interface from the SDK. The game will get the item list from the SDK or the SDK shows the item list for the game The SDK sends a payment request to the server. The server notifies the game server through an api payment callback, the game server processes the transaction to add money or in-game items and then tells the game to display the results in the game. At the same time, the server also receives information and returns it to the SDK. Sdk send packages to client game. The SDK still reports the results to the game through a delegate. The game that has received the results from the game server (which is the most accurate) does not need to use the information returned from this SDK anymore. It is used in special cases.

Q&A

This part the game will ask the SDK to open a webview form for users to create questions about the game, as well like refer to the issues that the community has answered before,...

  • Call the Q&A function with the syntax:

Connect Account

  • Call the Connect account function with the syntax:

Tracking

  • Using this code for some events:

  • For custom events:

Language

  • FID support multiple language: Vietnamese & English

Bubble support Button

  • Bubble support is other layout support multiple function: IAP, news, connect account, ...

  • For show bubble support:

  • For hide bubble support:

  • For automatic handle deeplink like openApp or Ads, onelink, use code like beblow:

Change Password

Update phone

  • Using for user login by thirdparty then want to connect with FID phonenumber account

Handle Giftcode

Using this for event scan QRcode to get giftcode ingame.

FIDGiftCode

Params
Type
Description

code

String

Giftcode ingame

content

String

Description giftcode event

Playnow Account Not Linked

If App/Game require link account for play now account before make an In App Purchase, you can use this function:

Enable Debug Log

Proguard

Last updated