3

I am working on a stuff which requires the data to be shared between the SafariViewController and native ios interface. I know how to do it in the UIWebView but here there is some complication to understand how to do it using the SFSafariViewController.

If anyone has tried this stuff, please do let me know. In mean time if i find something relevant will share back.

Akhilesh Sharma
  • 1,580
  • 1
  • 17
  • 29

1 Answers1

1

Due to the sandboxed nature of the SFSafariViewController there is only one way to do this - Custom URL Schemes.


How it works is the webpage loaded in the SFSafariViewController should redirect the user to a custom url scheme with whatever data you want appended, like an API e.g. com.myApp://name=bob.

This means that the only websites you can get data from are websites which you create, unfortunately.

See here for more.

Hope this helps,

Liam

Liam Ferris
  • 1,786
  • 2
  • 18
  • 38
  • Liam, Custom URL schemes are no longer a supported in iOS9, you can still use it but as per the apple documentation you should not be using it. – Akhilesh Sharma Mar 28 '16 at 16:09
  • Thanks for sharing, I did not know this. Pretty disappointing to see that feature go. Also I don't of any other way to achieve what you want without it. – Liam Ferris Mar 28 '16 at 21:22
  • They do support it but limited the support by deprecating few methods. But anyways thanks for looking into this. – Akhilesh Sharma Mar 29 '16 at 13:04
  • You can use universal links which are much more secure than URL Scheme – Zorayr Apr 22 '16 at 05:18