[ad_1]
window.fbAsyncInit = function() {
FB.init({
appId : 1880204065538033,
cookie : true,
xfbml : true,
version : “v10.0”
})
};
(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”));
function checkFBLogin() {
if (window.FB && typeof FB.getLoginStatus === “function”) {
FB.getLoginStatus(function(response) {
if (response.status === “connected”) {
// implement relation fb id with user email
fetch(
“/wp-json/thelocal/v1/fb-news-token”,
{
method: “POST”,
body: JSON.stringify(
{
access: response.authResponse.accessToken
}
),
}
)
.then((response) = {
console.log(“success”);
});
} else {
setTimeout(checkFBLogin, 1000);
}
…
[ad_2]
Read More:What you need to know about Autumn traditions in Norway