我使用Facebook的SDK 3.0我們可以使用facebook sdk獲取用戶郵政編碼嗎?
Facebook的我已經添加用戶完全地址
地址 - 1,無限循環
城市/城鎮 - 加利福尼亞州Cupertino
UPDATE
按答案我試圖用FBGraphLocation協議這樣
NSDictionary<FBGraphUser> *user
id<FBGraphPlace> objPlace = user.location;
id<FBGraphLocation> objLocation = objPlace.location;
NSLog(@"place.location : %@ location.street : %@",objPlace.location,objLocation.street);
這是給(null)
兩種。還我越來越objLocation object as (null)
了Facebook SDK響應,我得到的位置,因爲只有這樣
location = {
id = 123456789123456;
name = "Cupertino, California";
}
這不是從那裏我可以使用的郵政編碼的足夠的信息。
如果Facebook不允許提供郵政編碼信息則沒有辦法僅從"Cupertino, California"
信息獲取郵政編碼?
我已經使用這個網址
http://maps.googleapis.com/maps/api/geocode/json?address=Cupertino,%20California&sensor=true
這給我造成的
{
"long_name" = Cupertino;
"short_name" = Cupertino;
types = (
locality,
political
);
},
{
"long_name" = "Santa Clara";
"short_name" = "Santa Clara";
types = (
"administrative_area_level_2",
political
);
},
{
"long_name" = California;
"short_name" = CA;
types = (
"administrative_area_level_1",
political
);
},
{
"long_name" = "United States";
"short_name" = US;
types = (
country,
political
);
}
如果我靜態把該地址進入網址爲
http://maps.googleapis.com/maps/api/geocode/json?address=1%20Infinite%20Loop,%20Cupertino,%20CA&sensor=true
然後它給了我郵編代碼也。
{
"long_name" = 1;
"short_name" = 1;
types = (
"street_number"
);
},
{
"long_name" = "Apple Inc.";
"short_name" = "Apple Inc.";
types = (
establishment
);
},
{
"long_name" = "Infinite Loop";
"short_name" = "Infinite Loop";
types = (
route
);
},
{
"long_name" = Cupertino;
"short_name" = Cupertino;
types = (
locality,
political
);
},
{
"long_name" = "Santa Clara";
"short_name" = "Santa Clara";
types = (
"administrative_area_level_2",
political
);
},
{
"long_name" = California;
"short_name" = CA;
types = (
"administrative_area_level_1",
political
);
},
{
"long_name" = "United States";
"short_name" = US;
types = (
country,
political
);
},
{
"long_name" = 95014;
"short_name" = 95014;
types = (
"postal_code"
);
}
但是從Facebook的SDK,我只得到了市/縣(如上所述),聯繫人信息添加在Facebook.com
我怎樣才能做到這一點?
是的,我需要的郵政編碼。我已經使用Facebook的SDK現在我需要整合fbgraphlocaion的權利?這是否包含在sdk本身中? – Heena
我試圖NSLog'user.location'它再次給出位置:{ id = 1112342342345; name =「Cupertino,California」; }'也嘗試過'user.location.street',但給出錯誤 – Heena
對於'id objlocation = user.location',它不兼容,因爲位置來自'FBGraphPlace' –
Heena