I'm creating an app which need to link the user Spotify account in order to get his music library. To do so i'm using expo on react native and with it, the package "expo-auth-session"
It already got a pretty good example to manage the connection with spotify.
Unfortunately once i'm on the spotify login page, I can't get back on my app. I think the problem come from the "redirectUri" which I don't really understand how it works. I've seen that you should place there your redirection (which is usually something like https://localhost:8000/ ) but i'm working on Mobile, so there's no such things. I've seen that you should create a RedirectUri callback as well on the Spotify Dashboard but even that doesn't seems to work.
If you guys got some more informations about this it would be great !
My dev :
const endPoints = {
authorizationEndpoint: "https://accounts.spotify.com/authorize",
tokenEndpoint: "https://accounts.spotify.com/api/token",};
const [request, response, promptAsync] = useAuthRequest(
{
clientId: "My-Client-ID",
scopes: ["user-library-read"],
// In order to follow the "Authorization Code Flow" to fetch token after authorizationEndpoint
// this must be set to false
usePKCE: false,
// For usage in managed apps using the proxy
redirectUri: "exp://localhost:19000",
},
endPoints
);