brim-borium/spotify_sdk

Unable to add into Queue

irfan-429 opened this issue · 12 comments

I'm trying to add tracks in the queue but it always gives an error.

Steps to reproduce the behavior:

Future<void> queue(String spotifyUri) async {
  try {
    await SpotifySdk.queue(spotifyUri: '$spotifyUri');
  } on PlatformException catch (e) {
    setStatus(e.code, message: e.details);
  } on MissingPluginException {
    setStatus('not implemented');
  }
}

Exception throwing

queueTrack failed with: error when adding uri: spotify:track:5tyMJlMqaggzvuX7TtlrTe to queue
com.spotify.protocol.client.error.RemoteClientException: {"message":"Cannot queue specified uri: [CANT_PLAY_ON_DEMAND]"}

Additional Details
I'm already connect with Spotify.

@brim-borium - Can you pls have a look into? Your help would be appreciated.

@irfan-429 I have tested this track on my project with both queue and play functions and it is working fine. Maybe, its some error with your spotify app or any kind of restriction as it says Can't play on Demand. Have you tested some other tracks with the same ?

Yeah, I tried with many tracks. If I play individual track by passing it to play function it works. If I do same with queue it gives above error. If there is a problem with my connection then the individual play track should also not work. What do you think?

Are you using latest package/spotify app/.aar files ?
If not then try after updating

I'm using the latest but still same issue.

@brim-borium - Did you get any chance to look into my issue please because only the plugin creator can know much about the error.

@irfan-429 are you using a free or Premium Spotify account?

I'm using a free one.

Seems very similar to this. Please try with a Premium account and report back.

This isn't a solid solution. Every end user couldn't have a premium spotify account.
If this package requires premium account then what is the purpose of the package to add songs in queue?
Why a person will use our app made by the help of this package if he requires a premium account.
Not understandable solution!

@irfan-429 you do realize that we are not Spotify, right? This package can only do whatever the native SDK does. If this is a limitation of the native SDK there is nothing we can do. In that case you better open an issue on the native SDK repo.

Free accounts are not allowed to add tracks to the queue. Even the Spotify app works this way. Closing and please make sure you do some research before opening an issue.