Giter VIP home page Giter VIP logo

Comments (9)

carlonluca avatar carlonluca commented on June 10, 2024 1

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.

carlonluca avatar carlonluca commented on June 10, 2024 1

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.

Larpon avatar Larpon commented on June 10, 2024

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.

carlonluca avatar carlonluca commented on June 10, 2024

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.

Larpon avatar Larpon commented on June 10, 2024

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.

carlonluca avatar carlonluca commented on June 10, 2024

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.

Larpon avatar Larpon commented on June 10, 2024

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.

Larpon avatar Larpon commented on June 10, 2024

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.

Larpon avatar Larpon commented on June 10, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.