Package com.spotify.sdk.android.auth.app
Class SpotifyNativeAuthUtil
java.lang.Object
com.spotify.sdk.android.auth.app.SpotifyNativeAuthUtil
-
Constructor Summary
ConstructorsConstructorDescriptionSpotifyNativeAuthUtil(Activity contextActivity, AuthorizationRequest request, com.spotify.sdk.android.auth.app.Sha1HashUtil sha1HashUtil) -
Method Summary
Modifier and TypeMethodDescriptionstatic IntentcreateAuthActivityIntent(Context context) Creates an intent that will launch the auth flow on the currently installed Spotify applicationstatic intgetSpotifyAppVersionCode(Context context) Get the version code of the installed Spotify appstatic booleanisSpotifyInstalled(Context context) Check if a version of the Spotify main application is installedstatic booleanisSpotifyVersionAtLeast(Context context, int minVersionCode) Check if Spotify app version meets minimum requirementbooleanvoid
-
Constructor Details
-
SpotifyNativeAuthUtil
public SpotifyNativeAuthUtil(@NonNull Activity contextActivity, @NonNull AuthorizationRequest request, @NonNull com.spotify.sdk.android.auth.app.Sha1HashUtil sha1HashUtil)
-
-
Method Details
-
startAuthActivity
public boolean startAuthActivity() -
createAuthActivityIntent
Creates an intent that will launch the auth flow on the currently installed Spotify application- Parameters:
context- The context of the caller- Returns:
- The auth Intent or null if the Spotify application couldn't be found
-
isSpotifyInstalled
Check if a version of the Spotify main application is installed- Parameters:
context- The context of the caller, used to check if the app is installed- Returns:
- True if a Spotify app is installed, false otherwise
-
getSpotifyAppVersionCode
Get the version code of the installed Spotify app- Parameters:
context- The context of the caller, used to check package info- Returns:
- Version code of Spotify app, or -1 if not installed or signature validation fails
-
isSpotifyVersionAtLeast
Check if Spotify app version meets minimum requirement- Parameters:
context- The context of the caller, used to check package infominVersionCode- Minimum required version code- Returns:
- true if installed
version >= minVersionCode, false otherwise
-
stopAuthActivity
public void stopAuthActivity()
-