嗨,当我用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];发布于 2017-01-23 06:09:17
请您按以下方式更改接收方部分,并检查是否可以发送消息
“接收器”=>阵列(
array(
"name"=> "page",
"id"=> "PAGE_ID"// PAGE_ID is id of the page which you have to post message
))
发布于 2017-01-27 04:24:30
我可以使用下面的示例代码发送。你能试试这个吗?
<?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);
?>https://stackoverflow.com/questions/41741241
复制相似问题