brim-borium / spotify_sdk

Flutter Package to connect the spotify sdk
https://pub.dev/packages/spotify_sdk
Apache License 2.0
143 stars 81 forks source link

getAccessToken failing #177

Closed Sahilhawal closed 1 year ago

Sahilhawal commented 1 year ago

Is this a how to question? No

Is this a native Spotify SDK issue? No

Have you searched for existing issues? Yes

Are you using a Free or Premium Spotify account? Premium

Are you aware of the limitations of Free Spotify accounts? Yes

Expected behavior After calling the getAccessToken API, a token should be returned

Describe the bug If the Spotify app is not installed on the device and if a "getAccessToken" API call is made then the auth token is received from the API but, if the Spotify app is installed on the device and a "getAccessToken" API call is made following error gets thrown ⛔ getAccessToken failed with: Authentication went wrong ⛔ AUTHENTICATION_SERVICE_UNAVAILABLE

Spotify_sdk Flutter package version 2.3.0

Target Platform, Version & Device

Development OS

wsdt commented 1 year ago

Same issue here! Can confirm this.

Jo-Chris commented 1 year ago

Same error & reproduced it with app removal. Works fine if Spotify application is not installed.

lorenzovianello-vivaldigroup commented 1 year ago

@Sahilhawal

Solution is basically ONE. The only case in which Spotify won't let you use the app is when your application package name and SHA1 are not linked to Spotify's developer dashboard. You can easilly retrieve package name via AndroidManifest (eg. com.example.application) SHA1 is retrieved via android studio running 'gradle signingreport' via terminal in gradle folder

Then you add to your dashboard of Spotify the 2 data and its done.

Hope it helps

brim-borium commented 1 year ago

@wsdt @Jo-Chris @Sahilhawal does the proposed solution from @lorenzovianello-vivaldigroup worked for you?

fotiDim commented 1 year ago

Is this a native Spotify SDK issue? No

This is clearly a native SDK issue. If you have searched a bit you would have come up with this issue. I suggest you follow it for any suggested solutions.

I have also come across this and just switching to a different client id solved the issue for me. In the majority of the cases (if not all) the error is the result of misconfiguration. Having said that, we can't provide with this level of support here. This is between you and Spotify. The best thing you can do is create a native Android sample app or use the official example app, with your credentials, and once it works then move to the Flutter SDK.

Closing...