Hi all ! Could anyone suggest please … I am use Cordova Local-Notification Plugin and the notification doesn’t appear again when the app was closed … Is there any solution ??
I got it .Thanks.If anyone else is facing the same issue, just try to declare this.localNotifications.on(‘click’, (success)=>{ alert(“clicked”) } on the landing/home page.
import { Component } from ‘@angular/core’;
import { Platform } from ‘ionic-angular’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { LocalNotifications } from ‘@ionic-native/local-notifications’;
import { HomePage } from ‘…/pages/home/home’; @Component({
templateUrl: ‘app.html’,
providers:[LocalNotifications]
})
export class MyApp {
rootPage:any = HomePage;
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,private localNotifications: LocalNotifications) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
;
statusBar.styleDefault();
splashScreen.hide();
alert('Alert ')
this.localNotifications.schedule({
text: ‘Delayed ILocalNotification’,
every:‘minute’,
at: new Date(new Date().getTime() + 60000),
led: ‘FF0000’,
sound: null
});
Not working for me: Parameter ‘success’ implicitly has an ‘any’ type, but a better type may be inferred from usage.ts(7044)
‘success’ is declared but its value is never read.ts(6133)
Expected 1 arguments, but got 2.ts(2554)