簡體   English   中英

unifcationengine無法與Google+共享一起使用

[英]unifcationengine not working with google+ sharing

嗨,當我通過Google中的統一引擎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];

您能否按以下方式更改接收器部分並檢查是否可以發布消息

“接收器” =>數組(

array(
"name"=> "page",

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

我可以使用以下示例代碼進行發送。 你可以試一下嗎?

<?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);

?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM