来自Facebook的高分辨率图像
这就是我从相册中获取相册和图片的方法。
let connectionPhotos = FBSDKGraphRequestConnection() let requestPhotos = FBSDKGraphRequest(graphPath: String(format:"/%@/photos",albumID), parameters: ["fields":"picture.type(large)"], HTTPMethod: "GET") connectionPhotos.addRequest(requestPhotos) { (connection:FBSDKGraphRequestConnection!, result:AnyObject!, error:NSError!) -> Void in if(error != nil){ print(error) self.btnFacebook.userInteractionEnabled = true connectionPhotos.cancel() }else{ connectionPhotos.cancel() self.arrImages = result["data"] as! Array<Dictionary<String, String>> if let userWSRequestKey = TRUserModel.SharedInstance()?.userWSRequestKey{ if userWSRequestKey != X_API_DEFAULT_KEY{ self.callSignInWS(dict) } else{ JSONParser.sharedInstance.parseRequestKeyWithURL("", requestPrm: ["string":"string"], completionHandler: { (response) -> Void in if response["status"] as! Int == 1 { dispatch_async(dispatch_get_main_queue(), {() -> Void in self.callSignInWS(dict) }) } else { dispatch_async(dispatch_get_main_queue(), {() -> Void in self.showAlertView(INTERNET_PROBLEM) }) } }) } } else{ JSONParser.sharedInstance.parseRequestKeyWithURL("", requestPrm: ["string":"string"], completionHandler: { (response) -> Void in if response["status"] as! Int == 1 { dispatch_async(dispatch_get_main_queue(), {() -> Void in self.callSignInWS(dict) }) } else { dispatch_async(dispatch_get_main_queue(), {() -> Void in self.showAlertView(INTERNET_PROBLEM) }) } }) } } } connectionPhotos.start()
- 只是我有414 * 414像素大小的图像,我通过上面的代码获取图像很小所以它会在我的应用程序模糊。 那么,我怎样才能得到大的图像。
- 任何build议?
与此图path
GET /v2.6/{photo-id}/?fields=images
我得到一个不同大小的图像数组。
例:
{ "height": 1365, "source": "...", "width": 2048 }, { "height": 960, "source": "...", "width": 1440 }, { "height": 720, "source": "...", "width": 1080 }
希望这有助于:D