0

我正在尝试向 UIAlertAction 添加一个可以直接打开蓝牙设置的操作。

目前我可以打开设置,但是任何人都可以帮我将操作从“打开设置”更改为“打开蓝牙设置”吗?

UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
                                handler:^(UIAlertAction * action) {
                                        NSLog(@"Geverifieerd");
                                        NSURL *appSettings = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
                                        [[UIApplication sharedApplication] openURL:appSettings];
                                }];

谢谢

4

1 回答 1

0

根据Apple 文档中的此页面,您无能为力,您必须信任用户才能导航到蓝牙设置。

于 2015-05-26T07:49:14.193 回答