Skip to content

Instantly share code, notes, and snippets.

@goranefbl
Last active February 21, 2016 23:10
Show Gist options
  • Save goranefbl/bbed8c255de9cbd91c92 to your computer and use it in GitHub Desktop.
Save goranefbl/bbed8c255de9cbd91c92 to your computer and use it in GitHub Desktop.
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
window.fbAsyncInit = function() {
FB.init({
appId : 'app_id',
xfbml : true,
cookie : true,
status : true,
version : 'v2.5'
});
FB.Event.subscribe("xfbml.render", changeSettings)
};
var changeSettings = function(token) {
console.log("aa");
yourToken = token;
FB.api('/app_id', 'POST', {
"access_token": "app_id|app_secret",
"canvas_url": "https://apps.facebook.com/ognjen",
"secure_canvas_url": "https://ognjen.com/canvas/ognjen/"
},
function (response) {
console.log("bb");
console.log(response);
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment