Firebase Notification

14 views
Skip to first unread message

jesurk...@gmail.com

unread,
May 26, 2017, 11:04:12 AM5/26/17
to Firebase Google Group
Hii,, Firebase Notification not Working in Background, Sometimes Even it is Alreay Running then is only Sounds, But Do not Display Any Notification, How can i Solve This issue?
 please Help me.  

Here is My Code:

if (remoteMessage.getData().size() > 0) {
Log.d(TAG, "Message data: " + remoteMessage.getData());

Intent intent = new Intent(this, LoginActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 1410,
intent, PendingIntent.FLAG_ONE_SHOT);

Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new
NotificationCompat.Builder(this)
.setLargeIcon(BitmapFactory.decodeResource(this.getResources(), R.drawable.securetrade_final_logo))
.setContentTitle(remoteMessage.getData().get("title"))
.setContentText(remoteMessage.getData().get("body"))
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);

NotificationManager notificationManager =
(NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);

notificationManager.notify(1410, notificationBuilder.build());


Thnx;
Krishna Jesur
Reply all
Reply to author
Forward
0 new messages