xamarin.android - Xamarin Android Background Notification Custom Sound -


is possible use custom sounds in xamarin android background notification? didnt find examples.

yep! here's example:

 var pathtopushsound = $"android.resource://com.your.package/raw/{soundname}";  var sounduri = android.net.uri.parse(pathtopushsound);  var builder = new notificationcompat.builder(_context)             .setcontenttitle("title")             .setcontenttext("text")             .setpriority(1)             .setsmallicon(resource.drawable.transparentlogo)             .setongoing(true)             .setsound(sounduri);  builder.build(); 

the uri path resource sound file lives, set uri in notificationbuilder using setsound method.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -