@perenyitamas wrote:
Hello!
My problem is that i am trying to show an alert when the user click the notification. I tried it on my device, but nothing happens when i click to the notification, just fade away. No console error.
constructor(public alertCtrl: AlertController,private plt: Platform, public navCtrl: NavController, public navParams: NavParams,private vibration: Vibration,private storage: Storage,private localNotifications: LocalNotifications) { this.plt.ready().then((rdy)=>{ this.localNotifications.on('click',(notification, state)=>{ let json=JSON.parse(notification.data); let alert=this.alertCtrl.create({ title: notification.title, subTitle: json.mydata }); alert.present(); }); }); }
sendNotification(){ this.localNotifications.schedule({ id: 1, title: 'Lejárt az idő!', text: 'Érdemes lenne újra dobni! :)', //sound: isAndroid? 'file://sound.mp3': 'file://beep.caf', data: { mydata:'teszt' } }); }
Posts: 1
Participants: 1