Use hidden SFSafariViewController to get Safari cookies

喜你入骨 提交于 2019-12-09 13:29:27

问题


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


回答1:


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.




回答2:


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.




回答3:


You can give the sample code here a try: https://github.com/mackuba/SafariAutoLoginTest



来源:https://stackoverflow.com/questions/35714967/use-hidden-sfsafariviewcontroller-to-get-safari-cookies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!