SpotifyImplicitLoginActivity

Wrapper around spotify-auth's LoginActivity that allows configuration of the authentication process, along with callbacks on successful and failed authentication. Pair this with SpotifyDefaultCredentialStore to easily store credentials. To use, you must extend from either AbstractSpotifyAppImplicitLoginActivity or AbstractSpotifyAppCompatImplicitLoginActivity

Inheritors

Properties

Link copied to clipboard
abstract val activity: Activity
Link copied to clipboard
abstract val clientId: String

Your application's Spotify client id.

Link copied to clipboard
abstract val redirectUri: String

Your application's Spotify redirect id - NOTE that this should be an android scheme (such as spotifyapp://authback) and that this must be registered in your manifest.

Link copied to clipboard
abstract val state: Int

The state to use to verify the login request.

Link copied to clipboard

Disable if you will not be using useDefaultRedirectHandler but will be setting SpotifyDefaultImplicitAuthHelper.activityBackOnImplicitAuth.

Functions

Link copied to clipboard

Return the scopes that you are going to request from the user here.

Link copied to clipboard
abstract fun onFailure(errorMessage: String)

Override this to define what to do after authentication has failed. You may want to use SpotifyDefaultCredentialStore to remove any stored token.

Link copied to clipboard
abstract fun onSuccess(spotifyApi: SpotifyImplicitGrantApi)

Override this to define what to do after authentication has been successfully completed. A valid, usable spotifyApi is provided to you. You may likely want to use SpotifyDefaultCredentialStore to store/retrieve this token.

Link copied to clipboard
open fun processActivityResult(requestCode: Int, resultCode: Int, intent: Intent?)

Processes the result of LoginActivity, invokes callbacks, then finishes.

Link copied to clipboard

Override this to define what to do after onSuccess has run. The default behavior is to finish the activity, and redirect the user back to the activity set on SpotifyDefaultCredentialStore.activityBackOnImplicitAuth only if guardValidImplicitSpotifyApi has been used or if SpotifyDefaultCredentialStore.activityBackOnImplicitAuth has been set.

Link copied to clipboard

Trigger the actual spotify-auth login activity to authenticate the user.