title: notification sound is not playing in android 10
body: <p>I am sending notifications through Firebase Cloud Messaging But the sound and vibration are not playing on my phone which has Android 10 but Sound is playing in the android emulator which has android 9. As it is an emulator I can not say it having vibration or not.</p>
  
  <p>I already checked other StackOverflow posts but can not get the solution.</p>
  
  <p>Here is my code-</p>
  
  <pre><code>import android.app.NotificationChannel;
  import android.app.NotificationManager;
  import android.app.PendingIntent;
  import android.content.Context;
  import android.content.Intent;
  import android.media.RingtoneManager;
  import android.net.Uri;
  import android.os.Build;
  import android.util.Log;
  
  import androidx.core.app.NotificationCompat;
  
  import com.google.firebase.messaging.FirebaseMessagingService;
  import com.google.firebase.messaging.RemoteMessage;
  
  /**
   * NOTE: There can only be one service in each app that receives FCM messages. If multiple
   * are declared in the Manifest then the first one will be chosen.
   * &lt;p&gt;
   * In order to make this Java sample functional, you must remove the following from the Kotlin messaging
   * service in the AndroidManifest.xml:
   * &lt;p&gt;
   * &lt;intent-filter&gt;
   * &lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&gt;
   * &lt;/intent-filter&gt;
   */
  public class MyFirebaseMessagingService extends FirebaseMessagingService {
  
      private static final String TAG = "MyFirebaseMsgService";
  
      /**
       * Called when message is received.
       *
       * @param remoteMessage Object representing the message received from Firebase Cloud Messaging.
       */
      @Override
      public void onMessageReceived(RemoteMessage remoteMessage) {
  
  
          Log.d(TAG, "From: " + remoteMessage.getFrom());
  
          if (remoteMessage.getData().size() &gt; 0) {
              Log.d(TAG, "Message data payload: " + remoteMessage.getData());
  
  
          }
  
          if (remoteMessage.getNotification() != null) {
              Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
          }
  
  
      }
  
  
      private void handleNow() {
          Log.d(TAG, "Short lived task is done.");
      }
  
  
      private void sendNotification(String messageBody) {
          Intent intent = new Intent(this, MainActivity.class);
          intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
          PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
                  PendingIntent.FLAG_ONE_SHOT);
  
          String channelId = getString(R.string.default_notification_channel_id);
          Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
          NotificationCompat.Builder notificationBuilder =
                  new NotificationCompat.Builder(this, channelId)
                          .setSmallIcon(R.drawable.logo)
                          .setContentTitle("Brain Filter")
                          .setColor(getResources().getColor(R.color.colorAccent))
                          .setContentText(messageBody)
                          .setAutoCancel(true)
                          .setSound(defaultSoundUri)
                          .setContentIntent(pendingIntent);
  
          NotificationManager notificationManager =
                  (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  
          // Since android Oreo notification channel is needed.
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
              NotificationChannel channel = new NotificationChannel(channelId,
                      "Channel human readable title",
                      NotificationManager.IMPORTANCE_DEFAULT);
              notificationManager.createNotificationChannel(channel);
          }
  
          notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
      }
  }
  </code></pre>
  
  <p>I also added Vibration and Internet permission in the manifest.xml and always enable sound in Firebase console when pushing any notification.</p>