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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -