unifcationengine not working with google+ sharing

谁都会走 提交于 2019-12-04 21:14:48

Can you please change the receivers part as follows and check whether you can post message

"receivers" => array(

array(
"name"=> "page",

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

)

I could able to send by using following sample code. Can you please try with this?

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

?>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!