本地通知IONIC 3中的自定义声音 [英] Custom sound in local Notification IONIC 3
本文介绍了本地通知IONIC 3中的自定义声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想更改android上本地通知的默认声音,但不起作用
I want to change the default sound for local notification on android but it doesn't work
我试图将声音文件放入项目中,但是当我运行我的应用程序时,它将播放默认声音
i tried to put the sound file into the project but when i run my app it play the default sound
我也试图在声场上放置一个远程声音文件,但是同样的问题
also i tried to put on sound field a remote sound file but the same issue
this.localNotifications.schedule({
text: 'Delayed ILocalNotification',
at: new Date(new Date().getTime() + 3600),
led: 'FF0000',
sound: 'https://notificationsounds.com/soundfiles/15de21c670ae7c3f6f3f1f37029303c9/file-sounds-1085-definite.mp3',
});
推荐答案
您放置的声音文件正确.
The sounds file where you placed is correct.
但是,当您构建Android应用时,它的位置是不同的.
But when you build the Android app, it's location is different.
android_asset/www/assets/sounds/name.mp3
这是您需要指定的位置
当然,当您使用media
插件时,会在收到通知后使用.
Of course this is used when you are using the media
plugin, after the notification is received.
这篇关于本地通知IONIC 3中的自定义声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文