Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use hidden SFSafariViewController to get Safari cookies

I was reading the following post on authenticating users from mobile web pages to native iOS 9 apps and was wondering how to best implement a hidden safari view controller similar to the hidden controller talked about below?

https://library.launchkit.io/how-ios-9-s-safari-view-controller-could-completely-change-your-app-s-onboarding-experience-2bcf2305137f#.r810oldla

like image 355
locoboy Avatar asked Dec 11 '22 18:12

locoboy


2 Answers

Don't use this approach if you're going to distribute your app to the AppStore, because according to updated App Store Review Guidelines:

5.1.1:

(iv)SafariViewContoller must be used to visibly present information to users; the controller may not be hidden or obscured by other views or layers. Additionally, an app may not use SafariViewController to track users without their knowledge and consent.

like image 78
Liubo Avatar answered Jan 09 '23 09:01

Liubo


This has changed in iOS 11. Going forward, every app (including Safari itself) will have a completely sandboxed data store. Official announcement here (at the 17:28 mark).

Long live the invisible SFSafariViewController. iOS 9 to iOS 10.

If you need a way to pass a guaranteed user match through from Safari to your app, you'll need to use an existing network of device matches, such as Branch.io (full disclosure: I'm on the Branch team). You can read about the techniques Branch uses instead of cookie passthrough here.

like image 39
Alex Bauer Avatar answered Jan 09 '23 10:01

Alex Bauer