-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FCM, FCMPlugin are always undefined #58
Comments
Did you run npx cap sync after npm install? |
Hello, thank you for your feedback. Yes i did run the sync. Other plugins Note, that the native Capacitor PushNotifications also work correctly. Unfortunately I did not find an option to register for a specific topic with PushNotifications, that's why I gave the community plugin a try. Kind regards, |
I think the problem is that you forgot to add this plugin to your MainActivity.java. Since the other plugin you are referring to is a cordova-plugin this step isn't necessary there. I looked throught the readme of this plugin and i did not find this step there so this could/should be probably stated there... As you can see in the example-integration it get's added to the MainActivity You can read more about this in the capacitor-docs. br |
Hi @adrenaline15 , that's the missing link. I did not know about these extra steps to take. Anyway, my issues are solved. Thanks a lot. Kind regards, |
FCM, FCMPlugin are always undefined
Our Ionic setup with Capacitor using capacitor-community/fcm to listen for push notifications for defined topics (currently only all) does not work as expected. Calling
fcm.subscribeTo()
as well asFCMPlugin.subscribeTo()
result in an error when running in an Android device:My first thoughts were, that this is an Angular / Ionic specific issue, but after trying a couple of different solutions, I concluded, that there is another problem in our setup:
const fcm = new FCM()
did not workFCMPlugin.subscribeTo()
directly did not workthis.application.ready().then()
callback did not work tooTo Reproduce
Package and software versions
Notes
Code sample
The text was updated successfully, but these errors were encountered: