Facebook PHP SDK-以应用而非用户身份发布到用户的墙.如何?

问题描述:

我对Facebook PHP SDK有一些疑问,但尚未找到答案,希望这里的人能为您提供帮助.

I have a few questions about Facebook PHP SDK I haven't found the answers to yet, hope someone here can help.

我创建了一个页面,用户可以连接到Facebook,以便能够通过我的网站在自己的墙上共享事物.我不想使用offline_permission.但是我需要能够延迟发布,因为有时我们需要确认他们使用的选择.我读到您可以随时使用stream_publish发布,但是您需要以THE APP而不是USER的身份发布.现在我想以用户身份发布.如何发布为应用程序?

I have made a page where users connect to Facebook to be able to share things via my site on their wall. I don't want to use the offline_permission. But I need to be able to delay post, cause sometimes we need to confirm choices they use. I read that YOU CAN post at any time with stream_publish, but you need to post as THE APP and not THE USER. Right now I think I post as the user. How do I post as the app?

谢谢!

阅读 Facebook身份验证文档,特别是标题为应用程序登录"的部分,它告诉您如何进行身份验证.基本上,您导航到以下URL: https://graph.facebook.com/oauth/access_token? client_id = YOUR_APP_ID& client_secret = YOUR_APP_SECRET& grant_type = client_credentials ,这将为您提供会话令牌以用作您的页面.

Read the Facebook Authentication documentation, specifically the section titled "App Login" where it tells you how to authenticate as the application. Basically you navigate to this url: https://graph.facebook.com/oauth/access_token? client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentials and that will give you a session token to act as your page.