Package 

Interface SnapLogin


  • public interface SnapLogin
    
                        

    Public API interface for the Login Kit.

    • Method Detail

      • 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.
      • 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.