I have created notification in my app using volley library it's calling to firebase server my problem is when i push the notification in specific user(device) the update notification only showing and unread notification count number is not showing, so i want to unread notification count number how to display in my app icon. help me ..
My code is:
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG="MyMessageservice";
RemoteMessage remoteMessage;
@Override
public void onMessageReceived(RemoteMessage remoteMessage){
String title=remoteMessage.getNotification().getTitle();
String message=remoteMessage.getNotification().getBody();
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// String click_action=remoteMessage.getNotification().getClickAction();
Intent intent=new Intent(this,VisitorList.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
Uri notificattionSound= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationbuilder = new NotificationCompat.Builder(this);
notificationbuilder.setContentTitle(title);
notificationbuilder.setContentText(message);
notificationbuilder.setAutoCancel(true);
notificationbuilder.setSound(notificattionSound);
notificationbuilder.setSmallIcon(R.drawable.ic_launcher);
notificationbuilder.setContentIntent(pendingIntent);
notificationbuilder.setAutoCancel(true);
notificationManager.notify(0, notificationbuilder.build());
}
}