【问题标题】:unifcationengine not working with google+ sharingunifcationengine 不适用于 google+ 共享
【发布时间】:2017-01-19 11:57:38
【问题描述】:

嗨,当我通过 google plus 中的统一引擎 api 发送消息时,我收到了这个错误

stdClass Object
(
    [Status] => stdClass Object
        (
            [GP] => stdClass Object
                (
                    [status] => 504
                    [info] => 504 Connection Error: Post https://googleplus-v2connector.unificationengine
.com/v2/message/send: EOF: 
                )

        )

    [URIs] => Array
        (
        )

)

unificationengine api 可以在 facebook 和 twitter 上正常工作,但不能在 googleplus 上工作

我的代码是

$app = new UEApp("APP_KEY","APP_SECRATE");
$user = new UEUser("USER_KEY","USER_SECRET");
$connection = $user->add_connection('google', "googleplus",  $access_token);
$options = array(
    "receivers" => array(
         array(
                "name"=> "Me"
         )
     ),
     "message"=>array(
         "subject"=>"ABC",
          "body"=> "",
          "image"=>$shareImageUrl,
           "link"=>array(
                "uri"=> $link,
                 "description"=> "",
                 "title"=>"Click here for view"
            )
       )
    );
//Send the message and get their uris
$uris = $connection->send_message($options);
print_r($uris);
$myArray = explode('/', $uris[0]);
return $myArray[3];

【问题讨论】:

    标签: php unificationengine


    【解决方案1】:

    能否请您将接收者部分更改如下,并检查您是否可以发布消息

    "接收者" => 数组(

    array(
    "name"=> "page",
    
    "id"=> "PAGE_ID"// PAGE_ID is id of the page which you have to post message
    )
    

    )

    【讨论】:

    • 现在我在 fb 和 twitter+ 共享中遇到了一些错误,并且在 google 中也出现了相同的错误,并且共享“cURL 错误 28:操作在 10000 毫秒后超时,接收到 0 个字节”现在我无法共享任何消息在 fb、twitter 和 googleplus 上
    • 现在我在其他工作 api {"status":504,"info":"504 Connection Error: Post pinterest-v2connector.unificationengine.com/v2/test: dial tcp 52.210.137.103:443: getsockopt: connection拒绝”}
    • 如何获取 PAGE_ID
    • 请提供您尝试过的示例代码。
    • 我现在用过这个但是我用了很多方法。"receivers" => array(array("name"=>"page", "id"=>"106183509307451290442") ),我已将页面替换为“我”,但出现相同的错误
    【解决方案2】:

    我可以使用以下示例代码发送。你可以试试这个吗?

    <?php
    
        require 'vendor/autoload.php';
        use UnificationEngine\Models\UEUser;
    
        $user = new UEUser("USER_ACCESSKEY","USER_ACCESSSECRET");
    
        $connection = $user->add_connection("google","googleplus","ACCESS_TOKEN@googleplus.com/?id=PAGE_ID&refresh_token=REFRESH_TOKEN&is_profile=false");
    
        $options = array(
            "receivers" => array(
                array(
                    "name"=> "page",
                    "id"=> "PAGE_ID"// page id in which page you have to send
                )
            ),
            "message"=>array(
                "subject"=>"ABC111",
                "body"=> "",
                "image"=>"http://politibits.blogs.tuscaloosanews.com/files/2010/07/sanford_big_dummy_navy_shirt.jpg",
                "link"=>array(
                    "uri"=> "http://google.com",
                    "description"=> "",
                    "title"=>"Click here for view"
                )
            )
        );
    
        //Send the message and get their uris
        $uris = $connection->send_message($options); 
    
        print_r($uris);
    
    ?>
    

    【讨论】:

    • 我在使用相同代码时收到此错误。 tdClass Object [Status] => stdClass Object ( [google] => stdClass Object ( [status] => 403 [info] => 访问未配置。Google+ Pages API 之前未在项目 38616112478 中使用或已禁用。启用访问console.developers.google.com/apis/api/plusPages /overview?project=38616112478 然后重试。如果您最近启用了此 API,请等待几分钟让该操作传播到我们的系统并重试。:)
    • 看起来像是权限问题。请分享您给出的范围。
    • 现在我正在使用开发者帐户,但我无法添加“plusPages”API。错误是:API“plusPages”不存在或您无权访问它。现在我正在使用开发者帐户但无法设置此权限如果有任何想法请提供给我谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-19
    • 1970-01-01
    • 2017-12-04
    • 1970-01-01
    • 2015-09-21
    • 1970-01-01
    相关资源
    最近更新 更多