Ionic本地通知声音在Android 8.0上不起作用

时间:2019-02-28 17:13:55

标签: android ionic-framework ionic3 localnotification

提供问题的一般摘要。

环境

  • 插件版本:0.9.0-beta.2
  • 平台:Android
  • 操作系统版本:8.0.x
  • 设备制造商/型号:三星Galaxy s8
  • 科尔多瓦版本(DROP TABLE IF EXISTS student; CREATE TABLE student (student_id SERIAL PRIMARY KEY ,tutor_id INT NOT NULL ); INSERT INTO student VALUES (1,2), (2,1), (3,3); DROP TABLE IF EXISTS tutor; CREATE TABLE tutor (tutor_id INT NOT NULL ,subject_id INT NOT NULL ,PRIMARY KEY(tutor_id,subject_id) ); INSERT INTO tutor VALUES (1,3), (2,4), (4,1); DROP TABLE IF EXISTS subject; CREATE TABLE subject (subject_id SERIAL PRIMARY KEY ,subject VARCHAR(12) NOT NULL UNIQUE ); INSERT INTO subject VALUES (1,'Maths'), (2,'Science'), (4,'English'); SELECT * FROM student x LEFT JOIN tutor y ON y.tutor_id = x.tutor_id LEFT JOIN subject z ON z.subject_id = y.subject_id WHERE z.subject_id IS NULL; +------------+----------+----------+------------+------------+---------+ | student_id | tutor_id | tutor_id | subject_id | subject_id | subject | +------------+----------+----------+------------+------------+---------+ | 2 | 1 | 1 | 3 | NULL | NULL | | 3 | 3 | NULL | NULL | NULL | NULL | +------------+----------+----------+------------+------------+---------+ ):4.2.1
  • Cordova平台版本(cordova -v):7.1.4
  • 插件配置:无
  • 离子版本:3.9.2

预期行为

使用:

cordova platform ls

我想显示带有自定义声音的通知 位于this.localNotifications.schedule({ id: 1, text: 'You have arrived', sound: 'file://assets/sounds/alerts/arrival.mp3', data: { secret: 'hellloo' }, vibrate: true });

实际行为

我尝试了所有可能的文件路径(我认为),但是它仍然播放默认的Samsung Galaxy s8通知声音。

调试日志

Logcat输出:

src/assets/sounds/alerts/...

我注意到正在记录“ sound = null”,这有点奇怪。 预先感谢。

以诚挚的问候,

约拿

0 个答案:

没有答案