- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我们试用了新的 NetworkExtension API。我们成功地在我们的应用程序中重新创建了所有步骤。但是,我们有一个问题,我们仍然没有在 Wifi 设置屏幕中看到 SSID 名称下方的自定义注释。我们在 ios 9 Beta 3、xcode 7 beta 3 上。
我们已经成功完成了这些步骤:
@note 1 应用程序的 Info.plist 必须包含一个 UIBackgroundModes 数组* 包含“网络身份验证”。
@注2* 应用程序必须设置“com.apple.developer.networking.HotspotHelper”* 作为其权利之一。权利的值是一个 bool 值* 值为真。
这是我们在应用程序中的代码。我们正在尝试通过文本“Try Here”注释名称为“Internet”的 SSID。我们得到为 SSID“Internet”调用 setConfidence 方法的日志。然而,我们在 Wifi 选择屏幕中看不到实际的注释。
我们还尝试为 promise 将应用程序名称显示为默认注释的选项对象传递“nil”。但我们也没有看到。我们在调用方法 registerWithOptions() 时得到返回“true”,并且在打开 wifi 设置屏幕时确实得到回调
NSMutableDictionary* options = [[NSMutableDictionary alloc] init];
[options setObject:@"Try Here" forKey:kNEHotspotHelperOptionDisplayName];
dispatch_queue_t queue = dispatch_queue_create("com.myapp.ex", 0);
BOOL returnType = [NEHotspotHelper registerWithOptions:options queue:queue
handler: ^(NEHotspotHelperCommand * cmd) {
if(cmd.commandType == kNEHotspotHelperCommandTypeEvaluate || cmd.commandType == kNEHotspotHelperCommandTypeFilterScanList ) {
for (NEHotspotNetwork* network in cmd.networkList) {
if ([network.SSID isEqualToString:@"Internet"]){
[network setConfidence:kNEHotspotHelperConfidenceHigh];
NSLog(@"Confidance set to high for ssid:%@",network.SSID);
}
}
}
}];
=========================
请帮助我们了解我们缺少什么?
最佳答案
我已经实现了以下代码,用于在应用程序中使用“连接到 MyWifi”为 SSID“TP-LINK”验证和注释 Wifi 热点,它工作正常。
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:@"Connect to MyWifi", kNEHotspotHelperOptionDisplayName, nil];
dispatch_queue_t queue = dispatch_queue_create("com.myapp.ex", 0);
BOOL isAvailable = [NEHotspotHelper registerWithOptions:options queue:queue handler: ^(NEHotspotHelperCommand * cmd) {
NSMutableArray *hotspotList = [NSMutableArray new];
if(cmd.commandType == kNEHotspotHelperCommandTypeEvaluate || cmd.commandType == kNEHotspotHelperCommandTypeFilterScanList) {
for (NEHotspotNetwork* network in cmd.networkList) {
NSLog(@"network name:%@", network.SSID);
if ([network.SSID isEqualToString:@"TP-LINK"]) {
[network setConfidence:kNEHotspotHelperConfidenceHigh];
[network setPassword:@"<wifi-password>"];
[hotspotList addObject:network];
}
}
NEHotspotHelperResponse *response = [cmd createResponse:kNEHotspotHelperResultSuccess];
[response setNetworkList:hotspotList];
[response deliver];
}
}];
注意:要让上面的代码正常工作,
关于ios - NEHotspotHelper 注释未出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31704292/
是否可以使用 NEHotspotHelper 测试原型(prototype)应用程序(开发部署)- 从应用程序连接到 WiFi 而无需请求 com.apple.developer.networking
我们试用了新的 NetworkExtension API。我们成功地在我们的应用程序中重新创建了所有步骤。但是,我们有一个问题,我们仍然没有在 Wifi 设置屏幕中看到 SSID 名称下方的自定义注释
我已经像他们说的那样提交了这个表格 https://developer.apple.com/contact/network-extension/ 然后我收到了苹果的邮件 Please note tha
我正在开发一款要求自动连接到 WiFi 网络的 iOS 应用。我们已向 Apple 请求 NEHotspotHelper 扩展,该扩展已获批准。 现在我正在尝试自动连接到周围的 WiFi 网络。但是对
我已经实现了 NEHotspotHelper,这样我就可以在后台为带有强制门户的网络执行身份验证。 我需要在“身份验证”状态下执行 Web 请求,以便我可以检索 Wispr 并访问 API。 但是,当
我已经为使用 Network Extension API 注册了我的应用程序,并根据评论 here 启用了后台模式.因此,当用户进入 wifi 设置时,我能够看到范围内的 wifis 列表,但我不知道
我正在使用 NEHotspotHelper 并尝试注册但没有收到回电。首先, I enabled Capability : Network Extensions 然后添加以下代码, let opti
当我尝试调用 registerWithOptions 它总是返回 false 时,您知道我的代码和设置中缺少什么吗? 我已经拥有 NetworkExtension 授权。 我已经创建了一个授权 并且已
我一直在将 NEHotspotHelper 整合到我管理强制网络的应用程序中,但我遇到了多个问题。在设置为高置信度的网络处于评估状态后,我没有收到身份验证命令 (kNEHotspotHelperCom
我现在正在实现一个将使用 NEHotspotHelper API 的项目。通过 Xamarin。 我知道这个 API 需要得到苹果的批准。所以我已经发送了我的请求并等待回复。 但我想先编写代码并在我的
我已经这样做了。 1。在苹果开发者页面添加IOS证书。 2。在 Apple Developer 页面中添加启用了网络扩展的标识符 App ID。 3。在 Apple Developer 页面中添加配置
我是一名优秀的程序员,十分优秀!