I'm trying to use FCM push notifications with my Ionic 2 app via cordova-fcm-plugin.
I've followed every tutorial and it's working fine when i send a push from the firebase console, but i want to do some stuff in my app using its functionalities and the payload, but when i try to use any method from the plugin i get a Cannot find name 'FCMPlugin' error on Visual Studio: The error I've been looking for how to use it correctly and haven't found anything, just this question: The Question
So what is the correctly way to implement and use the plugin? Is there a module? I can call it from the 'ionic-native'? I have to import it from somewhere? Just use the plugin .js file link in the index.html? Or this error is commom and in emulation/building it'll work fine?
Thanks :D
PS: I've not tryed to build it or emulate it to see what happens, going to do this now.
Ok, so it's an error that won't let me build my app. Rly need to know how to use the plugin now.
You have to declare the FCMPlugin variable after your imports:
import { Foo} from '../pages/foo/foo';
import { Bar } from '../pages/bar/bar';
declare var FCMPlugin: any; // <---- this is the magic line
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With