Initialization Code:
window.fbAsyncInit = function() {
var bheight = $(document).height() + 50;
FB.init({
appId: appid,
frictionlessRequests : true,
status: true,
cookie: true,
xfbml: true,
oauth: true});
FB.Canvas.setSize({ width:760,height:bheight });
};
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
The following code is called using onclick:
function sendRequestViaMultiFriendSelector(msg){
FB.ui({
method: 'apprequests',
message: msg
});
}
A pop-up window will be displayed and the user can select friends, but after sending or canceling the window will drop. The popup is still there, but white and empty. There are no errors in Firebug.
If you add a callback function, it was never reached.
I tried adding self-clos redirect_uri (redirect_uri: ' http: //.../self_close.html '), but after sending pop-up redirects to self_close. html, and even when the content of this html is simple <script type="text/javascript">window.close(); </script>, the popup does not close or send a request to selected friends.
, , , .
localhost, Sandbox, , , .. .
?
, :
!
, : feed : apprequests
function feed_test() {
var obj = {
method: 'feed',
name: 'Feed test',
caption: 'Test',
description: 'Test'
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
onclick, , , , . , .
2
, , Facebook ( http://facebookapp.localhost/), apprequest . FB, , :
https://www.facebook.com/dialog/apprequests?api_key=XXXXXXXXXX&app_id=XXXXXXXXXX&display=popup&frictionless=true&locale=en_US&message=XXXX&next=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D5%23cb%3Df2b013bbfaa712%26origin%3Dhttp%253A%252F%252Ffacebookapp.localhost%252Ff3267a4c771122%26domain%3Dfacebookapp.localhost%26relation%3Dopener%26frame%3Df3ad1f46b651196%26result%3D%2522xxRESULTTOKENxx%2522&sdk=joey
, FB, , js.
, . , , . , ... , , .