SFSafariViewController redirect not working

I'm trying to use SFSafariViewController to present a form that the user needs to fill out. On the form, there is a "back" button, which fires a url scheme which opens the app. The problem is that the

application:openURL:options:
method doesn't get called when the url scheme is fired by the web page opened in SFSafariViewController. When I was using Safari to open the form instead of the SFSafariViewController, the scheme worked, and the
application:openURL:options:
method was called.


Any ideas why the scheme is not working with SFSafariViewController and how to fix it?

It's possibly because your app is already considered as running so can't be opened again. You could test this theory by opening the form in another app (if possible) and see if the back button opens your original app. One way to test this would be to temporarily change the bundle id of your app and remove the URL scheme so that you are effectively running a different app. Alternatively, if you are able to change the web form (without affecting live users), temporarily alter the URL scheme that the back button tries to open to see if you are able to successfully launch a different app that you have installed.

It should be possible to navigate back to the app from SFSafariViewController using a URL scheme, because it was described in Apple's WWDC presentation on SFSafariViewController. Also, there are other apps already using it (see here: https://library.launchkit.io/how-ios-9-s-safari-view-controller-could-completely-change-your-app-s-onboarding-experience-2bcf2305137f).

SFSafariViewController redirect not working
 
 
Q