我想在我的swift应用上显示Facebook feed列表,但是我正在使用图api,但得到的响应却不是详细的
EX:我想在图形路径下面使用该图标,并为其添加评论和帖子名称
me/?fields=feed{message,full_picture,id,application,likes{name,pic_crop},comments{message,from,created_time},created_time}
当我在图形路径中传递me/posts
时,但是当我传递上URL时却没有响应
这是我的代码
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/posts", parameters:parameters1 as Any as! [AnyHashable : Any], httpMethod:"GET")
//me/?fields=feed{message,full_picture,id,application,likes{name,pic_crop},comments{message,from,created_time},created_time}
Requset.start(completionHandler: { (connection, result, error) -> Void in
//MBProgressHUD.hideHUDForView(appDelegate.window, animated: true)
//me/?fields=feed{message,full_picture,id,application,likes{name,pic_crop},comments{message,from,created_time},created_time}
if ((error) != nil)
{
print("Error: \(String(describing: error))")
}
else
{
print("fetched user: \(String(describing: result))")
//var dataDict: AnyObject = (result! as AnyObject).object(forKey: "data")!
}
})
任何人都可以帮助我
错误:可选(错误域= NSURLErrorDomain代码= -1002”不受支持 URL“ UserInfo = {NSUnderlyingError = 0x60800024b850 {Error Domain = kCFErrorDomainCFNetwork代码= -1002“(null)”}, NSErrorFailingURLStringKey =(空)?