james_sgp Active Member Licensed User Longtime User Oct 13, 2022 #1 Hi, i`m stuck on figuring out how to call a Sub on my B4xmainpage from a running service (i`m running FCM)? Any advice would be appreciated... Thanks, James
Hi, i`m stuck on figuring out how to call a Sub on my B4xmainpage from a running service (i`m running FCM)? Any advice would be appreciated... Thanks, James
DonManfred Expert Licensed User Longtime User Oct 13, 2022 #2 B4X: B4XPages.GetManager.MainPage.MySubtostart ? Upvote 0
toby Well-Known Member Licensed User Longtime User Oct 13, 2022 #3 1. Create a public Sub in MainPage: Create a public Sub in MainPage: Public Sub TestSub log("entering MainPage.TestSub") End Sub 2. Call TestSub from a service or another page: Call the TestSub from a service or any other page: B4XPages.MainPage.TestSub Last edited: Oct 13, 2022 Upvote 0
1. Create a public Sub in MainPage: Create a public Sub in MainPage: Public Sub TestSub log("entering MainPage.TestSub") End Sub 2. Call TestSub from a service or another page: Call the TestSub from a service or any other page: B4XPages.MainPage.TestSub
Erel B4X founder Staff member Licensed User Longtime User Oct 13, 2022 #4 You must check that B4XPages.IsInitialized returns true. It will return False when the app was started in the background. Upvote 0
You must check that B4XPages.IsInitialized returns true. It will return False when the app was started in the background.