larpon / QtFirebase

An effort to bring Google's Firebase C++ API to Qt + QML
MIT License
284 stars 83 forks source link

Receiving messages from Firebase while app is killed #113

Open MasterMind2k opened 5 years ago

MasterMind2k commented 5 years ago

During development I've identified that app, if killed, will not receive messages to C++ code if app is not running (with some moment to think about it, it makes sense actually :) ).

I have a use case that off the shelve notification bubble delivered by Firebase implementation won't do.

I am just opening this ticket to see if anyone has similar issues. I've cut some corners by completely ignoring Firebase C++ SDK and written a small layer in Java and custom integration API in the C++ parts.

Another thing that I realised is, that C++ written service cannot receive firebase messages. Since you need an Activity object when registering firebase app.

So, to sum this up. The use case is:

larpon commented 4 years ago

Have you tried making a service? That way you have C++ code still alive when the app is shut down?

MasterMind2k commented 4 years ago

Yes, I've made a use of services. But in this case, I do not need (or able) to use QtFirebase's wrapper around messaging.

Which in my use case, is not a problem. Maybe an idea, to prepare an infrastructure to have this ability by default in QtFirebase.

larpon commented 4 years ago

Yes that would be useful - let me know if you come up with something!

larpon commented 4 years ago

@MasterMind2k - just to make sure; are you using this

MasterMind2k commented 4 years ago

Hmm, not sure. I do have somewhere in my memory that I've tried it.

Will retry anyway and post results.