cordova-plugin-firebase-messaging icon indicating copy to clipboard operation
cordova-plugin-firebase-messaging copied to clipboard

getToken() Empty - but able to send notifications

Open Daniel123454321 opened this issue 2 years ago • 2 comments

Problem: I do not get an individual token from getToken method. But I can send messages via the firebase console using the package name - and the messages getting recieved by the device. But without a token there is no individual messaging possible.

On building I get an warning: "Library expects a BoM package: com.google.firebase:firebase-messaging"

System:

  • Cordova 11
  • SDK 32
  • only a few default cordova plugins installed
  • Quasar/Vue Framework

What have I tried to resolve that problem:

  • tried to revert Java Code of getToken() to older version
  • tried the to implement the javascript code on different pages on the cordova project
  • tried a timeout before calling the getToken method
  • tried adding different libraries to the gradle.build file
    • like firebase-bom, com.google.gms:google-service, firebase, ...

I hope anyone has an idea or can point me in the right direction.

Update: I tried now several other cordova plugins and also some paid services like wonderpush. The Problem is everywhere the same. I get no token or deviceID. When I look on the backend (e.g. Wonderpush) I can see that there of course is an token oder deviceID registered. So it seems the problem is somewhere else - but I don't know where :/

Daniel123454321 avatar Dec 09 '22 12:12 Daniel123454321

I made now a complete empty new cordova project. With no other plugins, no extra code, no Quasar/Vue Framework. Just the default cordova template + getPermission + getToken Code.

It's just like above: I get the warning when building & I don't get an tokenID. It doesn't work on the emulator nor after deploying it via the play store.

Maybe someone has a working sample project to share or want's to check my code.

Daniel123454321 avatar Dec 14 '22 18:12 Daniel123454321

any solution ?

Vladeouz avatar Jul 16 '24 01:07 Vladeouz