viestat / react-native-spotify

A native module that allows you to use the Spotify SDK API with react-native
MIT License
108 stars 23 forks source link

Invalid Redirect URI #23

Open jordan-loeser opened 6 years ago

jordan-loeser commented 6 years ago

Hello! Thanks so much for putting together this helpful library! I am a little confused about how the redirect URI plays into a native environment. Could someone provide an example? Right now I am passing in a URI that matches that in my Spotify Developer Dashboard but I am getting an ERROR / Invalid Redirect URI message.

viestat commented 6 years ago

Hello @Jordan-Loeser ! From SDK documentation : The Redirect URI will allow the Spotify authentication service to automatically launch your app again once the user has logged in.

Note that you also need to include the Redirect URI into the URL Schemes of URL Types of your Xcode Project. Located under the info tab (see step 7 of Setting Up Your Build Environment section)

Let me know if this helps :)

jordan-loeser commented 6 years ago

@viestat Thanks for your quick response! I have set up a unique URI in Xcode, but I am still seeing the below screen after logging in on Spotify. The first time I log in and press "Log In", the screen just sits there. If I close out of the Safari window and press "Log in with Spotify" again I see this:

screen shot 2017-12-22 at 1 50 10 pm

Any ideas? I believe that the URL should be working, because if I type it in Safari it asks me if I want to open the app. Side note, I am just working in the ./examples directory from this repository with my own client id and redirect uri entered.

Thanks for your help!

viestat commented 6 years ago

Hey @Jordan-Loeser , I have tried to reproduce this error but I have not encountered the same issue. I went through the initial config again and used the example app form /examples folder.

My redirect URL is something like this: someapp://callback