trepdas Active Member Licensed User Longtime User Mar 3, 2021 #1 Hello very good people, my question is simple maybe a bit silly since I'm still on the contious lost curve on b4xpages... so, how to share data among pages? in page 3 - I make the firebase auth procedure in page 2 - I want to check if user is authenticated. if not - show page 3 to authenticate. I declared 'auth' as firebase auth in page 3 since the working procedure is in that page. how to make the auth check in page 2 ? B4X: If auth.CurrentUser.IsInitialized Then .... TIA ?
Hello very good people, my question is simple maybe a bit silly since I'm still on the contious lost curve on b4xpages... so, how to share data among pages? in page 3 - I make the firebase auth procedure in page 2 - I want to check if user is authenticated. if not - show page 3 to authenticate. I declared 'auth' as firebase auth in page 3 since the working procedure is in that page. how to make the auth check in page 2 ? B4X: If auth.CurrentUser.IsInitialized Then .... TIA ?
Erel B4X founder Staff member Licensed User Longtime User Mar 3, 2021 #2 Code: Dim p3 As Page3 = B4XPages.GetPage("page 3") 'there are other ways as well If p3.auth.CurrentUser.IsInitialized Then Upvote 0
Code: Dim p3 As Page3 = B4XPages.GetPage("page 3") 'there are other ways as well If p3.auth.CurrentUser.IsInitialized Then
trepdas Active Member Licensed User Longtime User Mar 3, 2021 #3 Yep! thankssss so I just change the declaration in page3 from private to public... B4X: Public auth As FirebaseAuth Last edited: Mar 3, 2021 Upvote 0
Yep! thankssss so I just change the declaration in page3 from private to public... B4X: Public auth As FirebaseAuth
trepdas Active Member Licensed User Longtime User Mar 3, 2021 #4 so to use a public variable , I'll declare it on b4xmain and in another page will get it like B4X: xx=B4XPages.MainPage.variable got it Upvote 0
so to use a public variable , I'll declare it on b4xmain and in another page will get it like B4X: xx=B4XPages.MainPage.variable got it