User System

User system is used to manage SG users, including signup, login and kids (family members ) management, etc. Most of the functions use WebView control as part of the process flow. To handle response of these functions, you need to register a callback listener to SGSDK.

Signup

Function

void signup()

Description
  • Launch [Signup] view.
  • After signning up, system logs user in automatically, and widget button is shown.
Response
Android UI

Login

Function

void login()

Description
  • Launch [Login] view.
  • After successful login, widget button is shown.
Response
Android UI

Forget Password

Function

void forgetPassword()

Description
  • Launch [Forget Password] view.
Response
Android UI

Change Password

Function

void changePassword()

Description
  • Launch [Change Password] view.
Response
Android UI

Parental Lock

Function

void parentalLock()

Description
  • Launch [Parental Lock] view.
  • You can use parental lock utility view before important actions.
  • After successfully enter the code, it redirects to [My Account] page.
  • If the user haven't created any kid (family member), , it redirects to [My Kid] page.
Android UI

My Kid

Function

void myKid()

Description
  • Launch [My Kid] view.
  • The flow is for creating new kid (family member) of the user.
Response
Android UI

Select Kid

Function

void selectKid()

Description
  • Launch [Select Kid] view.
  • The flow is used to select a kid to play. After selection, you can use GetKidIndex() and GetKidFace() to get selected kid index and face icon number.
Response
Android UI

My Account

Function

void myAccount()

Description
  • Launch [My Account] view.
  • The flow is the entry page for managing kids (family members).
Android UI

Verify Session

Function

verifySession(String gameKey, String sessionId, String openId, Stirng sign)

Description
  • Verify if current session ID is valid.
Parameters
gameKey Your developer identification.
sessionId Current session ID.
You can obtain it through GetSessionID() after user login.
openId SG member ID.
You can obtain it through GetOpenID() after user login.
sign Signature generated from above three parameters.
Please refer to signature algorithm.
Response

Login by Token

Function

void loginByToken(String token)

Description
  • Login into the system by previously saved token.
Parameters
  • Token used for login.
    You can obtain it through GetToken() after user login.
Response

Other Functions

1.Get Open ID

Function

String getOpenID()

Description
  • Obtain Open ID (SG ID) after user login.
Response
  • Return Open ID if successful, or NULL if failed.

2.Get Session ID

Function

String getSessionID()

Description
  • Obtain Session ID after user login.
Response
  • Return Session ID if successful, or NULL if failed.

3.Get Token

Function

void getToken()

Description
  • Obtain Token after user login.
Response
  • Return Token if successful, or NULL if failed.

4.Get index of selected kid

Function

int getKidIndex()

Description
  • Obtain index of selected kid.
  • Note: invoking following functions might change kid index: login, signup, selectKid, myKid, and loginByToken.
Response
  • Return index number if successful, or 0 if failed.

5.Get face icon of selected kid

Function

String getKidFace()

Description
  • Obtain face icon of selected kid.
Response
  • Return face icon if successful, or NULL if failed.

6.Check login status

Function

boolean isLogin()

Description
  • Check login status.
Response
  • Return true if login, or false if not.

7.Get Channel ID

Function

String getChannelID()

Description
  • Obtain Channel ID
Response

Widget

1.Show widget button

Function

void showWidget(EWidgetLocation location)

Description
  • Widget button is shown automatically after successful login or signup.
  • Click on widget button will launch My Account view.
Parameters

Enum : EWidgetLocation

Case Description
TopLeft Top left of the screen
Top Top of the screen
TopRight Top right of the screen
Left Left side of the screen
Right Right side of the screen
BottomLeft Bottom left of the screen
Bottom Bottom of the screen
BottomRight Bottom right of the screen

2.Hide widget button

Function

void hideWidget()

Description
  • Hide widget button.

3.Check widget visibility

Function

boolean isWidgetVisible()

Description
  • Check widget visibility.
Response
  • True if visible, or false if not.

Logout

Function

void logout()

Description
  • Log user out.
  • After successful logout, widget button is hidden automatically.
Response