guardValidSpotifyApi

fun <T> Activity.guardValidSpotifyApi(spotifyLoginImplementationClass: Class<out SpotifyLoginActivity>, classBackTo: Class<out Activity>? = null, block: () -> T): T?

Basic authentication guard - verifies that the user is logged in to Spotify and uses SpotifyDefaultAuthHelper to handle re-authentication and redirection back to the activity.

Note: this should only be used for small applications.

Parameters

spotifyLoginImplementationClass

Your implementation of SpotifyLoginActivity, defining what to do on Spotify login

classBackTo

The activity to return to if re-authentication is necessary

Sources

(source)
Link copied to clipboard