繁体   English   中英

Facebook Graph API签到

[英]Facebook Graph API checkins

我正在尝试使用脱机访问在用户的供稿中发布签到。 但是我一直收到各种错误,但是如果我尝试发布消息/视频/图片,一切都会很好。

所以这是我的代码:

public function postCheckIn()
{
    $post=array(
        'access_token'=>  $this->token,
        'message'=>'Test check-in!',
        'place'=>'172822562765332',
        'coordinates' => json_encode(array(
               'latitude'  => '55.772855818478',
               'longitude' => '37.687225341797'
             ))
    );
    try
    {
        $res=$this->fb->api('/'.$this->uid.'/checkins', 'POST', $post);
    }
    catch(FacebookApiException $e)
    {
        $res=$e->getMessage();
    }
    return $res;
}

当我运行此代码时,出现异常:

需要有效的地方页面ID

我使用https://developers.facebook.com/tools/explorer/检查了这个地方,它返回了一些有效的信息。

顺便说一句,我有publish_checkins权限。

我是否总是需要提供placeId和坐标? 我可以提供其中一个参数吗? 以及如何使其工作?

谢谢。

您始终可以使用publish_stream,因为它可以解决脱机发布遇到的任何问题。

http://developers.facebook.com/docs/reference/rest/stream.publish/

我想这就是为什么https://graph.facebook.com/172822562765332没有纬度经度数据

这是一个有效的代码段...您的参数对我来说看起来是正确的formPost-> addField(“ message”,message); formPost-> addField(“ place”,place); formPost-> addField(“ coordinates”,coordinates); formPost-> addField(“ tags”,tags); formPost-> addField(“ application”,“ {\\” id \\“:\\” 204​​264309603362 \\“,\\” name \\“:\\” mobile borg \\“}”); qDebug()<<“” FacebookGraph :: post“ <

    QString feed=url+"me/checkins";

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM