SFAuthenticationSession示例使用iOS 11获取Safari Cookie

想要在 iOS 11 中使用SFAuthenticationSession从 Safari 获取 cookie?这个资源正好能满足你的需求。它了一个 Python Flask Web 服务,用于创建和返回 cookie,配合SFAuthenticationSession API,从你的 iOS 应用中获取 cookie。这里面涉及的东西不复杂,但你需要了解一点 Xcode 和命令行的基本操作。最重要的一点是,SFAuthenticationSession目前似乎不能好地会话 cookie,这会影响到某些场景。不过,整体来说,这个资源的结构和使用方式挺简单直观的,适合用来快速实现 cookie 获取功能。如果你是前端开发者,想尝试一下与后端通信、管理 cookie 的操作,这个资源不错。

不过,记得在模拟器上使用Xcode 9来跑这个 demo,同时启动 Flask 服务器。整体操作起来还蛮顺畅的,尤其适合有一点基础的开发者。没有太多 Python 经验也没问题,重要的是理解如何将前端和后端连接起来。

zip
SFAuthenticationSession-example-master.zip 预估大小:17个文件
folder
SFAuthenticationSession-example-master 文件夹
file
.gitignore 77B
folder
SFAuthenticationSessionExample 文件夹
folder
SFAuthenticationSessionExample 文件夹
file
AppDelegate.swift 2KB
folder
Base.lproj 文件夹
file
Main.storyboard 5KB
file
LaunchScreen.storyboard 2KB
folder
Assets.xcassets 文件夹
folder
AppIcon.appiconset 文件夹
file
Contents.json 1KB
file
Info.plist 2KB
file
ViewController.swift 2KB
folder
SFAuthenticationSessionExample.xcodeproj 文件夹
folder
project.xcworkspace 文件夹
file
contents.xcworkspacedata 175B
folder
xcuserdata 文件夹
folder
davidhopkins.xcuserdatad 文件夹
file
UserInterfaceState.xcuserstate 26KB
file
project.pbxproj 12KB
folder
xcuserdata 文件夹
folder
davidhopkins.xcuserdatad 文件夹
folder
xcschemes 文件夹
file
SFAuthenticationSessionExample.xcscheme 3KB
file
xcschememanagement.plist 502B
folder
xcdebugger 文件夹
file
Breakpoints_v2.xcbkptlist 91B
file
README.md 3KB
folder
server 文件夹
file
app.py 3KB
file
requirements.txt 31B
file
screenshot.png 70KB
zip 文件大小:97.67KB