see Erel's tutorial: https://www.b4x.com/android/forum/threads/b4x-firebase-push-notifications-2023.148715/
My app is based on the PushClient example given in Erel's tutorial above.
When a new message arrives, I get the data from it via Sub fm_MessageArrived. I extended the example code a little bit: The incoming data is now stored in a string variable, which is displayed in a webview (could be a label, too) by calling the Sub B4XPages_appear, which is part of the module "B4XMainPage".
When the app is in the foreground or background, everything is fine. I can see the incomming text either at once (when the app was in the foreground) or by clicking on the notification (when the app was in the background). So far, so good.
But what can I do in case, the app hasn't been started yet, i.e. it's neither in the background nor in the foreground? The Sub fm_MessageArrived will be executed as well, but I cannot call the Sub B4XPages_appear, because B4XPages hasn't been initialized so far.
My app is based on the PushClient example given in Erel's tutorial above.
When a new message arrives, I get the data from it via Sub fm_MessageArrived. I extended the example code a little bit: The incoming data is now stored in a string variable, which is displayed in a webview (could be a label, too) by calling the Sub B4XPages_appear, which is part of the module "B4XMainPage".
When the app is in the foreground or background, everything is fine. I can see the incomming text either at once (when the app was in the foreground) or by clicking on the notification (when the app was in the background). So far, so good.
But what can I do in case, the app hasn't been started yet, i.e. it's neither in the background nor in the foreground? The Sub fm_MessageArrived will be executed as well, but I cannot call the Sub B4XPages_appear, because B4XPages hasn't been initialized so far.