Skip to content

IDManagementAndroid

ID Management Android

User

Package : com.denachina.lcm.sdk.user
Class : User

 

Interface / Method
Parameters details
Note
public String getCity() Gets the current city of the user.
public String getCountry() Gets the current country code of the user.
public String getRegion() Gets the current region code of the user.
public long getUserId() Gets the user's LCM identifier.
public StoreAccount getStoreAccount() Gets the user's StoreAccount that is applicable to the current device/marketplace.

public static User getUserByUserId(

Activity activity,

long userId,

OnGetUserComplete onGetUserComplete

)

activity

The current instance of your application's main activity

userId

The userId

onGetUserComplete

Callback of the getUserByUserId.
Get User object by userId.
public void linkAccount(Activity activity,

SocialInfo socialInfo,

User.LinkAccountCallback callback)

activity

The current instance of your application's main activity

soicalInfo

The SocialInfo object.

 callback

The object to be notified upon link completion
Links the user's LCM account to load the LCM account by other social account.
public void unlinkAccount(Activity activity,

SocialInfo socialInfo,

User.UnlinkAccountCallback callback)

activity

The current instance of your application's main activity

soicalInfo

The SocialInfo object.

 callback

The object to be notified upon unlink completion
Unlink the social account by social type.
public void loadAccount(Activity activity,

SocialInfo socialInfo,

User.LoadAccountCallback callback)

activity

The current instance of your application's main activity

soicalInfo

The SocialInfo object.

callback

The object to be notified upon load completion
Loads the user's LCM account from the link information.
public void linkOrLoadAccount(Activity activity,

SocialInfo socialInfo,

User.LinkOrLoadAccountCallback callback)

activity

The current instance of your application's main activity

soicalInfo

The SocialInfo object.

 callback

The object to be notified upon linkOrLoad completion

Link lid to a social account,

if the social account has already linked,

load the social account.

public void getLinkInfo(

Activity activity,

User.GetLinkInfoCallback callback

)

activity

The current instance of your application's main activity

callback

The object to be notified upon getLinkInfo completion

返回该用户所支持的link/load类型,如果用户已经绑定过社交帐号,

GetLinkInfoCallback中SocialInfo List中的socialAccount即是用户已经绑定的社交帐号。

 

User.OnGetUserComplete

Package : com.denachina.lcm.sdk
Interface : User.OnGetUserComplete

 

Interface
Parameters details
Note
public void onComplete(User user,LCMError error)

 user

The user object.

error

null if no error occurred, otherwise a valid LCMError
Callback of the getUserByUserId.

 

 

User.GetLinkInfoCallback

Package : com.denachina.lcm.sdk
Interface : User.LinkAccountCallback

 

Interface
Parameters details
Note
public void onComplete(List<SocialInfo> linkInfo,LCMError error)

 linkInfo

The linkInfo of the user.

error

null if no error occurred, otherwise a valid LCMError
Event handler called upon completion of User.getLinkInfo(Activity, getLinkInfoCallback).

 

 

User.LinkAccountCallback

Package : com.denachina.lcm.sdk
Interface : User.LinkAccountCallback

 

Interface
Parameters details
Note
public void onComplete(

String socialType,

String socialAccount,

LCMError error)

socialType

socialType

 socialAccount

oneTimeCodeExp if socialType is oneTimeCode

error

null if no error occurred, otherwise a valid LCMError
The callback of the linkAccount.

 

User.UnlinkAccountCallback

Package : com.denachina.lcm.sdk
Interface : User.UnlinkAccountCallback

 

Interface
Parameters details
Note
public void onComplete(

boolean isSuccess,

LCMError error)

isSuccess

The unlink result.

error

null if no error occurred, otherwise a valid LCMError
The callback of the unlinkAccount.

 

User.LoadAccountCallback

Package : com.denachina.lcm.sdk
Interface : User.LoadAccountCallback

 

Interface
Parameters details
Note
public void onComplete(User afterUser, User beforeUser,

String accessToken,

LCMError error)

newUser

The new user ID for after linking, or -1 upon error

oldUser

The user ID which was replaced with the new user ID, or -1 upon error

 

accessToken

The new accessToken.

 

error
null if no error occurred, otherwise a valid LCMError
Event handler called upon completion of User.loadAccount(Activity, LoadAccountCallback).

User.LinkOrLoadAccountCallback

Package : com.denachina.lcm.sdk
Interface : User.LinkOrLoadAccountCallback
LoadAccountCallback

 

Interface
Parameters details
Note
public void onComplete(

String socialType,

String socialAccount,

User afterUser, User beforeUser,

String accessToken,

LCMError error)

socialType

socialType

 socialAccount

oneTimeCodeExp if socialType is oneTimeCode

 

newUser

 

The new user ID for after linking, or -1 upon error

 

oldUser

 

The user ID which was replaced with the new user ID, or -1 upon error

 

accessToken

 

The new accessToken.

error

null if no error occurred, otherwise a valid LCMError
The callback of the linkOrLoadAccount.

 

StoreAccount

Package : com.denachina.lcm.sdk.user
Class : StoreAccount

 

Interface
Parameters details
Note
public String getAdvertisingId() Gets the user's advertising ID for this marketplace network.
public String getStoreType() The store type
public String getStoreUserId() Gets the user's ID for this marketplace network.
public String getDeviceToken() 

Gets the current device's token ID for this marketplace network.

public String getFrom() 

Gets the login method for this marketplace network.

Possible values: googleplay,oneClick,mobile,weChat,sso

public String getStoreCredential() 

Gets the store credential.

ex: facebook token, wechat token...

SocialInfo

Package : com.denachina.lcm.sdk.social
Class : SocialInfo

 

Type
Attribute
Note
StringsocialTypesocial类型,facebook、line等
StringappId初始化所需要的appid
StringsocialAccount

调用第三方Library获取socialAccount以后回填

StringsocialInfo调用第三方Library获取socialInfo以后回填(封装成Json类型的String)

 

 

 

Back to top