Please provide the following:
- SDK Version: 38
- Platforms(Android/iOS/web/all): all
Hopefully someone has already looked into this and can help me to incorporate Strava oauth. What should happen is that the user clicks on the connect with strava button and should be redirected to myApp after authorizing the app. However, strava says the redirectURL is invalid for the first 2 options (because it is a string that contains an expo URL even though it is a standalone managed workflow app). The third option with myApp is valid, but does not redirect the user back to the app or anything at all. The fourth option is valid, but the user is redirected to the website, which is of course not the goal.
const StravaAuth = (buttonProps: any) => {
const { navigate } = useNavigation()
const [request, response, promptAsync] = useAuthRequest(
{
clientId: STRAVA_CLIENT_ID.toString(),
scopes: ['read'],
// For usage in managed apps using the proxy
redirectUri: isMobile() ? makeRedirectUri({
// For usage in bare and standalone
native: 'veganfollowing://redirect',
useProxy: false
}) : 'https://veganfollowing.com/stravaAuth' // 'http://localhost:19006/stravaAuth'
},
discovery
)
React.useEffect(() => {
if (response?.type === 'success') {
const { code } = response.params
navigate('StravaAuth', {code})
}
}, [response])
return <AppButton
type='strava'
buttonStyle={{
backgroundColor: '#FC6100'
}}
height={40}
fontSize={16}
{...buttonProps}
onPress={() => promptAsync()}/>
}
export default StravaAuth