我最近更新了我的所有pods
和快速的语言Swift 5
在我的项目中,收到了大量错误消息,我已经慢慢解决了这些消息。
然而,我在 Facebook 上遇到了困难GraphRequest
之前工作正常,特别是此错误消息位于version
的参数GraphRequest
.
如果我删除version
参数然后我得到这个错误:
func fetchFacebookAttributes(fetchFBAttrbComplete: @escaping (Bool, String) -> ()){
let graphRequestConnection = GraphRequestConnection()
let graphRequest = GraphRequest(graphPath: "me", parameters: ["fields": "id, email, name, picture.type(large), first_name, last_name, gender, birthday"], tokenString: AccessToken.current?.tokenString, version: .defaultVersion , httpMethod: .get)
graphRequestConnection.add(graphRequest) { (httpResponse, result) in
switch result {
case .success(response: let response)://handling .success response case
guard let responseDictionary = response.dictionaryValue else { return }
//parse response code here...
case .failed(let error):
print (error)
fetchFBAttrbComplete(false, "")
break
}//end switch
}//end graphRequestConnection
graphRequestConnection.start()//start connection
}//end func
我遇到过这个 FB 文档,其中显示了如何使用它的示例,但我很难理解它是如何使用的?这是一个单独的文件吗?
https://developers.facebook.com/docs/swift/graph/ https://developers.facebook.com/docs/swift/graph/