I have been developing a react-native application using the following module:
https://github.com/viestat/react-native-spotify
Currently, the application opens the authentication window to login to spotify. I do get a return of success but i'm confused as to how i now get rid of the window that popped up to login with. I understand it should redirect back to my application but it just stays on the same window with logout/ my account buttons.
Any ideas how i would dismiss this window on a returned success message?
SpotifyAuth.setClientID('*****','*****', ['streaming', 'playlist-read-private'], (error)=>{
if(error){
console.log(error);
} else {
console.log('success');
}
});
If you take a look at the code, the login screen (SpotifyLoginViewController
to be exact), dismisses the screen at this line of code. According to the logic here, if the redirectURL
that you've passed to the setClientID
API doesn't match to the redirect URI that you defined in your Spotify developer account (see their authorization guide) - the screen will not be dismissed.
I suggest the you put a break-point in this function before it's checking the url scheme and see what's going on there. Either your account is not configured properly, or a wrong URL (or a URL which is not at the expected format by this package) is being sent to this API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With