
Untitled
By: a guest on
May 11th, 2012 | syntax:
None | size: 1.16 KB | hits: 19 | expires: Never
Facebook apprequest not being sent to facebook users
exports = fm.namespace(this,'bla','facebook')
exports['init'] = function(){
window.fbAsyncInit = function() {
if (undefined !=RAILS_ENV['facebook_app_id'])
{FB.init({
appId : RAILS_ENV['facebook_app_id'], // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});}
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
}
exports['sendRequestToOneRecipient']= function (uid) {
FB.ui({method: 'apprequests',
message: "bla bla",
to: uid
}, requestCallback);
function requestCallback(response) {
if (response && response.to) {
console.log("Message was sended");
} else {
console.log("Message was not sended.");
}
}
}