Class SpotifyNativeAuthUtil

java.lang.Object
com.spotify.sdk.android.auth.app.SpotifyNativeAuthUtil

public class SpotifyNativeAuthUtil extends Object
  • 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

      @Nullable public static Intent createAuthActivityIntent(@NonNull Context context)
      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

      public static boolean isSpotifyInstalled(@NonNull Context context)
      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

      public static int getSpotifyAppVersionCode(@NonNull Context context)
      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

      public static boolean isSpotifyVersionAtLeast(@NonNull Context context, int minVersionCode)
      Check if Spotify app version meets minimum requirement
      Parameters:
      context - The context of the caller, used to check package info
      minVersionCode - Minimum required version code
      Returns:
      true if installed version >= minVersionCode, false otherwise
    • stopAuthActivity

      public void stopAuthActivity()