title: Sending data / payload to the Google Chrome Push Notification with Javascript
body: <p>I'm working on the Google Chrome Push Notification and I'm trying to send the payload to the google chrome worker but, I have no idea how I receive this payload.</p>
  
  <p>I have an API to create and save the notifications in my database and I need send the values through the <code>https://android.googleapis.com/gcm/send</code> and receive on the worker.js</p>
  
  <p>This is my worker.js</p>
  
  <pre><code>    self.addEventListener('push', function(event) {
        var title = 'Yay a message.';
        var body = 'We have received a push message.';
        var icon = '/images/icon-192x192.png';
        var tag = 'simple-push-demo-notification-tag';
  
        event.waitUntil(
          self.registration.showNotification(title, {
            body: body,
            icon: icon,
            tag: tag
          })
        );
      });
  </code></pre>
  
  <p>And this is how I'm calling the GCM </p>
  
  <pre><code>curl --header "Authorization: key=AIzaSyDQjYDxeS9MM0LcJm3oR6B7MU7Ad2x2Vqc" --header  "Content-Type: application/json" https://android.googleapis.com/gcm/send -d "{ \"data\":{\"foo\":\"bar\"}, \"registration_ids\":[\"APA91bGqJpCmyCnSHLjY6STaBQEumz3eFY9r-2CHTtbsUMzBttq0crU3nEXzzU9TxNpsYeFmjA27urSaszKtA0WWC3yez1hhneLjbwJqlRdc_Yj1EiqLHluVwHB6V4FNdXdKb_gc_-7rbkYkypI3MtHpEaJbWsj6M5Pgs4nKqQ2R-WNho82mnRU\"]}"
  </code></pre>
  
  <p>I tried to get <code>event.data</code> but, this is undefined.</p>
  
  <p>Does anyone have any idea or sugestion?</p>