Package com.kii.cloud.storage.social
Interface KiiSocialConnect
-
- All Known Implementing Classes:
KiiSocialNetworkConnector
public interface KiiSocialConnect
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
KiiSocialConnect.SocialNetwork
Identifier of each social network.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description android.os.Bundle
getAccessTokenBundle()
Return the access tokens in a bundle for specified social network.
Details of bundle key-values are described in sub classes.void
initialize(java.lang.String consumerKey, java.lang.String consumerSecret, android.os.Bundle options)
Initialize specified Social network with consumer key, consumer secret.void
link(android.app.Activity activity, android.os.Bundle options, KiiSocialCallBack callback)
Link current login user to specified social network.void
logIn(android.app.Activity activity, android.os.Bundle options, KiiSocialCallBack callback)
Note that using the login UI provided by the SDK will be discontinued after July 31st, 2019.void
unlink(android.app.Activity activity, android.os.Bundle options, KiiSocialCallBack callback)
Unlink current login user from specified social network.
-
-
-
Method Detail
-
initialize
void initialize(@NonNull java.lang.String consumerKey, @Nullable java.lang.String consumerSecret, @Nullable android.os.Bundle options)
Initialize specified Social network with consumer key, consumer secret. For details, please see documents of subclass.- Parameters:
consumerKey
- Consumer key given by social network.consumerSecret
- Consumer secret given by social network.options
- defined by each social network.- Throws:
java.lang.IllegalArgumentException
- Thrown if consumerKey is null or empty.- See Also:
KiiFacebookConnect.initialize(String, String, Bundle)
,KiiTwitterConnect.initialize(String, String, Bundle)
,KiiQQConnect.initialize(String, String, Bundle)
-
logIn
void logIn(@Nullable android.app.Activity activity, @Nullable android.os.Bundle options, @Nullable KiiSocialCallBack callback)
Note that using the login UI provided by the SDK will be discontinued after July 31st, 2019.Login with specified social network. If there is already logged in user, perform logout and login with credentials given by user. For details, please see documents of subclass. If successful, the user is cached inside SDK as current user,
and accessible viaKiiUser.getCurrentUser()
.
This user token is also cached and used by the SDK when the access token is required.
Access token won't be expired unless you set it explicitly byKii.setAccessTokenExpiration(long)
. User token can be get byKiiUser.getAccessToken()
.
From next time, it is possible to login by access tokenKiiUser.loginWithToken(String)
, until the token is expired.- Parameters:
activity
- which invokes login procedure.options
- defined by each social network.callback
- notifies events asynchronously.- See Also:
KiiFacebookConnect.logIn(Activity, Bundle, KiiSocialCallBack)
,KiiTwitterConnect.logIn(Activity, Bundle, KiiSocialCallBack)
,KiiQQConnect.logIn(Activity, Bundle, KiiSocialCallBack)
-
link
void link(@Nullable android.app.Activity activity, @Nullable android.os.Bundle options, @Nullable KiiSocialCallBack callback)
Link current login user to specified social network. For details, please see documents of subclass.- Parameters:
activity
- which invokes this procedure.options
- defined by each social network.callback
- notifies event asynchronously.- See Also:
KiiFacebookConnect.link(Activity, Bundle, KiiSocialCallBack)
,KiiTwitterConnect.link(Activity, Bundle, KiiSocialCallBack)
,KiiQQConnect.link(Activity, Bundle, KiiSocialCallBack)
-
unlink
void unlink(@Nullable android.app.Activity activity, @Nullable android.os.Bundle options, @Nullable KiiSocialCallBack callback)
Unlink current login user from specified social network. For details, please see documents of subclass.- Parameters:
activity
- which invokes this procedure.options
- defined by each social network.callback
- notifies event asynchronously.- See Also:
KiiFacebookConnect.unlink(Activity, Bundle, KiiSocialCallBack)
,KiiTwitterConnect.unlink(Activity, Bundle, KiiSocialCallBack)
,KiiQQConnect.unlink(Activity, Bundle, KiiSocialCallBack)
-
getAccessTokenBundle
@Nullable android.os.Bundle getAccessTokenBundle()
Return the access tokens in a bundle for specified social network.
Details of bundle key-values are described in sub classes.- Returns:
- Access token bundle. null when not logged in or linked with social network.
- See Also:
KiiFacebookConnect.getAccessTokenBundle()
,KiiTwitterConnect.getAccessTokenBundle()
,KiiQQConnect.getAccessTokenBundle()
-
-