Open vivianofsouza opened 9 months ago
You must fill in these fields
application package name
private val clientId = "d1125159a****************"
private val redirectUri = "https://com.spotify.tv.android.spotifysdkkotlindemo/callback"
private var spotifyAppRemote: SpotifyAppRemote? = null
val connectionParams = ConnectionParams.Builder(clientId)
.setRedirectUri(redirectUri)
.showAuthView(true)
.build()
SpotifyAppRemote.connect(requireContext(), connectionParams, object : Connector.ConnectionListener {
override fun onConnected(appRemote: SpotifyAppRemote) {
spotifyAppRemote = appRemote
Log.e("SpotifyLogs", "Connected! Yay!")
connected()
}
override fun onFailure(throwable: Throwable) {
Log.e("SpotifyLogs", throwable.message, throwable)
}
})
private fun connected() {
spotifyAppRemote?.let {
val playlistURI = "spotify:track:3gVhsZtseYtY1fMuyYq06F"
it.playerApi.play(playlistURI)
it.playerApi.subscribeToPlayerState().setEventCallback {
val track: Track = it.track
Log.d("MainActivity", track.name + " by " + track.artist.name)
}
}
}```
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:
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();
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.