xrxrxrx
xrxrxrx

Reputation: 107

How do I avoid the "Open this page in 'appName'" alert from appearing in Safari for iOS?

I am creating a flow that: 1) takes the user from my iOS app to my website through Safari 2) and then navigates back into the app via javascript

However when I try and redirect the user back to my app from my site using url schemes, i get the familiar "Open this page in 'appName'" alert. Is there a way to avoid this alert from showing up? Is there some way to whitelist my website as a source for my app to allow me to direct the user back to my app w/out any alerts?

It seems like it might be possible with Universal Links, but I am wondering if there is a simpler way to do so.

EDIT: I should have mentioned that I have the unique requirement that I need to use Safari. I am processing donations in my app, and Apple requires you to go this through Safari and not a webview. Any ideas? –

Upvotes: 0

Views: 458

Answers (1)

Rohit Pradhan
Rohit Pradhan

Reputation: 3875

  • You can achieve this using webView instead of Safari,so that control will not go out of the App.
  • Now the problem is how to get the click from webView, for that you can use this approach How to invoke Objective C method from Javascript and send back data to Javascript in iOS?
  • I have integrated this approach in my App so this approach will work for sure. It feels like you are in APP & some times it will diificult to differentiate between WebPage & native page

Upvotes: 1

Related Questions