java - Displaying Received Push Notifications -


I am implementing the code.

Everything is fine, I can successfully receive notifications.

If you check the 70th line of the GCMIntentService.java file, it resonates this line for the logcat:

  I / GCM Demo (6653): Working ... 1/5 @ 8656981 I / GCM Demo (6653): Work ... 2/5 @ 8,657,982 I / GCM Demo (6653): Work ... 3/5 @ 8,658,983 I / GCM Demo (6653): Work ... 4/5 @ 8659983 I / GCM Demo (6653): Work ... 5/5 @ 8,660,984 I / GCM Demo (6653): Full Work @ 8661,985 I / GCM Demo (6653 ): Received: [{msg = messagehere, = SENDERIDHERE, android.support.content.wakelockid = 3, collapse_key = do_not_collapse}]  

Received my device information data Is, but there is a notification not appear on the device's status bar. Nothing is happening

Can you tell me why these push notifications are not displayed on my device, only in logcat?

Update

  1. This is my sendNotification () method:

      Private zero sendNotification (string msg) {mNotificationManager = (NotificationManager) this.getSystemService (Context.NOTIFICATION_SERVICE); Pending content contentant = Pending .entget activity (this, 0, new intent (this, main activity square), 0); MBuilder NotificationCompat.Builder = New NotificationCompat.Builder (this) .setContentTitle ("GCM Notification") .setStyle (New NotificationCompat.BigTextStyle () .bigText (MSG)) .setContentText (MSG); MBuilder.setContentIntent (contentIntent); MNotificationManager.notify (NOTIFICATION_ID, mbuilder.build ()); }  

Can you try this method Are ... this one is working for me. Although it is almost identical to you ...

  sending a private zero send (string msg) {int uniqueId = (int) (System.currentTimeMillis () & amp; 0xfffffff); MNotificationManager = (Notification Manager) this.getSystemService (Reference.NETIFICATION_SERVICE); Intent = intent (new, new, main activity); Intent.addFlags (Int. FLAG_ACTIVITY_CLEAR_TOP | Intent. FLAG_ACTIVITY_SINGLE_TOP | Intent. FLAG_ACTIVITY_NEW_TASK); Pending Content ContentIntent = Pending.textGet Activity (this, unique ID, intent, pending entity.FLAG_UPDATE_CURRENT); mBuilder = new NotificationCompat.Builder (it) .setSmallIcon (R.drawable.ic_launcher) .setContentTitle ( "Hello") .setStyle (New NotificationCompat.BigTextStyle (). bigText ( "Hello")) .setContentText ( "It NotificationCompat.Builder Your information material is ") .setAutoCancel (true) mbuilder.setContentIntent (contentIntent); MNotificationManager.notify (uniqueId, mbuilder.build ()); }  

Getting a phone is quite different. You can do this by using a Wakelock like this:

You set up your notifications :.

  Wakelock screenOn = ((PowerManager) getSystemService (POWER_SERVICE) newWakeLock (PowerManager. SCREEN_BRIGHT_WAKE_LOCK | Power Manager. ACQUIRE_CAUSES_WAKEUP, "test"); ScreenOn.acquire ();  

And yes, when you require on tap does not need it, so Vkelok after not sure (5 seconds to release or Notiftn, as you need):

  .release () on the screen;  

Comments