I am sending push notification from firebase to my Android Application. but when my app is in background firebase onMessageReceived method is not called instead firebase send notification to system for showing notification in system tray. notification appears in system tray but no sound for notification even i have allowed notification sound for my app in system settings. this my code for notification thank you
private void sendNotification(String msg, String title) {
NotificationManager mNotificationManager = (NotificationManager)
this.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, MainActivity.class), 0);
Intent i = new Intent(this,MainActivity.class);
i.putExtra("","");
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(title)
.setStyle(new NotificationCompat.BigTextStyle().bigText(msg))
.setContentText(msg);
//Vibration
mBuilder.setVibrate(new long[] { 200, 400, 600, 800, 1000 });
//LED
mBuilder.setLights(Color.MAGENTA, 1000, 1000);
//Ton
mBuilder.setSound(Uri.parse("android.resource://"
+ getApplicationContext().getPackageName() + "/" + R.raw.circles_notif));
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(0, mBuilder.build());
}