graph.facebook.com

时间:2015-11-05 22:30:53

标签: facebook facebook-graph-api ios9 sdwebimage

我尝试使用此SDWebImageDownloader方法为Facebook用户提取个人资料照片:

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://graph.facebook.com/%@/picture?width=%@&height=%@", contact[USER_FACEBOOK_ID], @(width).stringValue, @(width).stringValue]];

SDWebImageDownloader *downloader = [SDWebImageDownloader sharedDownloader];

[downloader downloadImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {

    if (image) {
        [(UIButton *)view setImage:image forState:UIControlStateNormal];
    } else if (error) {
        NSLog(@"%@", error);
    }
}];

即使我已经跟随this guide from Facebook的每一步,但出于某种原因,我仍然会遇到这个奇怪的错误:

NSErrorFailingURLStringKey=http://graph.facebook.com/XXXXXXXXXXXXXXXX/picture?width=450&height=450, NSErrorFailingURLKey=http://graph.facebook.com/XXXXXXXXXXXXXXXXX/picture?width=450&height=450, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

0 个答案:

没有答案