I’m having issues on my iOS standalone app where AuthSession immediately returns a result.type error with errorCode: ‘cookies-disabled’. In the iPhone settings, the cookies aren’t disabled, so I’m at a loss as to what is causing this… any ideas?
Code below, as a noob, any feedback at would be appreciated!
_handlePressAsync = async () => {
let redirectUrl = AuthSession.getRedirectUrl();
let result = await AuthSession.startAsync({
authUrl:
`https://api.instagram.com/oauth/authorize/` +
`?client_id=${instaAppId}` +
`&redirect_uri=${encodeURIComponent(redirectUrl)}` +
'&response_type=code',
});
if (result.type === 'success') {
if (result.params.code) {
fetch(databaseURL, {
method: 'POST',
body: JSON.stringify({ authCode: result.params.code, uid: this.state.user.uid, redirectUrl: redirectUrl }), // data can be `string` or {object}!
headers: {
'Content-Type': 'application/json'
}
})
}
else if (result.params.error) {
Alert.alert(
'Cancelled Login',
("\'"+ result.params.error+ '\'. Please try again'),
[
{ text: 'OK' },
]
)
}
} else if (result.type === 'error'){
Alert.alert(
result.type,
result.errorCode,
[
{ text: 'OK' },
]
)
} else if (result.type === 'cancel'){
Alert.alert(
'Instagram login cancelled',
'Please try again',
[
{ text: 'OK' },
]
)
}
}