iOS Question Problem with SafariController

martin24

Member
Licensed User
When I use the SafariController to open an URL, everything works fine.

When I display a Message Box before opening that URL, the App completely hangs. I can can reproduce this with the latest version 5.30 and Hosted Builder.

Below the code that does not work here. Any ideas what could be wrong?

B4X:
'Code module
#Region  Project Attributes
    #ApplicationLabel: B4i Example
    #Version: 1.0.0
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
    #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
    #iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
    #Target: iPhone, iPad
    #ATSEnabled: True
    #MinVersion: 7
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public App As Application
    Public NavControl As NavigationController
    Private Page1 As Page
    Private Button1 As Button
    Private Button2 As Button
    Private Safari As SafariController
End Sub

Private Sub Application_Start (Nav As NavigationController)
    'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.Title = "Page 1"
    Page1.RootPanel.Color = Colors.White
    NavControl.ShowPage(Page1)
    
    Button1.Initialize("Button1", Button1.STYLE_SYSTEM)
    Button2.Initialize("Button2", Button2.STYLE_SYSTEM)
    
    Button1.Text = "OK"
    Button2.Text = "Error"
    
    Page1.RootPanel.AddView(Button1, 10, 10, 50, 50)
    Page1.RootPanel.AddView(Button2, 10, 70, 50, 50)
End Sub

Sub Button1_Click
    Safari.Initialize("safari", "https://www.b4x.com")
    Safari.Show(Page1)
End Sub

Sub Button2_Click
    Msgbox2("Msg", "Open?", "Open", Array ("Yes", "No"))
    Wait For Msg_Click (ButtonText As String)
    If ButtonText = "Yes" Then
        Safari.Initialize("safari", "https://www.b4x.com")
        Safari.Show(Page1)
    End If
End Sub
 
Top