capacitor-community / fcm

Enable Firebase Cloud Messaging for Capacitor apps
https://capacitor.ionicframework.com/docs/
MIT License
237 stars 83 forks source link

TypeError: Cannot read property 'subscribeTo' of undefined #53

Closed tolutronics closed 3 years ago

tolutronics commented 3 years ago

Describe the bug Whenever i tried to subscribe to a topic or get Token, i get the error TypeError: Cannot read property 'subscribeTo' of undefined i am using ionic framework

grallc commented 3 years ago

Same here :/

stewones commented 3 years ago

that information is not enough. how to reproduce the problem? have you tried the example included in this repo? have you searched for this kind of issue? please open a new issue with more info

tolutronics commented 3 years ago

grallc , please check your set up...in my case i ignore this part

on your MainActivity.java file add import com.getcapacitor.community.fcm.FCMPlugin; and then inside the init callback add(FCMPlugin.class);

but after following this, it worked perfectly