I have an application that runs inside a iframe on facebook canvas page. As it is a game, I would like to make it able to allow users to share their score, for this purpose, I've tryed the following:
FB.ui({
app_id: '000000000000000000',
method: 'feed',
display: 'page',
name: 'Dialog Name',
caption: 'Caption for dialog',
description: 'Lorem ipsum dolor sit amet...'
});
What I want is that when this code get running, a dialog appears over my page, however, instead of it, it always tries to op开发者_如何学Cen a window, to be even worst, all of my parameters are ignored in the window.
What am I doing wrong?
You need to specify the display as iframe
, not page
(page
is the default setting anyway, I don't know why you are specifying it).
You can find more information here: http://developers.facebook.com/docs/reference/dialogs/
Also, you shouldn't need the app_id
parameter (most of the time the JS SDK will automatically add it for you).
EDIT
Here's what I use:
FB.ui({
display: "iframe",
method: "feed",
name: "",
link: "",
picture: "",
caption: "",
description: "",
message: "",
actions: {"name":"","link":""}
},function(response){});
}
You should be able to do this through the parameter "display: 'popup'" so change it to:
FB.ui({
display: "popup",
method: "feed",
name: "",
link: "",
picture: "",
caption: "",
description: "",
message: "",
actions: {"name":"","link":""}
},function(response){});
}
精彩评论