0

我已经通过使用thisIoinic + PhoneGap的推送 - 通知图标不显示

提到的代码现在想这几个时间点的图标使用this实用 enter image description here

推送通知INIT代码生成

var push = PushNotification.init({ 
      android: { 
      senderID: "gcm_id", 
      icon: "ic_notification", 
      iconColor: "black" 
      } 
     }); 

platform/android/res中的文件夹全部包含生成的ic_notification.png

enter image description here

但我的通知仍然不显示图标。它显示空白的白色方块。

enter image description here

Cordova version 6.0. Ionic version 1.7.14 android-minSdkVersion: 16 android-targetSdkVersion: 23

有没有人能得到这个工作?

回答

0

原来上面的设置没有错。通知有效载荷需要有正确的图标名称。

const gcmMessage = new gcm.Message({ 
    priority: 'high', 
    notification: { 
    title: 'Title', 
    icon: 'ic_notification', 
    body: 'test' 
    } 
});