duanhuilao0787 2013-05-17 12:47 采纳率: 100%
浏览 280

Facebook服务器登录验证问题。

I'm trying to simply post to a facebook page as the page.

I created an app, set permissions ( manage_pages ), and requested an app token ( via https://developers.facebook.com/docs/facebook-login/access-tokens/ ).

I think I'm almost there but I'm getting an "PHP Fatal error: Uncaught OAuthException: (#200) The user hasn't authorized the application to perform this action" error.

<?php
require_once('facebook.php');
$config = array();
$config['appId'] = 'xxxxxxxxxxxxx';
$config['secret'] = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$config['fileUpload'] = false; // optional
$facebook = new facebook($config);

$access_token = "app token I got from link above";
$facebook->setAccessToken($access_token);

$page_id = "xxxxxxxxxxxxxxxx";
$args = array(
        'access_token'  => $access_token,
        'message'       => "This is just a test.",
        'name' => "Just a test.",
        'link' => "http://www.xxxx.com/",
        'picture' => "http://www.xxxx.com/Logo.jpg",
        'actions' => array(
        'name' => 'See Pic',
        'link' => "http://www.xxxx.com/Logo.jpg"
        )

    );
   $post = $facebook->api("/$page_id/feed","post",$args);

Where am I missing to give auth so I can post to the page? I've been over the settings under my app dashboard and don't see that I'm missing anything.

Thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了