title: Parse notifications on android won't work
body: <p>I am trying to set up Parse push notifications on android for some time now.
  I followed different tutorials, and I am trying to send the notifications from their web platform, but nothing seems to work. Here is what I have tried so far.</p>
  
  <p>Here is the onCreate method of my Application class</p>
  
  <pre><code>@Override
      public void onCreate() {
          super.onCreate();
          Log.i("PushNotifications","PARSE initialize");
  
          Parse.initialize(this, "******************************", "*****************************");
          ParseInstallation.getCurrentInstallation().saveInBackground();
  
          ParsePush.subscribeInBackground("", new SaveCallback() {
              @Override
              public void done(ParseException e) {
                  if (e == null) {
                      Log.i("PushNotifications","com.parse.push" + " successfully subscribed to the broadcast channel.");
                  } else {
                      Log.i("PushNotifications","com.parse.push" + " failed to subscribe for push");
                  }
              }
          });
  
      }
  </code></pre>
  
  <p>This is called successfully, as I get the log</p>
  
  <blockquote>
    <p>successfully subscribed to the broadcast channel.</p>
  </blockquote>
  
  <p>Also here is some relevant content of my manifest file:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
  &lt;permission android:name="com.my.app.permission.C2D_MESSAGE" android:protectionLevel="signature" /&gt;
  &lt;uses-permission android:name="com.my.app.permission.C2D_MESSAGE" /&gt;
  &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
  &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
  &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
  
  &lt;uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_CONTACTS"/&gt;
  &lt;uses-permission android:name="android.permission.SEND_SMS" /&gt;
  &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;uses-feature android:name="android.hardware.camera" /&gt;
  
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:name=".App"
      android:theme="@style/AppTheme"&gt;
  
      &lt;activity
          android:name=".activities.MainActivity"
          android:launchMode="standard"
          android:screenOrientation="sensorPortrait"&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;meta-data android:name="com.parse.push.gcm_sender_id" android:value="id:123456789" /&gt;
      &lt;meta-data android:name="com.parse.push.notification_icon" android:resource="@drawable/ic_launcher"/&gt;
  
      &lt;service android:name="com.parse.PushService" /&gt;
      &lt;receiver android:name="com.parse.ParseBroadcastReceiver"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
              &lt;action android:name="android.intent.action.USER_PRESENT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
      &lt;receiver android:name="com.parse.ParsePushBroadcastReceiver"
          android:exported="false"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.parse.push.intent.RECEIVE" /&gt;
              &lt;action android:name="com.parse.push.intent.DELETE" /&gt;
              &lt;action android:name="com.parse.push.intent.OPEN" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
      &lt;!--com.parse.GcmBroadcastReceiver"--&gt;
      &lt;receiver android:name="com.parse.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;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
              &lt;category android:name="com.my.app" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
  &lt;/application&gt;
  </code></pre>
  
  <p>When I try sending push from Parse website, nothing happens.</p>
  
  <p>As this is not working, I tried implementing my own GcmBroadcastReceiver and changing it in the manifest. </p>
  
  <pre><code>&lt;receiver android:name=".receivers.MyCustomReceiver"
              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;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
                  &lt;category android:name="com.my.app" /&gt;
              &lt;/intent-filter&gt;
  &lt;/receiver&gt;
  </code></pre>
  
  <p>And</p>
  
  <pre><code>public class MyCustomReceiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
          Log.i("PushNotifications","MyCustomReceiver");
      }
  }
  </code></pre>
  
  <p>Without success. </p>
  
  <p>Then I also tried creating my own ParsePushBroadcastReceiver (by inheriting from ParsePushBroadcastReceiver). </p>
  
  <pre><code>&lt;receiver android:name=".receivers.CustomParseReceiver"
              android:exported="false"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.parse.push.intent.RECEIVE" /&gt;
                  &lt;action android:name="com.parse.push.intent.DELETE" /&gt;
                  &lt;action android:name="com.parse.push.intent.OPEN" /&gt;
              &lt;/intent-filter&gt;
   &lt;/receiver&gt;
  </code></pre>
  
  <p>And </p>
  
  <pre><code>public class CustomParseReceiver extends ParsePushBroadcastReceiver {
  
     @Override
      protected Notification getNotification(Context context, Intent intent) {
          Log.i("PushNotifications","PARSE getNotification");
          return null;
      }
  
      @Override
      protected void onPushOpen(Context context, Intent intent) {
          Log.i("PushNotifications","PARSE onPushOpen");
      }
  
      @Override
      protected void onPushReceive(Context context, Intent intent) {
          Log.i("PushNotifications","PARSE onPushReceive");        
      }
  
      private JSONObject getDataFromIntent(Intent intent) {
          Log.i("PushNotifications","PARSE getDataFromIntent");            
      }
  
  }
  </code></pre>
  
  <p>It did not work either.</p>
  
  <p>The thing is.. when I create my own GCM BroadcastReceiver and I send a notification from my own server (with some small php script), the notification is successfully received.</p>
  
  <p>I really wonder what's wrong with my implementation of the client side parse notifications system.  </p>
  
  <p>Any hint on where the problem might come from?</p>