Posting to User's walls as application using Facebook PHP API
I've been building a web app that uses facebook integration for easier registration/login and notifications for the users. However, for the notifications I want to be able to post to a users facebook wall when something happens on our site.
Really I see two possible problems with doing this. First being that the user will most likely not be开发者_JS百科 logged in to our website when the notification needs to happen. Second I have not found a way to post to the feed using any identity other than the current logged in user.
So to reiterate exactly what I'm trying to do. When some action takes place on my site involving Bob, I want the websites application to post on Bobs wall notifying him of the action as if the application is one of Bobs friends. From some of the things I've seen while researching this, it seems as if facebook might not treat applications like users and I might have to go through a page to accomplish what I want. But really I'm ok with that.
What you need to do is to ask for the offline_access
permission. Then you can store their graph id
property after they login/authorize to your site's database. Then you just post to that graph id instead of instead of /me
. In your case you would then POST a request to the "$user_graph_id/feed"
endpoint with whatever parameters you usually have.
精彩评论