Ionic framework 离子4本地通知声音在Oreo中不起作用+
我正在构建一个Ionic 4应用程序,本地通知声音在牛轧糖中工作,但在Oero中不工作。 只是播放默认声音,而忽略该声音 我在这里读到: 在Android O API 26中,个别通知上的声音被弃用。现在必须将它们设置在频道上 这个频道是必要的Ionic framework 离子4本地通知声音在Oreo中不起作用+,ionic-framework,audio,android-8.0-oreo,localnotification,Ionic Framework,Audio,Android 8.0 Oreo,Localnotification,我正在构建一个Ionic 4应用程序,本地通知声音在牛轧糖中工作,但在Oero中不工作。 只是播放默认声音,而忽略该声音 我在这里读到: 在Android O API 26中,个别通知上的声音被弃用。现在必须将它们设置在频道上 这个频道是必要的 this.localNot.schedule({ id: id, // channel: id, // IS NOT Possible to set title: title, text: 'Some
this.localNot.schedule({
id: id,
// channel: id, // IS NOT Possible to set
title: title,
text: 'Some text',
sound: `file://assets/audio/mySOUNDFILE.mp3`,
icon: 'file://assets/img/logo/favicon.png', // TODO resident Img,
color: colour
});
但就像我在爱奥尼亚没有现场频道一样,我在这里设置了一个问题,但很接近。
你有什么建议吗?我正在用这个
git+
home.ts
declare var cordova: Cordova;
@Component({
selector: 'app-home', ...
以及发送通知
cordova.plugins.notification.local.schedule({
id: Myid,
title: tit,
text: txt,
priority: MyPriority,
channel: 'MyChannel',
sound: `file://assets/audio/${sound}.mp3`,
foreground: true,
lockscreen: true,
vibrate: vib,
wakeup: true,
});
在哪里
priority: MyPriority,
channel: 'MyChannel',
每个声音都必须不同
在文件/node_modules/@types/cordova/index.d.ts I set中:
interface CordovaPlugins {
notification: any;
...
}