首页 > 解决方案 > 离子应用程序关闭时仅显示标题和消息

问题描述

应用程序关闭时仅显示标题和消息,即使通知是使用图像和操作按钮声明的。 在此处输入图像描述

但仅在打开应用程序时才显示通知,因为它使用图像和操作按钮以及标题和消息声明,如下图所示。 在此处输入图像描述

我的代码声明如下。

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

帮助我在第二张图片中显示通知,无论应用程序是关闭还是打开。

标签: angularionic-frameworkionic5

解决方案


推荐阅读