gpt4 book ai didi

javascript - 本地通知中的自定义声音 IONIC 3

转载 作者:行者123 更新时间:2023-11-30 11:24:00 27 4
gpt4 key购买 nike

我想更改 android 上本地通知的默认声音,但它不起作用

我试图将声音文件放入项目中,但是当我运行我的应用程序时,它会播放默认声音

enter image description here

我也试过在声场上放一个远程声音文件,但同样的问题

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',

});

最佳答案

您放置的声音文件是正确的。

但是当您构建 Android 应用程序时,它的位置是不同的。

android_asset/www/assets/sounds/name.mp3

就是你需要指定的位置

当然,当您使用 media 插件时,会在收到通知后使用它。

编辑这不再是一个可行的解决方案。引用 ionic 文档,因为在 android 和 iOS 中都有突破性的变化

关于javascript - 本地通知中的自定义声音 IONIC 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48708626/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com