Android Question Service and Receiver in Android 6.0.

asales

Expert
Licensed User
Longtime User
I changed services to receivers in all my apps.

Testing in a device with Android 6, I get the issue that I describe below.

To show the problem, I try to run this Firebase Messaging example in Android 6:

but I get this message in the log and don't received the push notification:
B4X:
sending message to waiting queue of uninitialized activity (subscribetotopics)

It worked only if I change the receiver to service.

In a device with Android 10 the receiver worked fine.

The solution it check the version (6.0) and call a service and in Android 7+ I call the receiver?

Or there a solution to use the receiver in Android 6?

Thanks in advance for any tips.
 

asales

Expert
Licensed User
Longtime User
Yes. I only run the example from the link.
Due this issue, I created a Firebase Messaging service module to test in the example.
It worked with the service but not with then Firebase Messaging receiver in Android 6.

But this problem is only in the Android 6.
I tested in devices with Android 7 and Android 10 too and the FB Messaging receiver example worked fine.
 
Upvote 0
Top