Reputation: 6871
I have made a simple Facebook app that takes in user data and does something (irrelevant to the question). Now, what I want is that the app must get installed on a user's page (i.e., the page for which the user is an admin) like this:
Here is the app that does the above.
How can I do this for my app? Is there something available with the Facebook API? Or is it a hack?
Upvotes: 1
Views: 894
Reputation: 784
To add an app as a page tab you could try one of the following.
Tab Dialog using the JavaScript SDK.
<script type="text/javascript">
function addtab()
{
FB.ui({
method: 'pagetab',
redirect_uri: 'YOUR_URL'
}, function(response){});
}
</script>
<a href="#" onClick="addtab()">Add As Page Tab</a>
The above example assumes that the person has already logged in to your app.
URL Redirect.
<a href="https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&redirect_uri=YOUR_URL">Add As Page Tab</a>
Or like in your example website you could use something like the following.
<a href="https://www.facebook.com/add.php?api_key=YOUR_APP_ID&pages">Add As Page Tab</a>
Make sure and change YOUR_APP_ID and YOUR_URL with the ID and URL of the app you want to add as a Page Tab.
https://developers.facebook.com/docs/reference/dialogs/add_to_page
Upvotes: 1