Flashbaer
Flashbaer

Reputation: 13

Restrictions for app tab pages?

is there a way to install the app to the page with restrictions to the visitors country or age?

I am programming an app which will be only available for Users of distinct coutries. However, I am planning to install the app as a tab on a Facebook page that is international with no restrictions. And I don't want users from other countries seeing my app.

Is this possible?

Regards, Flashbaer

Upvotes: 1

Views: 444

Answers (1)

Martin Torhage
Martin Torhage

Reputation: 623

It should be possible according to https://developers.facebook.com/docs/reference/fbml/restricted-to/

Whatever settings I use result in that the tab isn't available for non-signed in users and is always available for signed in users. I don't think I'm doing anything wrong.

This is the code I use:

self::$facebookClient = new Facebook(array(
    'appId'  => $appId,
    'secret' => $appSecret,
));
$restrictions = array(
    'location' => 'AR,AT',
    // 'type' => 'alcohol',
    // 'age' => '50+',
);
var_dump($fb->api('/'.$appId.'?restrictions='.urlencode(json_encode($restrictions)), 'POST'));
var_dump($fb->api('/'.$appId.'?fields=restrictions'));

Upvotes: 1

Related Questions