2013-08-22 3 views
0

Android에서 GCM PushNotification을 구현했으며 완벽하게 작동합니다. 정기적으로 알림을받습니다. 장치 트레이에서 알림을 받았을 때 그 알림을 클릭하지 않은 상태에서 다른 알림이 나타나면 잠시 후 두 가지 알림 또는 최신 알림 만 표시된다는 쿼리가 하나 있습니다.GCM을 사용하는 Android PushNotification

지금은 최신 정보 만 받고 있습니다.

도움이 될 것입니다.

+0

에 UNIQUEID를 전달하여 이전을 대체하지 않습니다 모든 알림과 새를 표시 할 수 있습니다 이 메소드에서 "0"을 전달하고 있었다 : notificationManager.notify ((int) when, notification); 최신 알림이 표시되었습니다. –

+0

당신은 당신이 구형과 구형 모두 알림 디스플레이를 표시 할 수 있다는 것을 의미합니까? – dipali

+0

@dipali : 우리는 오래된 것뿐만 아니라 최신 것을 표시 할 수 있습니다 .. –

답변

1

예 내가 이걸에 솔루션을 가지고 mNotificationManager.notify (UNIQUEID, mBuilder.build())

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) 
    .setSmallIcon(R.drawable.icon) 
    .setContentTitle("FleeGroups Notification") 
    .setStyle(new NotificationCompat.BigTextStyle() 
    .bigText(message)) 
    .setContentText(message) 
    .setAutoCancel(true) 
    .setDefaults(Notification.DEFAULT_ALL); 
mBuilder.setContentIntent(resultPendingIntent); 
mNotificationManager.notify(uniqueId, mBuilder.build()); 
관련 문제