1
我想要像下面這樣做,但它不起作用。facebook-ios-sdk請求名稱和類型的個人資料圖片不起作用
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"first_name,picture?type=normal", @"fields",nil];
[facebook requestWithGraphPath:@"me" andParams:params andDelegate:self];
我使用的是Facebook的IOS-SDK是here
如果我想requst他們一個要求,那怎麼辦?謝謝。
我使用的批處理請求等
NSString *jsonRequest1 = @"{ \"method\": \"GET\", \"relative_url\": \"me?fields=first_name\" }";
NSString *jsonRequest2 = @"{ \"method\": \"GET\", \"relative_url\": \"me/picture?type=square\" }";
NSString *jsonRequestsArray = [NSString stringWithFormat:@"[ %@, %@ ]", jsonRequest1, jsonRequest2];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:jsonRequestsArray forKey:@"batch"];
[facebookDelegate requestWithGraphPath:@"me" andParams:params andHttpMethod:@"POST" andDelegate:self];
和我得到的結果是
({
body = "{\"first_name\":\"Eric\",\"id\":\"100003742445201\"}";
code = 200;
headers = (
{
name = "Access-Control-Allow-Origin";
value = "*";
},
{
name = "Cache-Control";
value = "private, no-cache, no-store, must-revalidate";
},
{
name = Connection;
value = close;
},
{
name = "Content-Type";
value = "text/javascript; charset=UTF-8";
},
{
name = ETag;
value = "\"3be1c3dfc20761062712ae899cc7c402062300a7\"";
},
{
name = Expires;
value = "Sat, 01 Jan 2000 00:00:00 GMT";
},
{
name = Pragma;
value = "no-cache";
}
);},
{
body = "<null>";
code = 302;
headers = (
{
name = "Access-Control-Allow-Origin";
value = "*";
},
{
name = "Cache-Control";
value = "private, no-cache, no-store, must-revalidate";
},
{
name = Connection;
value = close;
},
{
name = "Content-Type";
value = "image/jpeg";
},
{
name = Expires;
value = "Sat, 01 Jan 2000 00:00:00 GMT";
},
{
name = Location;
value = "http://profile.ak.fbcdn.net/hprofile-ak-snc4/573359_100003742445201_1494953237_q.jpg";
},
{
name = Pragma;
value = "no-cache";
}
);
}
)
輪廓圖像不是在正確的位置。爲什麼?
配置文件圖像位於第2個標題中,並且是第2個調用。在我看來,這是正確的。 – 2012-04-20 16:53:45