title: GCM couldnt receive message
body: <p>Server:</p>
  
  <pre><code>var GCM = require('gcm').GCM;
  
  var apiKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX';
  var gcm = new GCM(apiKey);
  
  var message = {
      registration_id: 'APA91bEAjoFkJu6KF-UgbLWhB-qbHs6fHeYANpB1XFT4Y8NQbjaOJPQ_PItvBpPF5Zi3thEB6H-_0SXkT7JcYB4yGMOa-jZyeygkxTzy56bbqG8zqLSGouFpSr4F5uGvHzEywH_E3Lko8W57XiCe8F_NJGSvkA0i1jAvXkVvCYTzEyar-OAec10', // required
      collapse_key: 'Collapse key', 
      'data.key1': 'value1',
      'data.key2': 'value2'
  };
  
  gcm.send(message, function(err, messageId){
      if (err) {
          console.log("Something has gone wrong!");
      } else {
          console.log("Sent with message ID: ", messageId);
      }
  });
  </code></pre>
  
  <p>Client :</p>
  
  <pre><code>public class GcmMessageHandler extends IntentService {
  
       String mes;
       private Handler handler;
      public GcmMessageHandler() {
          super("GcmMessageHandler");
      }
  
      @Override
      public void onCreate() {
          // TODO Auto-generated method stub
          super.onCreate();
          handler = new Handler();
      }
      @Override
      protected void onHandleIntent(Intent intent) {
          Bundle extras = intent.getExtras();
  
          GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
          // The getMessageType() intent parameter must be the intent you received
          // in your BroadcastReceiver.
          String messageType = gcm.getMessageType(intent);
  
         mes = extras.getString("title");
         showToast();
         Log.i("GCM", "Received : (" +messageType+")  "+extras.getString("title"));
  
          GcmBroadcastReceiver.completeWakefulIntent(intent);
  
      }
  
      public void showToast(){
          handler.post(new Runnable() {
              public void run() {
                  Toast.makeText(getApplicationContext(),mes , Toast.LENGTH_LONG).show();
              }
           });
  
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
  
          // Explicitly specify that GcmMessageHandler will handle the intent.
          ComponentName comp = new ComponentName(context.getPackageName(),
                  GcmMessageHandler.class.getName());
  
          // Start the service, keeping the device awake while it is launching.
          startWakefulService(context, (intent.setComponent(comp)));
          setResultCode(Activity.RESULT_OK);
      }
  }
  </code></pre>
  
  <p>It worked yesterday, but now it does not show anything on a device. I have no idea what wrong is. I didn't change anything. Can someone have any idea about it? (I am working on a real device)</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>It works on emulator.</p>
  
  <p>MANIFEST:</p>
  
  <blockquote>
    <p> </p>
  
  <pre><code>&lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="17" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;     
  </code></pre>
    
    <p> </p>
  
  <pre><code>&lt;application
  
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" 
      &gt;
      &lt;activity
          android:name="com.hmkcode.android.gcm.MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;receiver
          android:name=".GcmBroadcastReceiver"
          android:permission="com.google.android.c2dm.permission.SEND" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
              &lt;category android:name="com.hmkcode.android.gcm" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
      &lt;service android:name=".GcmMessageHandler" /&gt;
  
      &lt;meta-data android:name="com.google.android.gms.version"
         android:value="@integer/google_play_services_version" /&gt;
  &lt;/application&gt;
  </code></pre>
    
    <p></p>
  </blockquote>