开发者社区> 问答> 正文

Web视图未加载url请求和URL显示为零

我想用LinkedIn授权url加载web视图,但是在加载之前没有创建url,说明它是0,而web视图没有显示任何特定的页面。这是传递给URLRequest的url字符串。https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=&redirect_uri=&state=linkedin1575812567&scope=r_liteprofile

下面提到的是这方面的代码。

let responseType = "code"
let state = "linkedin\(Int(NSDate().timeIntervalSince1970))"

var authorizationURL = "\(authorizationEndPoint)?"
authorizationURL += "response_type=\(responseType)&"
authorizationURL += "client_id=\(linkedInConfig.linkedInKey)&"
authorizationURL += "redirect_uri=\(linkedInConfig.redirectURL)&"
authorizationURL += "state=\(state)&"
authorizationURL += "scope=\(scope)"


print(authorizationURL)
let url = URL(string: authorizationURL)

let request = URLRequest(url: url!)
webView.load(request)

展开
收起
游客5akardh5cojhg 2019-12-09 00:02:33 506 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
Web应用系统性能优化 立即下载
高性能Web架构之缓存体系 立即下载
PWA:移动Web的现在与未来 立即下载