为什么发布到我的应用页面无法离线工作? [英] why posting to my app page is not working offline?

查看:206
本文介绍了为什么发布到我的应用页面无法离线工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码在我的申请页面上发布:

  $ page_info = $ facebook-> api / 344722062246773?fields = access_token); 

$ attachment2 = array('message'=> $ row [nwmsg],
'access_token'=> $ page_info ['access_token'],
' name'=> $ row [nwnm],
'caption'=> $ row [nwsubject],
'picture'=>'http://itradegame.com/ itrade /'。$ row [nwposter],
'description'=> $ row [nwtext],
'actions'=> array(array('name'=& 'Play!','link'=>'https://apps.facebook.com/itradee/')));

$ result = $ facebook-> api('/ 344722062246773 / feed /','post',$ attachment2);

但是问题是我使用cron作业在特定时间运行此代码我收到此错误:

 致命错误< / b>:未捕获的OAuthException:(#200)用户尚未授权执行此操作的应用程序

p>

这段代码中缺少什么?


div class =h2_lin>解决方案

确定我得到它,我认为发布流权限将工作,但我还需要offline_access权限。


i'm using this code to post to my application page:

$page_info = $facebook->api("/344722062246773?fields=access_token");

$attachment2 = array('message' => $row["nwmsg"],
                  'access_token'  => $page_info['access_token'],
                  'name' => $row["nwnm"],
                  'caption' => $row["nwsubject"],
                  'picture' => 'http://itradegame.com/itrade/' . $row["nwposter"],
                  'description' => $row["nwtext"],
                  'actions' => array(array ('name'=>'Play!','link'=>'https://apps.facebook.com/itradee/')));

 $result = $facebook->api('/344722062246773/feed/','post',$attachment2);

but the problem is that i'm schedualing this code to run in a specific time with a cron job and i recieve this error:

Fatal error</b>:  Uncaught OAuthException: (#200) The user hasn't authorized the application to perform this action

thrown in

but if i run the page including this code manualy from my browser it works fine.

what is missing in this code?

解决方案

ok i got it, i thought the publish stream permission will work but i also needed offline_access permission.

这篇关于为什么发布到我的应用页面无法离线工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆