I have an app that launches a branded web page with Stripe integration to process credit card charges. We have to do this on a separate web page vs in-app for reasons that don't matter to this question.
I am using deep links via setting a URL Scheme
under URL Types
in info.plist. When the user taps a button Safari is launched with the appropriate link via: UIApplication.shared.open(URL(string:billAddress)!, options: [:], completionHandler: nil)
The web page is successfully launched in a separate instance of Safari. Once the user processes their CC a deep links from the web site is called. The process to return to the app does work; however, the flow is not optimal. The issues are:
1/ Safari shows a dialog box asking the user if they want to "Open this page in [app name]". If they say "Open" they are taken back to the app. It would best though if after they process their card, the link takes them back to the app automatically and does not show this dialog box. They will always come to this web page via the app so I am not looking for it to launch the app, download the app, etc. Just return cleanly.
2/ Once back in the app there is a "Return to Safari" button placed in the upper left of the screen that remains there the entire length of their continued app usage. There is no reason for them to ever return to Safari in this context and so we don't want this navigation there.
I did try to use an SFSafariViewController
but Stripe Check Out does not allow this. It produces an error in the web view about not being able to process and to try a different browser. Some Google searching seems to indicate that custom web views (such as I guess this would be) won't work. Therefore, launch Safari as above is the only way.
I know there is a concept of Universal Links that Apple has. It is not clear whether that approach will solve the problem. I am not looking to go to the app store, launch the app, etc. If there is some confirmation that Universal Links would solve this problem then fine but I am not sure it will. The link I have works just with artifacts that detract from the user experience.
Thoughts on how #1 & #2 above can be solved?