Ionic 2 : Local notification icon

后端 未结 4 1057
天涯浪人
天涯浪人 2021-01-02 17:15

I use this plugin to have local notification : https://github.com/katzer/cordova-plugin-local-notifications/wiki/03.-Installation

I want to have a specific icon in

4条回答
  •  -上瘾入骨i
    2021-01-02 17:27

    For Local push notification of ionic 2 plugin you can set the icon like below. Here icon.png will be taking from the drawable folder in android. And you can configure ionic to copy the local image file to drawable folder by adding lines mentioned below in config file under android platform section.

    
    
    
            
    
    this.localNotifications.schedule({
              id: 1,
              title: data.title,
              text: data.body,
              data: data,
              icon: "res://icon.png",
              smallIcon:"res://icon.png"
            });
    

提交回复
热议问题