Push plugin problem


I have installed push plugin, imported it in app.module.ts as a provider, and imported it page where I want to use it. My code looks like this:

I get this error:


when progam tries to run pushObject.on(‘notification’) function.

Can anyone help me to resolve this issue? Thanks!

Look out this StackOverflow Answer. It helped me out .

I think you are getting the same error than me so this is what I did:

  1. npm uninstall @ionic-native/push
  2. npm i @ionic-native/push@4.20.0 (because of type “angular-ionic” ionic.config.json)
  3. Check the code, all the imports that had /ngx at the end, should be now unrecognized. Just remove de /ngx (in every Push import)

I was getting this error because, like the StackOverflow’s answer said, my project’s type in ionic.config is “ionic-angular”. Doing this get my code to work and the push arrives perfect.

Hope it helps you!


Thanks a lot! I did the same thing, and it works!

Thanks! U saved me tons of time while updating to FCM!

Thanks a lot it worked!

It worked for me too!
Thanks a lot!