Closed nero08 closed 6 years ago
Can you please triple check if your setup is like the one in QtFirebaseExample? The messaging module works on my Android devices with the app produced from QtFirebaseExample. (maybe fetch the project and build it with Qt Creator to see if the error persists)
I test and I receive notification but I can't retrieve the token, onTokenChanged is not emited and when I call messaging.token, the value is empty
Any progress? I get a token on all my 4 different test devices (real devices - not emulator)
no, but I use a different solution, I call native code with QAndroidNative, my java file call firebase api who return the token. So it's ok
But in qml, I always don't retrieve the token, the onTokenChange is not emited
Hmm. I'll leave this open for the time being. Maybe other users will encounter the same problem
Its workin on my devices fine too. Testet on iPhone 5, iPhone 5s, iPhone 6, Galaxy S6/S7/S8.
I've just investigated the code after deciding to use the library in my project, and it seems that the following signals are being connected too late.
connect(g_listener, &MessageListener::onMessageReceived, this, &QtFirebaseMessaging::getMessage);
connect(g_listener, &MessageListener::onTokenReceived, this, &QtFirebaseMessaging::getToken);
before the componentComplete
is called, the MessageListener
receives the token and then calls onTokenReceived
but there's no one to respond to that signal. The solution would be to connect the signals in constructor, and then check If there's a new token and then emit the tokenChanged
signal in componentComplete
.
@Furkanzmc - you might just be absolutely correct! I've had similar scenarios back when I started the project. It's worth a try. Nice catch! Do you happen to have a patch / PR for this?
@Furkanzmc Just yesterday, I noticed that! Then I saw your response, so I connected the signals in constructor and till now is working nicely! =D
Great news!
@Furkanzmc https://github.com/Larpon/QtFirebase/commit/534a31455cf4bdba6d8127427dadd99a0df835b3 Should be fixed with this Update.
Hello,
I have a problem with Messeging plugin, the plugin is intialized and ready but it does not retrieve the token.
I put it in my manifest
https://pastebin.com/cywZHPUQ
my android ndk version is 14b
I've forgot something?