【发布时间】:2016-06-17 00:41:27
【问题描述】:
我正在使用以下块允许我的应用程序的用户使用 Instagram 进行授权:
func authorizeInstagram() {
let myWebView:UIWebView = UIWebView(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height))
myWebView.delegate = self
myWebView.loadRequest(NSURLRequest(URL: NSURL(string: "https://instagram.com/oauth/authorize/?client_id=xxxxxxxxxxxxxxxxxx&redirect_uri=xxxxxxxxxxx/&response_type=token")!))
self.view.addSubview(myWebView)
}
我的问题是,一旦用户完成身份验证,如何从 webview NSURL 请求中获取响应 JSON?
【问题讨论】:
-
如何获取代码以便将其用于响应令牌 URL?我现在有点困惑你得到你的解决方案了吗? Reference
标签: ios swift uiwebview nsurlrequest