angular - attachment propriety not working in ionic local notification plugin
问题描述
We are working on hybrid mobile application (ionic 3 and angular 4). We are trying attachment with local-notification.
https://ionicframework.com/docs/v3/native/local-notifications/
we tried like this
this.localNotifications.schedule({
id: 1,
title: 'Title',
text: 'Dec',
attachments: ['https://atlas-content-cdn.pixelsquid.com/stock-images/golden-soccer-ball-3yLR9z1-600.jpg'],
foreground: true,
vibrate: true,
actions: [
{ id: 'yes', title: 'Yes' },
{ id: 'no', title: 'No' }
]
});
unable to get attachment in notification .Let us know what we missed .
解决方案
传递小图像
uri='https://atlas-content-cdn.pixelsquid.com/stock-images/golden-soccer-ball-3yLR9z1-600.jpg'
this.localNotifications.schedule({
id: 1,
title: 'Title',
text: 'Dec',
attachments: [uri],
foreground: true,
vibrate: true,
actions: [
{ id: 'yes', title: 'Yes' },
{ id: 'no', title: 'No' }
]
});
推荐阅读
- javascript - 使用 Lodash 反转键值
- deployment - 在 YAML 文件中部署期间获取日期时间
- javascript - 在 fetch() 中删除当前 URL 自动填充
- javascript - 使用 Mapnik 以 uint16 RGB GeoTIFF 作为数据源来渲染图块
- spring - 使用 GROUP BY 的 JPA Projections 查询不使用空字段
- javascript - 如何通过更改序列中的每个备用值来懒惰地评估序列?
- javascript - 更改数组 React 的多个项目的 id
- c# - 为生产区域继承不同的类
- amazon-web-services - 如何使用 AWS CLI 为新的 SortKey 更新表?
- oracle-jet - Oracle JET:为 android 启动 ojet 混合应用程序时出错