【问题标题】:attachment propriety not working in ionic local notification plugin附件属性在离子本地通知插件中不起作用
【发布时间】:2019-08-13 07:43:08
【问题描述】:

我们正在开发混合移动应用程序(ionic 3 和 angular 4)。我们正在尝试使用本地通知进行附件。

https://ionicframework.com/docs/v3/native/local-notifications/

我们试过这样

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' }
    ]
    });

无法在通知中获取附件。让我们知道我们错过了什么。

【问题讨论】:

    标签: angular cordova ionic-framework ionic-native localnotification


    【解决方案1】:

    传递小图像

    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' }
        ]
        });
    

    【讨论】:

      猜你喜欢
      • 2017-11-20
      • 1970-01-01
      • 2015-08-03
      • 2021-07-30
      • 2018-06-19
      • 2020-06-05
      • 2017-03-08
      • 2021-07-15
      • 1970-01-01
      相关资源
      最近更新 更多