requestWithGraphAPI Method

This method makes calls to the new Graph Facebook API

intel.xdk.facebook.requestWithGraphAPI(path, method, parameters);


This method is used to make a request from the newer Facebook Graph API. For more information on this particular API, see Facebook’s documentation here.



  • path: The Facebook Graph PATH to execute
  • method: The request method to call the Facebook Graph API, typically GET or POST
  • parameters: Any parameters required for the request


  • intel.xdk.facebook.request.response: This event is fired upon completion of a Facebook API request.


var facebookUserID = "me";  //me = the user currently logged into Facebook
document.addEventListener("intel.xdk.facebook.request.response",function(e) {
        console.log("Facebook User Friends Data Returned");
        if (e.success == true) {
                var data =;
                var outHTML = "";

                for (var r=0; r< data.length; r++) {
                outHTML += "<img src='" + data[r]["id"] + "/picture' info='" + data[r]["name"] + "' />";
                document.getElementsByTagName("body")[0].innerHTML = outHTML;
intel.xdk.facebook.requestWithGraphAPI(facebookUserID + "/friends","GET","");                             
Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.