我使用此功能获取用户的照片:
func getFacebookPhotos() {
var request = FBSDKGraphRequest(graphPath:"/me/photos?fields=from,tags,images", parameters: nil);
println("started request")
request.startWithCompletionHandler(self.handler)
}
func handler(connection : FBSDKGraphRequestConnection!, result : AnyObject!, error : NSError!) {
if error == nil {
println(result)
if (result["paging"]! != nil) {
var after = result["paging"]!["cursors"]!["after"]! as! String
var path = "/me/photos?fields=from,tags,images&after=" + after
var request = FBSDKGraphRequest(graphPath: path, parameters: nil);
println("started request")
request.startWithCompletionHandler(self.handler)
}
} else {
println(error)
}
}
问题是,当我知道用户有更多照片时,我只能拍摄30张照片。
我如何获得所有照片?
答案 0 :(得分:0)
您需要传递limit
参数:
limit : This is the number of individual objects that are returned in each page. Note that this is an upper limit, if there are not enough remaining objects in the list of data, then less than this number will be returned. Some edges have an upper maximum on the limit value, for performance reasons. We will return the correct pagination links if that happens.
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.4#paging