spotify / android-sdk

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

What is the correct "authorize"? url #326

Open levino opened 2 years ago

levino commented 2 years ago

By some digging and reverse engineering I found out that in order to start a (standard) oauth code flow on ios I have to open spotify-action://authorize?response_type=code&client_id=XXX&scope=user-read-email&redirect_uri=XXX on iOS. I can then handle the callback nicely in my app and retrieve the code. This url does not work however on Android. I tried spotify://authorize?response_type=code&client_id=XXX&scope=user-read-email&redirect_uri=XXX and spotify-sdk://authorize?response_type=code&client_id=XXX&scope=user-read-email&redirect_uri=XXX without success. If I use https://accounts.spotify.com/authorize?response_type=code&client_id=XXX&scope=user-read-email&redirect_uri=XXX the web browser is opened, which is not what I want. I want the (installed, I can check that) spotify app to be opened and handle the request. What is the correct URL to open the spotify app?

To be honest I am a little frustrated that this information (also the iOS URL) is kind of obscured somewhere within the iOS and Android SDK, which makes very little sense to me. Please provide this information plainly in the docs.

neuronandchords commented 1 year ago

Hey @levino thanks for the iOS link, it has been a saviour! Any luck on getting an android link to open the app?

levino commented 1 year ago

Sorry @neuronandchords for the late reply. I am no longer working on the project with that codebase and I cannot remember if and if then how I achieved this. Since I did not come back to this, probably I did not succeed.

sashok1337 commented 5 months ago

For Android, you will need the following: intent://accounts.spotify.com/inapp-authorize?YOUR_PARAMS#Intent;package=com.spotify.music;scheme=https;end