OAuth callbacks in iPhone web apps
I've had a similar problem recently, and found that if you set the URL in Javascript with a window.location.href="http://example.com/whatever"
then iOS doesn't switch to Safari. I've managed to get PayPal checkout and Facebook login working in standalone web apps without switching to safari using this method! If you're submitting a form, do that via JS too and get the redirect URL from the response then set the location. As for handing back to your app afterwards, it depends on how the external service works.
If that's no good, you could do a pop-up alert('You will be passed to Safari for authentication. Reload this app afterwards.')
before they get switched to Safari. Not great, but better than surprising them with automatically switching apps!
I´m assuming that you have a "manifest" meta tag to reference manifest.json file.
I suggest you to do the following workaround. It works perfect on ios safari web app:
https://stackoverflow.com/a/52286655/8390589