title: How to handle silent push notification in ionic cordova application?
body: <p>I'm following ionic documentation to create ionic <a href="http://docs.ionic.io/docs/push-from-scratch" rel="nofollow">push notifications</a>. This works fine when the app is in active state. I need to run a function when the app receive a push notification while the app is in background. </p>
  
  <pre><code>$ionicPush.register({
    canShowAlert: false, //Should new pushes show an alert on your screen?
    canSetBadge: true, //Should new pushes be allowed to update app icon badges?
    canPlaySound: false, //Should notifications be allowed to play a sound?
    canRunActionsOnWake: true, // Whether to run auto actions outside the app,
    onNotification: function(notification) {
      // Called for each notification.
    }
  });
  </code></pre>
  
  <p>The issue i'm facing is <code>onNotification</code> callback function does not firing when the app is in background. How do I achieve that using ionic push notification API?  </p>