title: Android Push notification (slow)
body: <p>I have IIS server and send Notification with GoogleCloudMessaging to phone. It takes about 10 minutes to receive the message on android device. It's huge time form my project. do you know how decrease the time ? </p>
  
  <p>That is server C# code (Using PushSharp)</p>
  
  <p>var push = new PushBroker();</p>
  
  <pre><code>        //Wire up the events for all the services that the broker registers
          /*NotificationSent s = new NotificationSent()
          push.OnNotificationSent += "NotificationSent";
          push.OnChannelException += "ChannelException";
          push.OnServiceException += "ServiceException";
          push.OnNotificationFailed += "NotificationFailed";
          push.OnDeviceSubscriptionExpired += "DeviceSubscriptionExpired";
          push.OnDeviceSubscriptionChanged += "DeviceSubscriptionChanged";
          push.OnChannelCreated += "ChannelCreated";
          push.OnChannelDestroyed += "ChannelDestroyed";
          */
  
          push.RegisterGcmService(new GcmPushChannelSettings("MY API KEY"));
  
          push.QueueNotification(new GcmNotification().
              ForDeviceRegistrationId("PHONE REGISTRATION ID")
                                .WithJson(@"{""alert"":""Name !"",""badge"":7,""sound"":""sound.caf""}"));
  
  
          //Stop and wait for the queues to drains
          push.StopAllServices();
  </code></pre>
  
  <p>And This Is my receiver, </p>
  
  <p>public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {</p>
  
  <pre><code>@Override
  public void onReceive(Context context, Intent intent) {
       // Explicitly specify that GcmIntentService will handle the intent.
      ComponentName comp = new ComponentName(context.getPackageName(),
              GcmIntentService.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>}</p>