要求用户许可发布到他们的Facebook Wall

时间:2016-09-23 20:01:15

标签: facebook facebook-php-sdk

我正在尝试请求我的用户允许他们使用SammyK/LaravelFacebookSdk发布到他们的Facebook墙。

我有一个按钮

enter image description here

<form method="POST" action="http://localhost:8888/facebook/checkin" accept-charset="UTF-8"><input name="_token" type="hidden" value="VTBcvupobSzcDThNeNguxCR4tMh2e28Wds4LzJA8">
  <button type="submit" id="check-in-with-facebook" class="btn btn-sm btn-primary btn-facebook">Check In</button>
</form>

之后,他们点击它,这个控制器功能将触发

public function checkin(){
    $fb = App::make('SammyK\LaravelFacebookSdk\LaravelFacebookSdk');
    $permissions = 'publish_actions, user_posts, user_photos';
    $login_url = $fb->getLoginUrl(['email','scope'=>$permissions]);
    return redirect($login_url);
}

然后,重定向将发生在以下网址

https://www.facebook.com/v2.5/dialog/oauth?redirect_uri=http%3A%2F%2Flocalhost%3A8888%2Ffacebook%2Flink&state=04c7d976a47fca8c370b08b9d1dd954d&scope=email%2Cmanage_pages%2Cpublish_pages%2C+publish_actions%2C+user_posts%2C+user_photos&response_type=code&client_id=956232267794396&ret=login&sdk=php-sdk-5.2.0&logger_id=aff4eaf6-269b-479a-a91c-aa53b57447d2&ext=1474663682&hash=AeYpZWVkApEd5u-N

然后,会弹出模态,但我只看到Public ProfileEmail Address

enter image description here

我要求publish_actions, user_posts, user_photos

我做错了什么?

任何建议/提示都会很好......

0 个答案:

没有答案