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 void linkAccount(Activity activity, SocialInfo socialInfo, User.LinkAccountCallback callback) | activity The current instance of your application's main activity
The SocialInfo object. 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
The SocialInfo object. 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
The SocialInfo object.
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
The SocialInfo object. 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
The object to be notified upon getLinkInfo completion | 返回该用户所支持的link/load类型,如果用户已经绑定过社交帐号, GetLinkInfoCallback中SocialInfo List中的socialAccount即是用户已经绑定的社交帐号。 |
User.OnGetUserComplete
|
User.GetLinkInfoCallback
Interface | Parameters details | Note |
---|---|---|
public void onComplete(List<SocialInfo> linkInfo,LCMError error) | linkInfo The linkInfo of the user. error
| Event handler called upon completion of User.getLinkInfo(Activity, getLinkInfoCallback) . |
User.LinkAccountCallback
Interface | Parameters details | Note |
---|---|---|
public void onComplete( String socialType, String socialAccount, LCMError error) | socialType socialType socialAccount oneTimeCodeExp if socialType is oneTimeCode error
| The callback of the linkAccount. |
User.UnlinkAccountCallback
Interface | Parameters details | Note |
---|---|---|
public void onComplete( boolean isSuccess, LCMError error) | isSuccess The unlink result. error
| The callback of the unlinkAccount. |
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
| Event handler called upon completion of User.loadAccount(Activity, LoadAccountCallback) . |
User.LinkOrLoadAccountCallback
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
| The callback of the linkOrLoadAccount. |
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
Type | Attribute | Note |
---|---|---|
String | socialType | social类型,facebook、line等 |
String | appId | 初始化所需要的appid |
String | socialAccount | 调用第三方Library获取socialAccount以后回填 |
String | socialInfo | 调用第三方Library获取socialInfo以后回填(封装成Json类型的String) |