What is the code that i need in order to post to my app users walls? and not just once when they click allow
I've searched the most related posts on this topic but I haven't found the answer. I don't understand code so I might not even notice it if I saw it.
but what I'm looking for is the code that allows me to post to my app users walls. but not just when they cl开发者_运维百科ick the allow button, but any time after.
I know it can be done, I've seen the scripts that do this.
Hopefully I'm being clear enough, but I know the code that brings up the little box with some text in it when someone allows my app and they can click post or skip. that's not what I'm talking about.
I want the ability to post to their wall a week from now if I want to.
what is the code or script for that?
In order to do this, your app will need to get publish_stream permission from the user to be able to publish to their wall. If you want to be able to do it any time after, you will also need to prompt the user for offline_access. These permissions are detailed here. To do the actual posting, you will need to do an HTTP Post to the users feed url. You will need an access token that you got from authenticating earlier. This is all well documented on Facebook's API documentation. You will care about the sections titled "Publishing", and "Authorization".
As you haven't stated the language you prefer to write the code in, I would also generalize the answer, To be able to post to a user's wall when he is online and not online even, you need the publish_stream
and offline_access
permissions from the user while the user authorizes your application for the first time. You can get these permissions later by means of extended permissions
. Now coming back to the point, if you want to post something to the user's wall at a later time, you can either do it manually by invoking a server side script that has the access_token
with it, or you can invoke it using CRON jobs on a linux server.
Now, if i consider you want to use PHP as your language preference, you can check out these tutorials to get some help on serverside programming using the GRAPH API:
- TUTORIAL 1
- TUTORIAL 2
- TUTORIAL 3
精彩评论