spotify / android-sdk

Spotify SDK for Android
https://developer.spotify.com/documentation/android/
Apache License 2.0
454 stars 117 forks source link

Android SDK Auth Window Not Showing up #356

Open vivianofsouza opened 5 months ago

vivianofsouza commented 5 months ago

Issue found on 2/3/2024.

SDK Version: 0.8.0

OS Version: Android API 34 (Using an Android Emulator)

Scope(s): app-remote-control

Steps to reproduce:

  1. I followed the instructions from here, in order to import the app-remote-lib and set up authentication to Spotify Remote
  2. However, I'm not able to authenticate my app with the app-remote. I followed the code in this link. I put this in my MainActivity.java of my React app: `protected void onStart() { ConnectionParams connectionParams = new ConnectionParams.Builder(CLIENT_ID) .setRedirectUri(REDIRECT_URI) .showAuthView(true) .build();

    SpotifyAppRemote.connect(this, connectionParams,
        new Connector.ConnectionListener() {
    
          @Override
          public void onConnected(SpotifyAppRemote spotifyAppRemote) {
            mSpotifyAppRemote = spotifyAppRemote;
            Log.d("MainActivity", "Connected! Yay!");
            // Now you can start interacting with App Remote
            connected();
          }
    
          @Override
          public void onFailure(Throwable throwable) {
            Log.e("MainActivity", throwable.getMessage(), throwable);
            // Something went wrong when attempting to connect! Handle errors here
          }
        });`

    But when I open my app, nothing appears and in my logs I keep getting this error: {"message":"Explicit user authorization is required to use Spotify. The user has to complete the auth-flow to allow the app to use Spotify on their behalf"}

I have Spotify installed on the emulator and am logged-in on that. I am also using the Web API SDK in other parts of the React project. so I added the scope 'app-remote-control' to the part where I request authentication and access for the Web API SDK. When I did that, I saw a pop-up screen that asked me to agree to the new scopes, but the app-remote still displayed the same message.

Any help would be much appreciated! Thanks in advance!

Expected behaviour:

To be able to authenticate to spotify remote and use the Spotify Remote Player.

Actual behaviour:

Getting error that Explicit user auth is required, no auth window shows up.

goodluck3301 commented 4 months ago

You must fill in these fields

image