title: What is the proper way to manually handle every single GCM push?
body: <p>I've got a weird issue with my Android GCM implementation.</p>
  
  <p>This is the code where I handle GCM notifications:</p>
  
  <pre><code>public class GCMMessageHandler extends GcmListenerService {
  
      @Override
      public void onMessageReceived(String from, Bundle data) {
          super.onMessageReceived(from, data);
          Log.i(this.getClass().getSimpleName(), "GCM push received!");
  
          ACNotification notification = new ACNotification(getApplicationContext(), data);
          notification.handleNotification();
      }
  }
  </code></pre>
  
  <p>Basically, what this does, it passes notification data to my class called <code>ACNotification</code>, which then reads the data and displays a notification using <code>Notification.Builder</code>.</p>
  
  <p>This works perfectly when app is in the foreground. But once the user closes the app, it seems like this code never executes, but the app somehow handles the notification on its own.</p>
  
  <p>It still displays the notification, but Android does it on its own. It doesn't set the proper notification icon (it just uses the Android stock ic_launcher icon).</p>
  
  <p>Any idea what I'm doing wrong? How can I assure that I will be able to handle each notification on my own?</p>