When i Try to Insert in Google Plus Domain it gives me a Error for this .
I used the Version 2.1
$this->client->refreshToken($con[0]->secret);
$newtoken = $this->client->getAccessToken();
$this->client->setAccessToken($newtoken);
$activityAccess = new Google_Acl();
$activityAccess->setDomainRestricted(true);
$object = new Google_ActivityObject();
$originalContent = $object->setOriginalContent('Happy me');
$originalContent = $object->setContent('Happy me');
$originalContent = $object->setObjectType('domain');
$body = explode(".", $args["post"]);
$activity = new Google_Activity();
$postBody = $activity->setTitle($body[0]);
$postBody = $activity->setVerb('post');
$postBody = $activity->setKind('plus#activity');
$postBody = $activity->setObject($originalContent);
$postBody = $activity->setAccess($activityAccess);
$data = $this->connect->activities->insert('me', $postBody);
it gives me an error .
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: 4096</p>
<p>Message: Argument 1 passed to Google_Activity::setObject() must be an instance of Google_ActivityObject
, null given, called in /home/socialsu/public_html/application/autopost/Google_plus.php on line 179 and
defined</p>
<p>Filename: contrib/Google_PlusDomainsServices.php</p>
<p>Line Number: 635</p>
</div>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: 4096</p>
<p>Message: Argument 2 passed to Google_ActivitiesServiceResource::insert() must be an instance of Google_Activity
, null given, called in /home/socialsu/public_html/application/autopost/Google_plus.php on line 182 and
defined</p>
<p>Filename: contrib/Google_PlusDomainsServices.php</p>
<p>Line Number: 54</p>
</div>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined index: type</p>
<p>Filename: io/Google_REST.php</p>
<p>Line Number: 98</p>
</div>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined index: value</p>
<p>Filename: io/Google_REST.php</p>
<p>Line Number: 109</p>
</div>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>An uncaught Exception was encountered</h4>
<p>Type: Google_ServiceException</p>
<p>Message: Error calling POST https://www.googleapis.com/plus/v1domains/people/me/activities?postBody
=&key=AIzasdasdasdaSyA4z1j-_cVQD1bHsdasd7fN6d1LuFgw9P-26VAQ: (403) Forbidden</p>
<p>Filename: /home/socialsu/public_html/vendor/google/src/io/Google_REST.php</p>
<p>Line Number: 66</p>
</div>
Can anyone Help me. pls