spotify / android-sdk

Spotify SDK for Android
https://developer.spotify.com/documentation/android/
Apache License 2.0
464 stars 119 forks source link

unable to login with spotify (integration) on live app #185

Closed gurpreetorem closed 4 years ago

gurpreetorem commented 4 years ago

am using spotify in my app its working fine with am testing it locally but when i submi it to play store then i try to get access token but its showing error that invalid client id one more this if i delete the spotify app from my device the i try to get the access token then its working fine but when i install the spotify app then try to get the access token then its showing error

am not able to get the problem

joseandroidengineer commented 4 years ago

I get the same issue when testing on an Android device in debug mode

gurpreetorem commented 4 years ago

@joseandroidengineer yes i tested it with both debug and live with release build its working fine but when i upload it to play store then i try to use it's showing error do you find any solution for it?

joseandroidengineer commented 4 years ago

@gurpreetorem Nothing yet, oh are you using your release fingerprint when you release to the playstore?

gurpreetorem commented 4 years ago

@joseandroidengineer yes am using my release fingerprints so if sdk support team not answering then how we can use such things ? "3rd class sdk support team"

joseandroidengineer commented 4 years ago

@gurpreetorem I'm sure they have more pressing issues right now. I'm confident they'll get back to us in no time.

paicolman commented 4 years ago

@gurpreetorem Short question: You get "invalid client id" or "invalid app id" error? I think it can be two different errors...

joseandroidengineer commented 4 years ago

@paicolman In regular Android devices I get invalid client id, but in Amazon devices (Specifically FireTV) I get a Spotify App not found error.

gurpreetorem commented 4 years ago

@paicolman Hi AccountsPrefligtRequest failed with status code: 400 2020-01-15 18:35:26.832 17297-17297/? E/Spotify: [main] INVALID_APP_ID

i got this response let me clear you the things if spotify app is installed then it will not work then its showing this error but if i uninstall the spotify app then i try to use spotify with in my app then its working fine

joseandroidengineer commented 4 years ago

@gurpreetorem Thats weird... are you using the Web Api login feature or the app-remote SDK to log in?

paicolman commented 4 years ago

@gurpreetorem Yes, thats very similar to my problem mentioned in this issue (which you know already). With uninstalled app I get the token, but it's worthless since I cannot play music, and with the app installed I get the same error...

gurpreetorem commented 4 years ago

@joseandroidengineer am using web api https://api.spotify.com/v1

mdelolmo commented 4 years ago

@gurpreetorem Judging by what you are saying, it sounds like you added the APK SHA1 fingerprint of your debug configuration but not the SHA1 fingerprint of your publish configuration. In this article, they explain the different types of keys and how they are used in Android.

gurpreetorem commented 4 years ago

@mdelolmo already added both SHA1 fingerprint

mdelolmo commented 4 years ago

@gurpreetorem Are you using your upload key signature or your publish key signature?

appsigning_googleplayappsigningdiagram_2x

gurpreetorem commented 4 years ago

@mdelolmo i just create a SHA1 key with me jks file then i upload it to spotify developer account and its same with the play store

mdelolmo commented 4 years ago

@gurpreetorem Yes, but there is an upload key and an "app signing key". The latter is the one with which the apk is ultimately published, and it's the one you should add to Spotify's developer centre. Am I explaining myself? Is that the case?

gurpreetorem commented 4 years ago

@mdelolmo so where i can get that key which i need to upload to spotify developer center?

gurpreetorem commented 4 years ago

@mdelolmo Thanks man its working i just copy SHA1 key from play store and add to spotify developer center and start the app again and its working fine Thanks alot man.......... :)

mdelolmo commented 4 years ago

Glad it worked @gurpreetorem !

paicolman commented 4 years ago

@gurpreetorem I solved my problem with @mdelolmo help, but I am still stuck when I want to continue debugging. My local version will have another signature than the one in Google Play Console, so the only way to develop is to upload every version and I loose debugging capabilities. Maybe you have some tips?

gurpreetorem commented 4 years ago

@paicolman i have used all three SHA1 like this 1st one is for debug 2nd one is from signed key 3rd one is from play store Screenshot_1

paicolman commented 4 years ago

@gurpreetorem Thanks! Tried that, but no luck... Some questions (sorry To bother you so much, you might be the only one able to help me...) same package name? The debug one is generated with the standard android studio key, right? and the second one with upload key? Maybe the order of appearance is important, I have the debug one last and the playstore first...

mdelolmo commented 4 years ago

Hi @paicolman The order should not matter, but maybe I would start by creating a different package name for your debug builds and upload its key signature, so you'd have two entries in the developer console.

But, like @gurpreetorem pointed out you may have up to three entries, one for debug, one for play-store key and one for the upload key.

I understand this APK keys setup is a little bit confusing, so I would also encourage you to go through the following article from the official Android documentation. It will help you understand all types of keys and how to generate them: https://developer.android.com/studio/publish/app-signing

gurpreetorem commented 4 years ago

@paicolman just add your debug sha1 key for local test and play store sha1 key for live app one more thing ion play store will can see there are 2 sha1 keys you have to use the second one in the bottom if you can see