【发布时间】:2019-10-21 13:54:10
【问题描述】:
我正在构建一个 Ionic 4 应用程序,本地通知 sound 在 Nougat 中工作,但在 Oero 中不工作。
只是播放默认声音,忽略sound
我在这里读过: https://distriqt.github.io/ANE-PushNotifications/m.FCM-GCM%20Payload
Android O (API 26) 中已弃用单个通知的声音。您现在必须在频道上设置它们。
Different notification sound not working in Oreo
那个频道是必要的
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
});
但是就像我在 ionic 中没有可用的“通道”字段一样,我在这里设置了一个问题,但很接近。 https://github.com/ionic-team/ionic/issues/19696
你有什么建议我怎样才能让它工作吗?
【问题讨论】:
标签: ionic-framework audio android-8.0-oreo localnotification