我正在实现 facebook graph APi 以获取帖子列表,但我在这这是我的代码中遇到错误
var Requset : FBSDKGraphRequest
print("\(FBSDKAccessToken.current())")
let acessToken = String(format:"%@", FBSDKAccessToken.current().tokenString) as String
print("\(acessToken)")
let parameters1 = ["access_token":FBSDKAccessToken.current().tokenString]
Requset = FBSDKGraphRequest(graphPath:"me/?fields=feed{message,full_picture,id,application,likes{name,pic_crop},comments{message,from,created_time},created_time}", parameters:parameters1, httpMethod:"GET")
Requset.start(completionHandler: { (connection, result, error) -> Void in
//MBProgressHUD.hideHUDForView(appDelegate.window, animated: true)
if ((error) != nil)
{
print("Error: \(error)")
}
else
{
print("fetched user: \(result)")
//var dataDict: AnyObject = (result! as AnyObject).object(forKey: "data")!
}
我在这个错误中遇到错误如下
错误:可选(错误域=NSURLErrorDomain 代码=-1002“不支持的 URL”UserInfo={NSUnderlyingError=0x60000005fbf0 {错误域=kCFErrorDomainCFNetwork 代码=-1002“(null)”},NSErrorFailingURLStringKey=(null)?
谁能告诉我如何解决这个问题