katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.57k stars 1.75k forks source link

local notification doesn't work in ionic 3 #1469

Closed normanaranez closed 6 years ago

normanaranez commented 6 years ago

No errors on building the app but when i try it on android phone. there i no notification popup. what's wrong with it?

Ionic Info:

cli packages: (C:\Users\13890\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.5
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Node : v6.11.5
npm  : 3.10.10
OS   : Windows 7

Sample Code:

import { Component } from '@angular/core'; import { NavController, AlertController } from 'ionic-angular';

import { LocalNotifications } from '@ionic-native/local-notifications';

@Component({ selector: 'page-home', templateUrl: 'home.html' }) export class HomePage {

constructor(public navCtrl: NavController, private localNotifications: LocalNotifications, public alertCtrl: AlertController) {

    this.localNotifications.on('click', (notification, state) => {
        console.log('click');

      let json = JSON.parse(notification.data);

      let alert = alertCtrl.create({
        title: notification.title,
        subTitle: json.mydata
      });
      alert.present();
    });
}
scheduleNotification() {
  this.localNotifications.schedule({
    id: 1,
    title: 'Attention',
    text: 'Simons Notification',
    data: { mydata: 'My hidden message this is' }
  });
}   

}](url)

Note: Done Adding localNotification on app.module.ts

normanaranez commented 6 years ago

Please help me what to do with this.

YamanSehzade commented 6 years ago

hi@normanaranez , Is it same as yours

normanaranez commented 6 years ago

hi @YamanSehzade

Do you have any idea about it? when i check to the documentation it is not beta. in config.xml the plugin still in beta and mostly of the forums are using apple product. any idea on the android side?

himinat commented 6 years ago

you can not use local notification plugin with current ionic plugin wrapper because it outdated. there is issue opened 14 Nov, and no info when wrapper will be updated.

YamanSehzade commented 6 years ago

@normanaranez sorry for late reply. I already have a problem on android. it is not working.

@himinat i don't understand. Will we not be able to use this plugin now ? Can you explain, please ?

When i try to add 0.8.5, i get this error; image

himinat commented 6 years ago

@YamanSehzade you need to use this command ionic cordova plugin add de.appplant.cordova.plugin.local-notification@0.8.5 if you have questions, check please wiki for 0.8 branch

normanaranez commented 6 years ago

any idea when to release the version for the android?

gamboaweb commented 6 years ago

Hi...if someone is still wondering... I solved it installing first the local notification plugin dependencies first and then the plugin itself with version 0.8.5 Using --nofetch was installing but I was not able to build... you can see it here: https://github.com/katzer/cordova-plugin-local-notifications/issues/1477

EdsonAlcala commented 6 years ago

it doesn't work !!!! helppppp

katzer commented 6 years ago

Please always see the tagged README for the plugin version and not whats written for master branch. With v0.9 the id of the plugin has changed. You have to use the old id if you want to use v0.8.x