I want to set a custom notification sound from a raw mp3 or wav file in my app. Below is my code
private void sendMyNotification(String message) { Intent
Late but might be helpful to some one, just add below line in your NotificationCompat.Builder() instance:
.setSound("your sound uri",AudioManager.STREAM_NOTIFICATION)
Note: As NotificationCompat.Builder() is backward compatible , so AudioAttributes etc in notification channel is not required
NotificationCompat.Builder()
AudioAttributes