Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't checkin to Facebook Places by post to api?
    primarykey
    data
    text
    <p>I am trying to build an app where I let my registered user be able to check in to places on Facebook Places. I however for some reason can't seem to make this work. I assumed this is possible with the Api as write functionality has been added to it, but I couldn't find an clear explanation on the web. this is what I currently have, after I have asked the user for permission to publish checkins and for user_checkins.</p> <pre><code>&lt;?php require("src/facebook.php"); $facebook = new Facebook(array( 'appId' =&gt; 'xxxxxxxxx', 'secret' =&gt; 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'cookie' =&gt; true )); # see if active session $session = $facebook-&gt;getSession(); if(!empty($session)) { try{ $uid = $facebook-&gt;getUser(); $api_call = array( 'method' =&gt; 'users.hasAppPermission', 'uid' =&gt; $uid, 'ext_perm' =&gt; 'publish_checkins' ); $can_post = $facebook-&gt;api($api_call); if($can_post){ $facebook-&gt;api('/'.$uid.'/checkins', 'POST', array( 'access_token' =&gt; $facebook-&gt;getAccessToken(), 'place' =&gt; 'place_id', 'message' =&gt;'I went to placename today', 'picture' =&gt; 'http://www.place.com/logo.jpg', 'coordinates' =&gt; array( 'latitude' =&gt; 'lattiude', 'longitude' =&gt; 'lattitude', 'tags' =&gt; $uid, ) ) ); echo 'You were checked in'; } else { die('Permissions required!'); } } catch (Exception $e){} } else { # There's no active session,generate one $login_url = $facebook-&gt;getLoginUrl(); header("Location: ".$login_url); } ?&gt; </code></pre> <p>The code works when I change it 'checkins' to 'feed'. Is there something wrong with my code or am I trying to do somethign that isn't possible (or do it the wrong way).</p> <p>Any help will be greatly appreciated as I already spent quite a significant amount of time trying to fix this, but I just can't seem to make it work.</p> <p>Best regards,</p> <p>Marcus Joe</p>
    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.
 

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