danielsogl / awesome-cordova-plugins

Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support.
https://danielsogl.gitbook.io/awesome-cordova-plugins/
Other
2.41k stars 2.42k forks source link

Getting square blank image in notification in Ionic 2 #609

Closed anand-parmar closed 8 years ago

anand-parmar commented 8 years ago

Image in notification works in ionic 1. But when i use in Ionic 2 Getting square blank image in notification.

I have tried

ionic plugin add de.appplant.cordova.plugin.local-notification

saved image in platforms\android\res\drawable\sample.png

Here is code

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import {LocalNotifications} from 'ionic-native';
@Component({
  templateUrl: 'build/pages/home/home.html'
})
export class HomePage {
  constructor(public navCtrl: NavController) {
    LocalNotifications.schedule({
      id: 1,
      title: 'Title here',
      text: 'Text <b>here aaa</b>',
      led: "FF0000",
      icon: "sample"
    });
  }
}

CLI version

ionic-native : 1.3.21
Cordova CLI: 6.1.1                                                                                                                   
Gulp version:  CLI version 3.9.1                                                                                                     
Gulp local:   Local version 3.9.1                                                                                                    
Ionic Framework Version: 2.0.0-beta.11                                                                                               
Ionic CLI Version: 2.1.0-beta.1                                                                                                      
Ionic App Lib Version: 2.1.0-beta.0                                                                                                  
OS: Windows 8.1                                                                                                                      
Node Version: v4.4.2 
ihadeed commented 8 years ago

Please refer to this page for instructions on using the icon property: https://github.com/katzer/cordova-plugin-local-notifications/wiki/10.-URIs

anand-parmar commented 8 years ago

I found solution on https://github.com/katzer/cordova-plugin-local-notifications/issues/966#issuecomment-248515131

ihadeed commented 8 years ago

@anand-parmar thanks for sharing the solution!

mmtpl-kumar commented 7 years ago

Hi, can anybody tell me how i can show custom image in push notification