ShaunTheSheep
ShaunTheSheep

Reputation: 281

Facebook application access for the public

Ive created my first facebook app. Basically the canvas/iframe version. It all seems ok ..except:

  1. I can only access the apps page: (http://apps.facebook.com/hoo_promo/) when im logged in as the administrator user of the app. It should be viewable by everone. Ive submiited it to the appstore...does this matter? is this the issue?

  2. My like-gate doesnt seem to work, even though ive followed several examples. My admin user, who im logged in with, has the page liked, but the code

    $signed_request = $facebook->getSignedRequest(); $like_status = $signed_request["page"]["liked"];

    for page-like is never set in the signed_request obj.

Any help much appreciated....ive added my current code...maybe this can also help others...

$app_id = "secretblahblahhiddenthis";
$secret = 'secretblahblahhiddenthis';
$canvas_page = "http://www.houseofoak.co.uk/facebook_app/";
$auth_url = "http://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&redirect_uri=" . urlencode($canvas_page);

$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $secret,
'cookie' => true,
));

$signed_request = $facebook->getSignedRequest();
$like_status = $signed_request["page"]["liked"];
$user = $facebook->getUser();

$page = 'unliked';
$loginUrl = $facebook->getLoginUrl(array('scope' => 'user_likes'));
$logoutUrl = $facebook->getLogoutUrl();

if (($user) && ($like_status)){
    $page = 'liked'; 
}

Upvotes: 0

Views: 3839

Answers (1)

cpilko
cpilko

Reputation: 11852

For your problems:

  1. Check to make sure you aren't in sandbox mode. Visit https://developers.facebook.com/apps/YOUR_APP_ID/advanced to check.

  2. What you're trying to do is no longer allowed. Facebook has deprecated most of the methods that make a like gate possible. See Facebook Platform Policies Section IV. Point 1 says "You must not ... gate content behind ... Facebook social channels...."

Upvotes: 2

Related Questions