title: Phonegap PushPlugin message event gets called twice
body: <p>I'm currently developing a Phonegap 3.0 application for android and iOS. I added the <a href="https://github.com/phonegap-build/PushPlugin" rel="nofollow">PushPlugin</a> and nearly everything works fine on android except for 2 things:</p>
  
  <p>1.
  When I receive a push notification and my app isn't currently in the foreground, the message is shown in my notification bar. As soon as I click the notification the app starts and the notification message is shown twice. The shown message is a simple javascript alert with the notification data, which I added in the "onNotificationGCM" message-event. </p>
  
  <p>This event fires the first time, when the notification is added in the notification bar and the second time when I click the notification and my app starts. Hence the alert function with my message gets called twice and 2 alerts are shown.</p>
  
  <p>Here is s short snippet from my code: </p>
  
  <pre><code>onNotificationGCM: function (e) {
      switch( e.event )
      {
          case 'registered':
              if ( e.regid.length &gt; 0 )
              {
                  console.log('Regid ' + e.regid);
              }
          break;
  
          case 'message':
            // this is the actual push notification. its format depends on the data model from the push server
            console.log('Entered message');
            alert('message = '+e.message);
          break;
      }
  }
  </code></pre>
  
  <p>So my question is, how can I prevent this situation and my notification is only shown once when I open the app?</p>
  
  <p>2.
  I also have this problem, which is already posted as an issue in the the github repo: <a href="https://github.com/phonegap-build/PushPlugin/issues/85" rel="nofollow">Issue</a> </p>
  
  <p>As soon as I exit my app (not over the "manage applications" menu in the settings), I cannot receive any push notifications. I tried to start my app on boot, but this didn't work. But when I start app, all notifications are displayed.</p>
  
  <p>Maybe someone already knows a little workaround.</p>
  
  <p>I also noticed, that the PushPlugin uses the deprecated GCM methods. Does anyone know if this could be the reason, why the notfications won't show even when the app is not running?</p>