- SDK Version: 34.0.0
- Platforms(Android/iOS/web/all): Android + ios
When calling this function, I manage to get my auth token, but I get this warning : Attempted to call AuthSession.startAsync multiple times while already active. Only one AuthSession can be active at any given time.
initConnection = async () => {
const url = getLoginUrl();
console.log("initConnection URL", url);
const result = await AuthSession.startAsync({
authUrl: url,
});
if (result.type !== 'success') {
console.log("RESULT TYPE WTF ");
return null;
}
try {
await AsyncStorage.setItem(AuthToken, result.params.code);
} catch (error) {
// Error retrieving data
console.log(error.message);
}
let gettoken = '';
try {
gettoken = await AsyncStorage.getItem(AuthToken) || 'none';
} catch (error) {
// Error retrieving data
console.log(error.message);
}
}