Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook SDK Javascript and PHP
    primarykey
    data
    text
    <p>So I'm creating an application within a the CodeIgniter framework that works as a points system with Facebook. It basically will give you points for sharing, liking etc. I'm using the PHP SDK for authentication and it works great but unfortunately the iframe method of liking and sharing won't work because I need to attach a Callback.</p> <p>So I know there is the Javascript SDK which has the Like Button feature but can a callback be attached? And if so, can the Javascript and PHP SDK work together so you wouldn't need to authenticate twice? Or is there a way to accomplish all of this strictly with the PHP SDK? I really need to be able to like and attach a callback to it. Thanks!</p> <p>edit: Attached Javascript SDK code</p> <pre><code>&lt;script&gt; window.fbAsyncInit = function() { FB.init({ appId : '346032368781548', // App ID channelUrl : '//localhost/channel.html', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); // Additional initialization code here }; // Load the SDK Asynchronously (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)); &lt;/script&gt; &lt;fb:like send="true" width="450" show_faces="true" /&gt; &lt;script type="text/javascript"&gt; FB.Event.subscribe('edge.create', function(response) { alert('You liked the URL: ' + response); // Replace with the function that you want } ); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload