Comments (9)
The OnMessage callback seems not to be called in any way in this situation.
At this point, this should probably be asked in the firebase repo.
Thanks for your help!
from qtfirebase.
Hello,
it turned out that receiving notifications when the app is in foreground is possible and it should work in the current QtFirebase example. The problem that led to this issue is that the current version of Qt Creator happily removes any intent filter defined inside messaging services as soon as the manifest is opened... without telling anyone... The missing intent filter results in the problem described above. If the manifest remains just like in the git version of the QtFirebase example, everything works.
On the other hand, while everything works while the app is dead or in the foreground, I still could not get data from the opened notification when the app was running in the background. It is possible that this is the intended behavior though: https://stackoverflow.com/questions/39529317/firebase-notification-is-not-working-when-activity-is-in-background-or-not/45292455#45292455. When both "notification" and "data" keys are in the notification, then data is not received by the app. The only quick fix I could find is to reinit QtFirebaseMessaging when the app is back from the background. This is a bad solution though, not sure if it makes sense to send a pull request.
I guess this issue does not actually exist, so I think I can close it. Thanks for your assistance.
from qtfirebase.
As far as I have been able to figure out - it's expected and a limitation of firebase - others may have experienced different behaviour on different hardware 🤷♂️
from qtfirebase.
Thank you for your answer. In fact, I do not see any call to OnMessage from firebase. But this is considerably weird, isn't it? On iOS this seems to work properly. Do you happen to have a reference about the limitation? I suspected something like this but I couldn't find a confirmation.
So, do you think it is impossible to know that the notification arrived and the data it contains while the app is running? Or do you happen to know if there is a way around this somehow?
Thank you very much for your quick answer. At least I won't waste my time trying to find something that is not there :-)
from qtfirebase.
It should work with OnMessageRecieved in the normal (non cpp) firebase - I guess you should be able to handle the callback then - I'm not sure why it's missing from QtFirebase currently. I haven't been active with this project in a long time now - so I'm not very up-to-date on how everything runs 😬
from qtfirebase.
But is the non-cpp firebase included in QtFirebase? So would it be possible to add it to QtFirebase immediately somehow or you mean that it would be necessary to add the firebase Java library?
Thanks.
from qtfirebase.
No I meant you'll probably have to try and find out if firebase-cpp has this feature and then implement it yourself - we have some code for this so maybe it's worth looking into at that call.
OTOH other users seem to have it working
from qtfirebase.
Happy to help 🙂
I'm uncertain if OnMessage
and OnMessadeReceived
is the same functionality between the cpp/java versions - but yes it's probably a good idea to find out if it's supposed to work in the firebase-cpp version 🙂
from qtfirebase.
@carlonluca thanks for investigating and getting back with your results!
I'm not sure how to solve the data issue - we shouldn't reinit as a part of a solution since we'd just introduce confusion - just like Qt Creator did in this case.
Thanks for getting back and supporting the community!
from qtfirebase.
Related Issues (20)
- Using Qtfirebase HOT 13
- Cloud Storage HOT 5
- Getting Value from Firebase Real-time Database (Qt c++) HOT 1
- QString::sprintf was removed in Qt 5.14.x? HOT 11
- Support for Android AAB (Armv7 & Armv8) HOT 6
- Compatible Firebase SDK versions HOT 1
- Not able to Create QtFirebase object in my main.qml for Android. HOT 2
- Links markdown broken HOT 1
- Bundle of improvements HOT 3
- Provide a CLI to be run qmake HOT 13
- Debugging console HOT 9
- Code signing error HOT 5
- Can't compile with QTFIREBASE_CONFIG += analytics messaging for iOS HOT 2
- Qt 6 Support ? HOT 1
- Subscribing to topic nets no result HOT 6
- Linking failed on iOS HOT 10
- Build project with CMakeLists.txt instead of .pro HOT 2
- Subscribe method isn't working on the latest firebase_cpp_sdk (10.0.0) HOT 1
- Qt create how to config my kit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtfirebase.