expo: [expo-auth-session] redirect URI doesn't work on iOS (spotify api)
🐛 Bug Report
Summary of Issue
I’m using expo-auth-session to connect to spotify, this works in the expo app but when I release to testflight, the redirect uri is not valid (illegal uri).
Reproducible Demo
I followed the spotify demo on the expo documentation site. The app names ‘com.company.app’ etc are correctly added in the developer panel of spotify.
My auth code looks like this:
const [request, response, promptAsync] = useAuthRequest(
{
clientId: "{id}",
scopes: [
"user-read-email",
"user-read-playback-state",
"user-modify-playback-state",
"playlist-modify-public",
],
// 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: makeRedirectUri({
// For usage in bare and standalone
native: Platform.select({
android: `be.{company}.{app}//redirect`,
ios: `be.{company}.{app}//redirect`,
}),
}),
},
discovery
);
Steps to Reproduce
use the code above, connect to spotify.
Expected Behavior vs Actual Behavior
In the expo app it will work, however, once you deploy to testflight or wherever. It will crash and return ‘illegal url’
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (1 by maintainers)
so probably my issue was that I used com.domain.name//redirect instead of name//redirect. Should work now
We have this working in production. Only real difference is that we use: