Android Question Need help to understanding with push notification and foreground/background process

lsahidin

Member
I already create an app with mqtt, but now I just wonder how I can create push notification when I received data although the application is closed or not active. I have tried from this great example https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/ to make push notification, but not understand how to integrate with mqtt. I thougt is there checking process inside fm.initialize
service start:
Sub Service_Create
    fm.Initialize("fm")

and also with handleIntent, really I'm not skillful mobile developer.
service start:
Sub Service_Start (StartingIntent As Intent)
    If StartingIntent.IsInitialized Then fm.HandleIntent(StartingIntent)

for your help, thanks in advance!
 

KZero

Active Member
Licensed User
Longtime User
you should have a MQTT Broker to manage the clients and messeges and to sent FCM notifications when needed
you can start from here
and
 
Upvote 0

lsahidin

Member
@KZero that's nice, thanks. After read tutorial I already decide to use firebase service send2topic.

@Erel MQTT library connect to io server broker, if there any data changes fcm will send push messages to another device.

but now why icon notification is only grey color, I cannot see my icon app on there. or manifest code for adaptive icon make a problem with icon notification?
 
Last edited:
Upvote 0
Top