brim-borium/spotify_sdk

Spotify Interaction

Closed this issue · 9 comments

Describe the bug
Example codes can't interact with spotify.
(Spotify is installed on the device)

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'get auth token' button
  2. Sign in
  3. See [error])

Desktop:

  • OS: Windows 10
  • Build gradle version: 3.5.4

Smartphone:

  • Device: Xiaomi Mi Mix 2
  • OS: Android 9

Additional context
Also connectToSpotifyRemote method doesn't work.

Error: 🐛 CouldNotFindSpotifyApp : The Spotify app is not installed on the device

Screenshots:
Screenshot_2020-10-31-20-17-30-002_de minimalme spotify_sdk_example
Ekran Alıntısı

Did you try to setup your own client id and redirect url?

Yes I tried but I'm not sure of my url

Redirect url: "https://accounts.spotify.com/authorize"

@Guennx that is definitely wrong. Follow the guide here

I got auth token by changing my redirect url but I'm still getting "🐛 CouldNotFindSpotifyApp : The Spotify app is not installed on the device" error.

So I tried this with the current master checked out and it worked on my side.

Quick question:
For the example code to work you have to add your client id and redirect url from the app the you created on https://developer.spotify.com/dashboard/applications. I guess you already did that.

In this app you created in the spotify dashboard, did you add the Android package and sha1 as shown in the video?

spotify_dashboard

If not you have to add the package displayed in the video and create a local sha1 on your local machine like in the second video
package: de.minimalme.spotify_sdk_example

create_local_sha1

Thanks for replying,

I found that the problem was caused by me using a different spotify version, the api works great but I guess it doesn't support all of the spotify methods below. Do you plan to publish a new update on these methods?

Ekran Alıntısı2

@Guennx can you elaborate on different spotify version?

The image you posted shows the categories of the WEB API endpoints. Not all those are exposed to the native iOS and Android SDKs. You can see the readme file for an overview of what is is supported. Is there anything specific that you are missing?

I was using "spotify premium apk" on my test device (unofficial version). I didn't think the problem was caused by this.

I want to search music and playlist, is this possible?

For searching you need to use with the Spotify Web API. It has nothing to do with the "Remote SDK". Having said that, you can use the access token you are getting from this library and use it on the web API calls, so you don't have to care about authentication.
This plugin might help you with the API calls. Otherwise you have to implement them yourself which is not that complicated.