I'm trying to make an application that shares the content of my website automaticly whenever a post is posted. So I started with Graph Api Explorer. I got an access token of application Graph Api Explorer with manage_pages and publish_actions permissions.
When I use Graph Api Explorer it posts the message as page post which is I want it to be but when I use my own test application with the same permissions and query structure it posts it as fan post. Please help me what is wrong. Here is some screenshots that will help me to tell the problem:
and the result is:
Perfectly fine! But when I try to do it with my own application,
the settings are the same as above
and the result is:
By the way my application isn't approved becuase I didn't submit an approval. Is this the problem?
No, application approval is not necessary. You just need to use access_token of your page not of your profile.
$facebook->api("/PAGE_ID?fields=access_token");
Related
I have to check in my script if a user like a facebook page.
I would realize it without Facebook app. I would not create it.
I founded some examples, but they require a Facebook app, and that user gives it the correct permission.
Can you help me? Is it possible?
Thanks for any suggestion.
You need to use the Facebook API and ask for permission from the user to do this.
Resources:
Facebook API info
User info
If your application is an external website, then you need to use the Facebook API and ask for the user_likes permission + valid access and make a POST to USER_ID/likes/PAGE_ID
If your application is a canvas or a tab application, then you can use the signed_request parameters that Facebook send you.
https://developers.facebook.com/docs/howtos/login/signed-request/
https://developers.facebook.com/docs/reference/api/user/
Regards
Am working on an application that should be able to write unto the wall of a friend after the user authorizes it. Currently, i can write unto my wall successfully through the application using the facebook graph API. Am facing difficulty in writing to a friends wall using the app. I have not been able to figure out whether i need extra permissions to do so or if need to do something different. I would be grateful if anyone could help me with any lead.
Thanks.
You have to get an extended permissions for your app: publish_stream.
For reference see: http://developers.facebook.com/docs/authentication/permissions/
publish_stream - Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends...
Good luck
I need to grab the statuses from a Facebook page via PHP to display on the page. I don't want to have people logging in to facebook just for my script to grab the statuses from the page since it is a public page and isn't restricted. I have the Facebook API for PHP in my projects directory but have no idea how to use it to do what I want it to. Could someone give me a code example of how I'd do this? Thanks!
It's really a straight forward task if you follow the documentation. Since /PAGE_ID/feed requires any valid access_token, your app access_token is enough to get the data:
Open the Graph API Explorer (I'm querying coca-cola/feed)
Get an app access_token from the Access Token Tool and use it instead of yours
You're done!
I have a Facebook application used as a tab in a fan page, that displays different information depending on whether tha user is a fan of that page or not.
Now I've been asked to have it post a message to a user's wall if they perform certain action (follow a link or whatever), and so far I haven't found a way to do that. All the documentation I have found refers to stand alone apps, and I've even seen it suggested (in the FB forums) that you can't get the auth token from an app.
So, i still think it can be done, but how?
If a user has authorized your app, you can post to her wall using the PHP SDK. See the PHP SDK api documentation for examples.
All apps have to be iframe apps now, so loading the JS sdk should be fine.
You have to get permissions first ->
http://developers.facebook.com/docs/authentication/#applogin
Then you can post using php with what Dhiren said, or, post with the fb.api function with JS ->
http://developers.facebook.com/docs/reference/javascript/FB.api/
Let me know if you need an example script.
Cheers
I recently made my first facebook app which works as a "connection" for posting messages to different walls. I got it all working and I now want to test it with other users. If I want a second user to be able to post to the walls through my app what needs to be added? The users can perfectly login through my php script but they are being refused when they try to post to the walls.
Should the users be added in the "Roles" section of my app? If yes, then they have to be "verified developers"?
Thanks in advance.
Check this out this might help you - http://thinkdiff.net/facebook-connect/php-sdk-3-0-graph-api-base-facebook-connect-tutorial/
Or if you can post your code, then i can surely help you to make it available to any user to use your app to post on their walls
If the user wants to post anything to their walls using your application, then they need to grant publish_stream extended permission to your application and using their access_token, you can allow them to post anything to their walls from your application and not just one user, any number of users will be able to do it, so if you post your code, i can help you with it.