showAppRequestDialog Method

This method displays the Facebook application request dialog

intel.xdk.facebook.showAppRequestDialog(parameters);

Description:

The Request Dialog sends a Request from one user (the sender) to one or more users (the recipients). The Request Dialog can be used to send a Request directly from one user to another or display a Multi Friend Selector Dialog, allowing the sending user to select multiple recipient users.

Platforms:

Parameters:

  • parameters: A JSON object holding the appropriate parameters for the request as specified in Facebook's documentation

Events:

  • intel.xdk.facebook.dialog.complete: This event is fired upon completion of the dialog request.
  • intel.xdk.facebook.dialog.fail: This event is fired if Facebook attempted to log the user in during a dialog request, but the login failed.

Example:


document.addEventListener("intel.xdk.facebook.dialog.complete",function(e) {
        console.log("Permissions Request Returned");
        if (e.success == true) {
                console.log("News feed updated successfully");
        } else { console.log("permissions request failed"); }
},false);
var objParameters = {"to":"USER_ID_HERE","message":"My Awesome Message","title":"A title for this dialog would go here"}
intel.xdk.facebook.showAppRequestDialog(objParameters);
                                  
有关编译器优化的更完整信息,请参阅优化通知