Answer the question
In order to leave comments, you need to log in
How to open oAuth authorization window and catch parameters from URL?
In native JS, this function works
let win = window.open('oauthURL', 'oauth', 'width=800,height=600,status=0,toolbar=0');
let timer = setInterval(function () {
try {
let path = win.location.pathname.split('/')
if (path[1] === 'oauth-success') {
clearInterval(timer)
win.close()
// SUCCESS CALLBACK
}
if (win.closed) {
clearInterval(timer)
}
return false;
} catch (e) {
// ERR CALLBACK
}
}, 1000);
Answer the question
In order to leave comments, you need to log in
This is not a bad example. https://dev.to/safaiyeh/react-native-authenticatio...
you need to use a webview to login. be sure to use https://github.com/react-native-community/react-na... and be sure to use the latest version otherwise there will be issues when publishing to the Apple Store.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question