照片

2016-04-15 90 views
0

我一直在試圖讓所有來自Facebook的照片...我提到的代碼從圖形API照片

 NSMutableDictionary* parameters = [NSMutableDictionary dictionary]; 
     [parameters setValue:@"id,name,photos" forKey:@"fields"]; 
      [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:parameters] 
      startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error){ 
       NSLog(@"RESULT===%@",result); 

      }]; 

但日誌中的結果沒有顯示任何照片....好心幫

+0

而'錯誤'是零? – Larme

+0

yes顯示爲無 –

+0

您是否從Facebook獲得了用戶個人資料中的照片的許可? – kb920

回答

0

這裏首先你必須通過

FBSDKGraphRequest *request=[[FBSDKGraphRequest alloc] initWithGraphPath:@"me/albums" parameters:nil]; 
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { 
    if (!error) { 

    }else { 
     NSLog(@"error %@", error.description); 

    } 
}]; 

拿到相冊ID,然後在獲得特定專輯的照片

FBSDKGraphRequest *request=[[FBSDKGraphRequest alloc] initWithGraphPath:@"AlbumId/photos" parameters:nil HTTPMethod:@"GET"]; 

[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result1, NSError *error) { 

    if(!error) 
    { 

    }else{ 

    } 
}];