iOS Question Need to access wifi settings menu

DickD

Active Member
Licensed User
I want to let my users access the wifi settings menu so they can select a network. Is this possible?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Try this:
B4X:
#QueriesSchemes: prefs
Sub OpenWifiSettings As Boolean
   For Each s As String In Array("prefs:root=WIFI", "App-Prefs:root=WIFI")
     If App.CanOpenURL(s) Then
       App.OpenURL(s)
       Return True
     End If
   Next
   Return False
End Sub

Note that it doesn't work on iOS 11 (you will be taken to the home screen). Based on answers from StackOverflow it should work on older versions.
 
Upvote 0

DickD

Active Member
Licensed User
Try this:
B4X:
#QueriesSchemes: prefs
Sub OpenWifiSettings As Boolean
   For Each s As String In Array("prefs:root=WIFI", "App-Prefs:root=WIFI")
     If App.CanOpenURL(s) Then
       App.OpenURL(s)
       Return True
     End If
   Next
   Return False
End Sub

Note that it doesn't work on iOS 11 (you will be taken to the home screen). Based on answers from StackOverflow it should work on older versions.
I added this code to my app including the "#QueriesSchemes: prefs" in Main Project Attributes. However "App." returns "Object expected". Is there a class module associated with this? I don't use classes or objects much so I don't understand.
 
Upvote 0
Top