Android push notification how to play default sound

LS_ picture LS_ · Sep 3, 2014 · Viewed 10k times · Source

I'm using MixPanel to send push notification and on the custom payload I add the following code: {"sound":"default"} the problem Is that no sound gets played when I receive the notification. Does anyone have a solution for this?

Answer

marcel picture marcel · Sep 3, 2014

Maybe this helps found here code will look like this.

Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
r.play();