php - Facebook Button not working as expected -
i've been trying implement fb button on app. i'm using js sdk along xfbml.
so basically, after creating app, i've set necessary markeup in body (i'm using twig along symfony2):
{% block body %} <div id="fb-root"></div> <script> window.fbasyncinit = function() { // init fb js sdk fb.init({ appid : 'mykey', // app id app dashboard channelurl : "", // channel file x-domain comms status : true, // check facebook login status xfbml : true // social plugins on page }); // additional initialization code such adding event listeners goes here }; // load sdk asynchronously (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 = "//connect.facebook.net/en_us/all.js"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script>
i don't specify channel url, understand made improve perfs right ? i'm trying make work now.
then, in head of html page, tryied add met tag in order have custom message displayed on fb when sharing content:
<meta property="fb:app_id" content="mykey" /> <meta property="og:type" content="catch report app" /> <meta property="og:url" content="{{ url('pondip_keepnet_showcatch', {'id': catch.id }) }}" /> <meta property="og:title" content="fishing @ {{ catch.lake.name }}, bagging {{ catch.weight }} pound {{ catch.fish }}" /> <meta property="og:image" content="{{ app.request.schemeandhttphost }}{{ catch.getwebpath() }}" />
at last, insert code button somewher in page:
<fb:like href="{{ url('pondip_keepnet_showcatch', {'id': catch.id }) }}" layout="button_count" show_faces="false" width="240" height="40" action="like" colorscheme="light"></fb:like>
so now, when click on button, pops share box can type in text + informations, doesn't seem 1 metatags , disapears within second: click, pops up, disapears. button replaced confirm link which, once click on pop overlay confirmation box : "confirm like" latin description (wtf ?)
i'm bit confused doing wrong or forgetting ? got error in console :
unsafe javascript attempt access frame url http://static.ak.facebook.com/connect/xd_arbiter.php?version=24#channel=f11…ath=%2fkeepnet%2fshow-catch%2f43%3ffb_xd_fragment%23xd_sig%3df3b963f43c%26 frame url https://www.facebook.com/plugins/like.php?api_key=578515048849169&locale=en…lorscheme=light&action=like&show_faces=false&extended_social_context=false. frame requesting access has protocol of 'https', frame being accessed has protocol of 'http'. protocols must match.
thanks
Comments
Post a Comment