获取wifi信息兼容iOS 14以上设备
This commit is contained in:
+13
-21
@@ -30,15 +30,18 @@
|
||||
}
|
||||
|
||||
- (IBAction)reset:(id)sender {
|
||||
if (![[self currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) {
|
||||
[self.view makeToast:@"请先将手机连接到wifi:ifish-xxxx"];
|
||||
return;
|
||||
}
|
||||
self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
self.HUD.mode = MBProgressHUDModeIndeterminate;
|
||||
self.HUD.labelText = @"重置指令已发出";
|
||||
[IFishHotpotUDPHelper sharedInstance].delegate = self;
|
||||
[[IFishHotpotUDPHelper sharedInstance] broadCastRestCommand];
|
||||
[CommonUtils getNetworkTypeComplete:^(NSString *netconnType, NSString *BSSID, NSString *SSID) {
|
||||
if (![SSID.lowercaseString hasPrefix:@"ifish"]) {
|
||||
[self.view makeToast:@"请先将手机连接到wifi:ifish-xxxx"];
|
||||
return;
|
||||
}
|
||||
self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
self.HUD.mode = MBProgressHUDModeIndeterminate;
|
||||
self.HUD.labelText = @"重置指令已发出";
|
||||
[IFishHotpotUDPHelper sharedInstance].delegate = self;
|
||||
[[IFishHotpotUDPHelper sharedInstance] broadCastRestCommand];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (IBAction)tipBtnClicked:(id)sender {
|
||||
@@ -62,17 +65,6 @@
|
||||
|
||||
#pragma mark - 删除设备
|
||||
|
||||
- (NSString *)currentWifiSSID {
|
||||
NSString *ssid = @"Not Found";
|
||||
CFArrayRef myArray = CNCopySupportedInterfaces();
|
||||
if (myArray != nil) {
|
||||
CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
|
||||
if (myDict != nil) {
|
||||
NSDictionary *dict = (NSDictionary *)CFBridgingRelease(myDict);
|
||||
ssid = [dict valueForKey:@"SSID"];
|
||||
}
|
||||
}
|
||||
return ssid;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
// CFShow((__bridge CFTypeRef)(infoDic));
|
||||
NSString *app_Version=[infoDic objectForKey:@"CFBundleShortVersionString"];
|
||||
NSLog(@"app_Version%@",app_Version);
|
||||
app_Version=@"4.7.21";
|
||||
app_Version=@"4.7.22";
|
||||
NSString *versionStr = [NSString stringWithFormat:@"v%@",app_Version];
|
||||
NSString *buildVersion = [infoDic objectForKey:@"CFBundleVersion"];
|
||||
if (buildVersion.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user