Push notification click is not woking in ionic -


i new ionic. tried integrate push notification in project , working perfectly. getting notification firebase android , getting notification apns ios.

but tried track notification click action when app in background or quiet state. can able track when app running in foreground.

the below code. have added in app.component.ts file under

platform.ready().then(() => {} 

here code:

var push = push.init({  android: {   senderid: "123456789"   },  ios: {       alert: "true",       badge: true,       sound: 'true',       clearbadge: true     },  windows: {}  });  push.on('registration', (data) => {     this.clipboard.copy(data.registrationid.tostring());     window.localstorage.setitem('token',data.registrationid.tostring());   });    push.on('notification', (data) => {      if (data.additionaldata.foreground) {       alert(data.message);     }     else if(data.additionaldata.coldstart)     {       alert(data.message);       window.localstorage.setitem('pushmessage', data.message);     }     else     {       alert(data.message);     }   });   push.on('error', (e) => {     alert(e.message);   }) 

whenever try open app using notification click, not triggering notification receive method. if app open showing alert.

please in this. in advance.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -