开发者

How do I post to a user's wall through a facebook iframe app?

开发者 https://www.devze.com 2022-12-16 18:13 出处:网络
I have a simple iframe facebook app. I need the app to post content to the current user\'s wall.I\'m doing everything in PHP and JS.Currently, the only facebook-specific PHP I have is to get the curre

I have a simple iframe facebook app. I need the app to post content to the current user's wall. I'm doing everything in PHP and JS. Currently, the only facebook-specific PHP I have is to get the current user's ID, and the only JS I have is to get the iframe to size to the contents.

How do I have a dialogue pop up with predetermined content, asking the user to enter any additional text the开发者_开发知识库y may wish to enter before publishing to the user's wall? I've looked into FB.Connect.streamPublish() but that requires using Facebook Connect, which is veering away from the whole iframe app thing.


You were looking in the right place - the Facebook Connect libraries are what you need. If you embed the standard Connect code in an iframe app then it'll set up the user's session transparently by taking parameters from Facebook's iframe tag. You can then use FB.Connect.streamPublish().

The only other alternative would be to get the user to grant the application the publish_stream extended permission and use the stream.publish API call directly. But since the only way to get that permission is through yet another Connect dialogue (or directly in FBML) it doesn't really solve the problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消