Reputation: 45
I am writing an app where I am supposed to make a user to add my app to his page.
Right now if I want a user to make him add the app to his account I am simply redirecting the user to apps.facebook.com/myfunnyapp. From there on, facebook will guide him add the app to his account.
But I am supposed to make him add the app to his page.
Any ideas? Thank you all in advance.
Upvotes: 1
Views: 184
Reputation: 45
I found the answer. This post helped me
redirect on facebook app install
We need to post a request to https://api.facebook.com/method/admin.setAppProperties?access_token=App_Token&properties={'post_authorize_redirect_url':'http://myhost.com/Test/callback.jsp?'}
Your app access token can be found here https://developers.facebook.com/tools/access_token/
Note: you have to use a app_token instead a user_token.
But what I need to know is will this app_token change every time or not?
Any ideas gurus?
Upvotes: 0
Reputation: 9839
Did you try this url:
http://www.facebook.com/add.php?api_key=<your_api_key>&pages
It will add your app to his fanpage automatically.
Upvotes: 1