iOS Question Application_OpenUrl in a B4XPages project

Alessandro71

Well-Known Member
Licensed User
Longtime User
can we assume that, in a B4XPages project, MainPage will always be already initialized when Application_OpenUrl is called, so the following code is safe and won't crash?

B4X:
Sub Application_OpenUrl (Url As String, Data As Object, SourceApplication As String) As Boolean
    B4XPages.MainPage.Application_OpenUrl(Url, Data, SourceApplication)
    Return True
End Sub

some preliminary test suggest this is true (starting the app via OpenUrl("packagename://someparameter"), but I don't know if there are some edge cases out there.
 
Solution
Yes. This event will only run after Application_Start completed (or paused with Wait For / Sleep) and B4XPages.MainPage will be initialized at that point.
Top