angular - 离子应用程序关闭时仅显示标题和消息
问题描述
应用程序关闭时仅显示标题和消息,即使通知是使用图像和操作按钮声明的。
但仅在打开应用程序时才显示通知,因为它使用图像和操作按钮以及标题和消息声明,如下图所示。
我的代码声明如下。
this.localnotify.schedule({
id:4,
title: data.title,
sound: this.isAndroid ? 'file://sound.mp3' : 'file://beep.caf',
text: data.message,
icon: 'file://assets/icon/pushnotify.png',
priority: 1,
// lockscreen: true,
foreground: true,
// led:{ color: '#faf7fa', on: 500, off: 500 },
attachments: ['file://assets/icon/pushnotify.png'],
actions: [
{ id: 'yes', title: 'Yes' },
{ id: 'no', title: 'No' }
],
// wakeup:true
});
帮助我在第二张图片中显示通知,无论应用程序是关闭还是打开。
解决方案
推荐阅读
- javascript - 解析错误:类型转换表达式应包含在括号中
- spring-boot - 发生错误时如何停止消费来自kafka的消息并在春季启动一段时间后重新开始消费
- web - 如何向每个用户显示存储使用情况
- python - 使用装饰器对烧瓶应用程序进行身份验证
- python - 如何提取更大数据集的子集
- javascript - 移动图像上的 Onclick 事件不起作用
- javascript - 如何在 Odoo 中实现第三方 JS 库
- python - 尝试在python中进行签名并添加策略并签名到html文档以使用post在s3存储桶中上传文件。给出签名不匹配错误
- r - 在 sf 对象中按距离聚合特征
- python - Matplotlib DataFrame 箱线图,具有给定的最大值、最小值和四分位数