I've searched the web and found some post related to setting sound on android notification and followed them but in my case I am getting default notification sound on android notification. Here's my code:
builder.setSound(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.notification_message));
I've also followed this post, but no luck.
For your information: I've played the URI using MediaPlayer and it's working fine then.
Part of my code:
NotificationCompat.Builder builder = new NotificationCompat.Builder(appContext);
builder.setContentTitle(message.notificationTitle);
builder.setContentText(message.notificationSubtitle);
builder.setTicker(message.notificationTitle);
builder.setSmallIcon(R.drawable.ic_action_inbox);
Uri uri = Uri.parse("android.resource://" + appContext.getPackageName() + "/" + R.raw.notification_message);
builder.setSound(uri);
builder.setVibrate(new long[]{1000, 1000, 1000});
builder.build();
Can anyone explain what's the issue. How to do it? I'm stuck :(