public class SocialId
extends java.lang.Object
SocialId.config must be called once to initialize the SocialId SDK.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
static void |
config(android.app.Activity activity,
java.lang.String loginAppId,
java.lang.String loginAppClientSecret)
Configuration for the SocialId SDK.
|
static void |
config(android.app.Activity activity,
java.lang.String senderId,
java.lang.String loginAppId,
java.lang.String loginAppClientSecret)
Configuration for the SocialId SDK.
|
static void |
configLogin(android.app.Activity activity,
LoginEventListener loginEventListener)
Configuration for the Social Login process.
|
static void |
configLogin(android.app.Activity activity,
LoginEventListener loginEventListener,
SocialLoginConfiguration socialLoginConfiguration)
Configuration for the Social Login process.
|
static void |
configLoginProvider(SocialLoginProviderConfiguration socialLoginProviderConfiguration)
Specific configuration for the Social Login provider.
|
static void |
configLoginProviders(SocialLoginProviderConfiguration... socialLoginProviderConfigurations)
Specific configuration for the Social Login provider.
|
static void |
createUser(com.coffeebeantech.socialidapi.models.marketing.login.UserAttributes userAttributes,
SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback)
Create a new user and log him in.
|
static void |
createUser(com.coffeebeantech.socialidapi.models.marketing.login.UserAttributes userAttributes,
com.coffeebeantech.socialidapi.models.marketing.login.UserDataAttributes userDataAttributes,
SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback)
Create a new user and log him in.
|
static com.coffeebeantech.socialidapi.models.marketing.login.User |
getCurrentUser()
Get the current logged in user.
|
static void |
getCurrentUser(SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback)
Get the current logged in user.
|
static void |
getCurrentUser(SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback,
java.util.List<java.lang.String> userFields)
Get the current logged in user.
|
static void |
getCurrentUser(SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback,
java.util.List<java.lang.String> userFields,
boolean fetchUserData)
Get the current logged in user.
|
static java.lang.String |
getDeviceId()
Get the device id that identifies this device in the SocialId platform.
|
static com.coffeebeantech.socialidapi.util.Environment |
getEnvironment()
Get the current API environment.
|
static java.lang.String |
getRegistrationId()
Get the registration id obtained from GCM servers.
|
static void |
initLogin(Provider provider)
Start the login process for the given provider.
|
static void |
initLogin(Provider provider,
LoginParameters loginParameters)
Start the login process for the given provider.
|
static void |
linkDeviceToUser(SocialIdCallback<java.lang.Void> callback)
Links the current device to the current user.
|
static void |
logoutUser()
Log out the current user.
|
static void |
onActivityResult(android.app.Activity activity,
int requestCode,
int resultCode,
android.content.Intent data)
Deprecated.
|
static void |
onActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
Callback required for facebook login.
|
static void |
onRequestPermissionsResult(int requestCode,
java.lang.String[] permissions,
int[] grantResults)
Callback required for Google login on API Level 23 and higher.
|
static void |
resetUserPassword(com.coffeebeantech.socialidapi.models.marketing.login.ResetPasswordEmailAttributes resetPasswordEmailAttributes,
SocialIdCallback<java.lang.Void> callback)
Send a reset password e-mail to the user.
|
static void |
setEnvironment(com.coffeebeantech.socialidapi.util.Environment environment)
Set a new API environment.
|
public static final java.lang.String VERSION
public static void config(android.app.Activity activity, java.lang.String loginAppId, java.lang.String loginAppClientSecret)
activity
- Application's activity. This activity will be responsible for handling all push notifications.loginAppId
- Your Login App IdloginAppClientSecret
- Your Login App Client secretpublic static void config(android.app.Activity activity, java.lang.String senderId, java.lang.String loginAppId, java.lang.String loginAppClientSecret)
activity
- Application's activity. This activity will be responsible for handling all push notifications.senderId
- Your Android project IDloginAppId
- Your Login App IdloginAppClientSecret
- Your Login App Client secretpublic static void configLogin(android.app.Activity activity, LoginEventListener loginEventListener, SocialLoginConfiguration socialLoginConfiguration)
activity
- Application's activityloginEventListener
- Your Listener for social login eventssocialLoginConfiguration
- Additional configuration for social loginpublic static void configLogin(android.app.Activity activity, LoginEventListener loginEventListener)
activity
- Application's activityloginEventListener
- Your Listener for social login eventspublic static void configLoginProvider(SocialLoginProviderConfiguration socialLoginProviderConfiguration)
socialLoginProviderConfiguration
- Provider additional configurationpublic static void configLoginProviders(SocialLoginProviderConfiguration... socialLoginProviderConfigurations)
socialLoginProviderConfigurations
- Providers additional configurationpublic static void initLogin(Provider provider, LoginParameters loginParameters)
provider
- Provider that will be used for loginloginParameters
- LoginParameters for the login process.public static void initLogin(Provider provider)
provider
- Provider that will be used for loginpublic static void onActivityResult(int requestCode, int resultCode, android.content.Intent data)
onActivityResult
callback.requestCode
- onActivityResult requestCoderesultCode
- onActivityResult resultCodedata
- onActivityResult datapublic static void onRequestPermissionsResult(int requestCode, java.lang.String[] permissions, int[] grantResults)
onRequestPermissionsResult
callback.requestCode
- onRequestPermissionsResult requestCodepermissions
- onRequestPermissionsResult permissionsgrantResults
- onRequestPermissionsResult grantResults@Deprecated public static void onActivityResult(android.app.Activity activity, int requestCode, int resultCode, android.content.Intent data)
onActivityResult(int requestCode, int resultCode, Intent data)
onActivityResult
callback.activity
- The application's activityrequestCode
- onActivityResult requestCoderesultCode
- onActivityResult resultCodedata
- onActivityResult datapublic static java.lang.String getRegistrationId()
public static java.lang.String getDeviceId()
public static com.coffeebeantech.socialidapi.models.marketing.login.User getCurrentUser()
public static void getCurrentUser(SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback, java.util.List<java.lang.String> userFields, boolean fetchUserData)
userFields
- User profile fields.callback
- A SocialIdCallback that returns a User object on success.fetchUserData
- Whether to fetch the user data or not.public static void getCurrentUser(SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback, java.util.List<java.lang.String> userFields)
userFields
- User profile fields.callback
- A SocialIdCallback that returns a User object on success.public static void getCurrentUser(SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback)
callback
- A SocialIdCallback that returns a User object on success.public static void logoutUser()
public static void linkDeviceToUser(SocialIdCallback<java.lang.Void> callback)
callback
- A SocialIdCallback that returns null on success.public static void setEnvironment(com.coffeebeantech.socialidapi.util.Environment environment)
public static com.coffeebeantech.socialidapi.util.Environment getEnvironment()
public static void createUser(com.coffeebeantech.socialidapi.models.marketing.login.UserAttributes userAttributes, com.coffeebeantech.socialidapi.models.marketing.login.UserDataAttributes userDataAttributes, SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback)
userAttributes
- Attributes to create a User.userDataAttributes
- Attributes to create a User.callback
- A SocialIdCallback that returns a User object on success.public static void createUser(com.coffeebeantech.socialidapi.models.marketing.login.UserAttributes userAttributes, SocialIdCallback<com.coffeebeantech.socialidapi.models.marketing.login.User> callback)
userAttributes
- Attributes to create a User.callback
- A SocialIdCallback that returns a User object on success.public static void resetUserPassword(com.coffeebeantech.socialidapi.models.marketing.login.ResetPasswordEmailAttributes resetPasswordEmailAttributes, SocialIdCallback<java.lang.Void> callback)
resetPasswordEmailAttributes
- Attributes to reset password e-mailcallback
- A SocialIdCallback that returns null on success.