Closed DDholiyan closed 2 years ago
hello there. it's impossible to know without a reproducible example, where we can download and try.
can you please try on both latest capacitor + plugin?
We're experiencing the same issue. I can't easily give you a reproducible example at the moment as we're heads down working on an alternative... which is frustrating, but necessary.
This seems to only be affecting Android.
I've replicated this by:
What I suspect, is that since Capacitor 3 has automatically started loading plugins, the old way (modifying MainActivity.java) is broken. This seems to also still be using InstanceID, which should(?) be fixed for any reasonably modern implementation to work. (Correct me if I'm wrong there... but I believe there's an open issue for that as well.)
Cap 3 doesn't require registering plugins on MainActivity anymore, so you can remove any reference there. (Take a look in the example app on this repo)
Also there's an issue with the push-notifications package.
See my comment for workaround https://github.com/ionic-team/capacitor-plugins/pull/395#issuecomment-918595296
@stewones - appreciate the input, work, and expedient response very much... this will work for us for now, I suppose we'll track it until it is merged in... hopefully they can handle that sooner than later!
should be fixed on latest plugin version v2.0.2
I am currently using ionic capacitor PushNotifications for Firebase cloud messaging. By the help of this I can get tokens. Now I want to send notifications to all app users so I decided to use topics.
For this, I installed community/FCM plugin.
I also made suggested changes in the MainActivity.java file, no error during app build.
But after installation this FCM plugin, PushNotifications(token) stop working.
Even below code starts always retuning false.
Here is my MainActivity.java file:-
Here my fcm.service.ts File:-
After removing community plugin token generation started working as before. Please tell me what wrong is with my code.