title: Google Calendar Push Notifications SetUp
body: <p>I'm trying to setup a Push Notifications for Google Calendar using PHP and V3 api.</p>
  <p>I've got the Auth2.0 Permission and I'm able to create events on google from my application. Now I want to know when a user makes any change on google calendar (CRUD Operations).</p>
  <p>This is my code:</p>
  <pre><code>private $imageService;
  public $google_client;
  public $google_calendar;
  
  public function __construct()
  {
      $this-&gt;imageService = new ImageService();
      $this-&gt;google_client = new Google_Client();
      $this-&gt;google_client-&gt;setApplicationName($_ENV['GOOGLE_APP_NAME']);
      $this-&gt;google_client-&gt;setDeveloperKey($_ENV['GOOGLE_API_KEY']);
      $this-&gt;google_client-&gt;setClientId($_ENV['CLIENT_ID']);
      $this-&gt;google_client-&gt;setClientSecret($_ENV['CLIENT_SECRET']);
      $this-&gt;google_client-&gt;setAccessType('offline');
      $this-&gt;google_client-&gt;setIncludeGrantedScopes(true);
      $this-&gt;google_client-&gt;setScopes(array('email', 'profile', 'https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/calendar'));
      $this-&gt;google_calendar = new Google_Service_Calendar($this-&gt;google_client);
  
  }
  
   public function googleCalendarWatch($uuid){
  
      $channel =  new Google_Service_Calendar_Channel($this-&gt;google_client);
      $channel-&gt;setId($uuid);
      $channel-&gt;setType('web_hook');
      $channel-&gt;setAddress(&quot;https://example.com/google/googleNotifications&quot;);
      $channel-&gt;setExpiration(&quot;1919995862000&quot;);
      $this-&gt;google_calendar-&gt;events-&gt;watch('primary', $channel);
  
  }
  </code></pre>
  <p>And this is the output:</p>
  <pre><code>Google_Service_Calendar_Channel Object (
      [internal_gapi_mappings:protected] =&gt; Array ( ) 
      [address] =&gt; 
      [expiration] =&gt; 1426272395000 
      [id] =&gt; aee2b430-34bf-42bc-a597-ada46db42799 
      [kind] =&gt; api#channel 
      [params] =&gt; 
      [payload] =&gt; 
      [resourceId] =&gt; 51IKGpOwCJ6EMraQMUc1_04MODk 
      [resourceUri] =&gt; https://www.googleapis.com/calendar/v3/calendars/primary/events?key=AIzaSyBFUvq3OZO6ugAKvz7l8NgLS0V6DUJq8Vc&amp;alt=json 
      [token] =&gt; 
      [type] =&gt; 
      [modelData:protected] =&gt; Array ( ) 
      [processed:protected] =&gt; Array ( ) )
  </code></pre>
  <p>This far I don't know why address returns null, maybe that's the problem. But I don't know how to fix it.</p>
  <p>Also reading this: <a href="https://stackoverflow.com/questions/26730263/how-to-get-event-details-from-google-calendar">#26730263</a> and looking my own code there's no much difference.</p>
  <p>I did all the stuff that google says, Register domain, add credentials, api key, push domain allowed and all..</p>