#Entitlement: <key>com.apple.developer.networking.HotspotConfiguration</key><true/>
#Entitlement: <key>com.apple.developer.networking.wifi-info</key><true/>
#AdditionalLib: NetworkExtension.framework
.
.
.
Private Sub StartLocationUpdates
Dim no As NativeObject = Me
gstSSID = ""
Try
'if the user allowed us to use the location service or if we never asked the user before then we call LocationManager.Start.
If LocManager.IsAuthorized Or LocManager.AuthorizationStatus = LocManager.AUTHORIZATION_NOT_DETERMINED Then
LocManager.Start(0)
no.RunMethod("fetchWiFi:", Null)
'gstSSID = no.RunMethod("currentWifiSSID", Null).AsString
'Log("Current SSID: " & gstSSID)
End If
Catch
End Try
End Sub
Sub WiFi_Available (Success As Boolean, SSID As String, BSSID As String)
If Success Then
gstSSID = SSID
Log("Current SSID: " & gstSSID)
End If
End Sub
#If OBJC
#import <NetworkExtension/NetworkExtension.h>
- (void)fetchWiFi:(NSObject*)tag {
[NEHotspotNetwork fetchCurrentWithCompletionHandler:^(NEHotspotNetwork * _Nullable currentNetwork) {
if (currentNetwork != nil) {
// Signal strength is often 0 or unpopulated in this specific API
[self.bi raiseEvent:nil event:@"wifi_available:" params:@[@YES, currentNetwork.SSID, currentNetwork.BSSID]];
} else {
[self.bi raiseEvent:nil event:@"wifi_available:" params:@[@NO, @"", @""]];
}
}];
}
#End If