Access Facebook Graphi API for Zip Code

I'm using JS to access the Facebook Graph API. No problem accessing the Location.name (City, State) but I can't seem to access anything else listed in this documentation: https://developers.facebook.com/docs/graph-api/reference/location/

I believe the problem is that within my Facebook App, I'm only requesting the user_location, which only includes the City, State. But it doesn't give me the option to request the Location, which has many more parameters.

Here's my code:

FB.api('/me?fields=id,first_name,last_name,email,gender,birthday,location',  function (response) {
                  ////console.log(response);
                  var tempName = response.first_name.split(" ");
                  var tempLastName = response.last_name.split(" ");
                  temp = {
                      id: response.id,
                      name: tempName[0],
                      lastname: tempLastName[0],
                      email: response.email,
                      gender: response.gender,
                      dob : response.birthday,
                      location: response.location.name,
                      zip: response.location.zip,
                  };
                  console.log(response.location.zip, "zip") //returns "undefined"

                  infoUser.push(temp);
                  validatorWords("FB", response.id);
              });
链接地址: http://www.djcxy.com/p/35826.html

上一篇: Paypay网站付款标准API:无需PayPal账户付款

下一篇: 访问用于Zip Code的Facebook Graphi API