Whitelisting redirect url on Spotify's login

Hi!

I’m creating a mobile app using React Native (expo) and trying to get a user logged in using Spotify.

For the Spotify login I’m using this code that I found in expo’s authentication documentation .

I’ve inserted my Spotify’s client ID over on the code’s placeholder and replaced the “your.app” with my app’s name but I don’t really know how to proceed next - I know that I need to whitelist the redirect url over on Spotify dashboard but the link that this gives changes between devices as I’ve tested before.

makeRedirectUri({   
    native: 'your.app://redirect',
})

As I’m new to authentication I don’t know what link I need to whitelist over on Spotify’s Website or if I should be doing anything differently. I have also tried to use

makeRedirectUri({
    native: "your.app://redirect",
    useProxy: true,
})

thinking it would “uniformize” the links by using a proxy and then I would only need to whitelist the resulting url but the button crashes, outputting the following error:

Error: No default redirect URL could be found. If you’re using the bare workflow, you’ll need to provide this yourself.

It’s important to mention that we’re using Expo’s Managed Workflow and we can build the app with no issues using

expo build:android

Also as a quick last question that might be related to the question above: what is the “redirect” over at

native: “your.app://redirect”

supposed to be? Right now it’s set to be the screen I want the user to be redirected to but I think it can also be something else related to the authentication that I’m missing completely and perhaps that’s why all of this isn’t working. I also think it’s probably not the redirect screen because if I whitelist the output of

makeRedirectUri({   
    native: 'your.app://redirect',
})

the login is sucessful but the app redirects me back to the default screen.

Any help is appreciated because me and some of my colleagues have spent a lot of time trying to make this work and hopefully (and most likely too) this is an error caused by us being new to Authentication and React Native / Expo and not a problem with the source code.

Thank you in advance.

go to spotify dashboard and update settings from there.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.