Pugnotification
Pugnotification copied to clipboard
How to play a custom sound ?
I put a mp3 in a res/raw directory
Then
PugNotification.with(getApplicationContext())
.load()
.title(item.getBottle().getName())
.message("Encore un vin dégusté par " + item.getUser().getName())//" + "\n" + item.getBottle().getName()) +"de "+item.getBottle().getVintage() +" en "+ new WineColor(Integer.parseInt(item.getBottle().getColor())).getColorToString() +
.bigTextStyle(item.getUser().getName() + " à dégusté un " + new WineColor(Integer.parseInt(item.getBottle().getColor())).getColorToString() + " nommé " + item.getBottle().getName() + " et lui à donné la note de " + item.getTasting().getRate())
.smallIcon(R.drawable.icon_notif)
.largeIcon(b)
.color(R.color.interaction)
.flags(Notification.DEFAULT_SOUND)
.sound(Uri.parse("android.resource://" + App.getContext().getPackageName() + "/" + R.raw.tire_bouchon3))
.custom()
.setImageLoader(NotificationService.this)
.background(item.getBottle().getLabelPicturePath())
.setPlaceholder(R.drawable.pugnotification_ic_placeholder)
.build();
Did I miss something ?
Hi @afaucogney ,
Apparently it's all right. I'll check as soon as possible! I have tested a simple notification?
@afaucogney you should remove this line: .flags(Notification.DEFAULT_SOUND)
@afaucogney It worked?
@alistefano Thank you for your help!
hey ! It didnt worked for me still the default sound is playing and lights are also not working