Android SDK Auth Window Not Showing up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Plan
Premium
Country
United States
Device
Pixel 4a, Android Emulator
Operating System
Android
My Question or Issue
I've been trying to use the Getting Started with Android SDK article from Spotify to set up Remote Playback in my React Native Android App. I am currently using it on Android Emulator.
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!
- Labels:
-
"spotify"
-
Android
-
android-sdk
-
spotify-android
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page