-
public interface SnapLoginPublic API interface for the Login Kit.
-
-
Method Summary
Modifier and Type Method Description abstract StringgetVersion()Returns the version of the Login Kit. abstract ViewgetButton(@NonNull() ViewGroup container)Method to get a standard "login" button to authenticate using Snapchat. abstract ViewgetButton(@NonNull() ViewGroup container, @NonNull() LoginFeatureOptions options)Method to get a standard "login" button to authenticate using Snapchat. abstract voidstartTokenGrant(@NonNull() LoginResultCallback callback)The first step of the OAuth Flow to authenticate with Snapchat. abstract voidstartTokenGrant(@NonNull() LoginResultCallback callback, @NonNull() LoginFeatureOptions options)The first step of the OAuth Flow to authenticate with Snapchat. abstract voidaddLoginStateCallback(@NonNull() LoginStateCallback callback)Method to add a callback to receive updates to the user's login status. abstract voidremoveLoginStateCallback(@NonNull() LoginStateCallback callback)Method to remove the callback to stop receiving updates to the user's login status. abstract voidfetchAccessToken(@NonNull() AccessTokenResultCallback callback)Fetches the access token for the current user. abstract voidclearToken()Clears the local access token and refresh token, if it exists. abstract booleanisUserLoggedIn()Getter to know if the user is authenticated using Snapchat and has a valid auth token. abstract voidfetchUserData(@NonNull() UserDataQuery query, @NonNull() UserDataResultCallback callback)Fetches the user data based on scopes requested. abstract voidstartFirebaseTokenGrant(@NonNull() FirebaseCustomTokenResultCallback callback)The first step of the OAuth Flow to authenticate with Firebase usingCustom Authentication System. -
-
Method Detail
-
getVersion
@NonNull() abstract String getVersion()
Returns the version of the Login Kit.
-
getButton
@NonNull() abstract View getButton(@NonNull() ViewGroup container)
Method to get a standard "login" button to authenticate using Snapchat. (Optional)Alternatively, you can use startTokenGrant ()} directly to start authenticating.
- Parameters:
container- The root container to inflate and attach the login button to.
-
getButton
@NonNull() abstract View getButton(@NonNull() ViewGroup container, @NonNull() LoginFeatureOptions options)
Method to get a standard "login" button to authenticate using Snapchat. (Optional)Alternatively, you can use startTokenGrant directlyto start authenticating.
- Parameters:
container- The root container to inflate and attach the login button to.options- The flags to be included in the Snapchat login request(triggered when the returned button is pressed).
-
startTokenGrant
abstract void startTokenGrant(@NonNull() LoginResultCallback callback)
The first step of the OAuth Flow to authenticate with Snapchat.
- Parameters:
callback- The listener callback to receive the login result updates.
-
startTokenGrant
abstract void startTokenGrant(@NonNull() LoginResultCallback callback, @NonNull() LoginFeatureOptions options)
The first step of the OAuth Flow to authenticate with Snapchat.
- Parameters:
callback- The listener callback to receive the login result updates.options- The flags to be included in the Snapchat login request.
-
addLoginStateCallback
abstract void addLoginStateCallback(@NonNull() LoginStateCallback callback)
Method to add a callback to receive updates to the user's login status.
- Parameters:
callback- The listener callback to receive the login state updates.
-
removeLoginStateCallback
abstract void removeLoginStateCallback(@NonNull() LoginStateCallback callback)
Method to remove the callback to stop receiving updates to the user's login status.
- Parameters:
callback- The listener callback currently receiving the login state updates.
-
fetchAccessToken
abstract void fetchAccessToken(@NonNull() AccessTokenResultCallback callback)
Fetches the access token for the current user.
- Parameters:
callback- The callback for the resulting access token or error message.
-
clearToken
abstract void clearToken()
Clears the local access token and refresh token, if it exists.If the token exists, and is cleared locally, then the user will be logged out and notified accordingly viathe onLogout callback.
-
isUserLoggedIn
abstract boolean isUserLoggedIn()
Getter to know if the user is authenticated using Snapchat and has a valid auth token.
-
fetchUserData
abstract void fetchUserData(@NonNull() UserDataQuery query, @NonNull() UserDataResultCallback callback)
Fetches the user data based on scopes requested.
- Parameters:
query- The query to make.callback- The listener callback to receive the user data updates.
-
startFirebaseTokenGrant
abstract void startFirebaseTokenGrant(@NonNull() FirebaseCustomTokenResultCallback callback)
The first step of the OAuth Flow to authenticate with Firebase usingCustom Authentication System.
- Parameters:
callback- The listener callback to receive the custom token updates.
-
-
-
-