Skip to content

Commit 42b41b7

Browse files
author
ccharlesren
committed
【APP】连连APP iOS隐私合规整改问题和解决方案:设置中蓝牙开关需要单独弹框提示,引导用户手动去设置
Tapd: http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192871147007 Change-Id: I4f03ac30d6294e615a59c61ff8c202f9d84662e2
1 parent e8aa6ce commit 42b41b7

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

Source/LinkApp/Classes/Module/Mine/Controller/TIoTAuthentationVC.m

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ - (void)centralManagerDidUpdateState:(CBCentralManager *)central {
222222
case CBManagerStateUnsupported:
223223
self.bluetoothAvailable = false; break; //NSLog(@"手机不支持蓝牙功能,请更换手机。");
224224
case CBManagerStatePoweredOff:
225+
226+
[self customAlertOpenBluetooth];
225227
self.bluetoothAvailable = false; break; //NSLog(@"手机蓝牙功能关闭,请前往设置打开蓝牙及控制中心打开蓝牙。");
226228
case CBManagerStateUnauthorized:
227229
self.bluetoothAvailable = false; break; //NSLog(@"手机蓝牙功能没有权限,请前往设置。");
@@ -230,4 +232,28 @@ - (void)centralManagerDidUpdateState:(CBCentralManager *)central {
230232

231233
[self.tableView reloadData];
232234
}
235+
236+
- (void)customAlertOpenBluetooth {
237+
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
238+
NSString *app_Name = [infoDict objectForKey:@"CFBundleDisplayName"];
239+
if (app_Name == nil) {
240+
app_Name = [infoDict objectForKey:@"CFBundleName"];
241+
}
242+
243+
NSString *messageString = [NSString stringWithFormat:NSLocalizedString(@"access_bluetooth_intro", @"如未能成功获取蓝牙状态,请尝试前往【设置】-【蓝牙】中开启,为了便于您访问蓝牙设备,因此腾讯连连需获取蓝牙权限")];
244+
NSString *titleString = [NSString stringWithFormat:@"\"%@\"%@",app_Name,NSLocalizedString(@"would_lick_access_bluetooth", @"想要使用蓝牙")];
245+
UIAlertController *alertC = [UIAlertController alertControllerWithTitle:titleString message:messageString preferredStyle:(UIAlertControllerStyleAlert)];
246+
247+
UIAlertAction *alertCancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"cancel", @"取消") style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
248+
249+
}];
250+
[alertC addAction:alertCancel];
251+
252+
UIAlertAction *alertConfirm = [UIAlertAction actionWithTitle:NSLocalizedString(@"confirm", @"确定") style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
253+
}];
254+
[alertC addAction:alertConfirm];
255+
256+
[self presentViewController:alertC animated:YES completion:nil];
257+
}
258+
233259
@end

Source/LinkApp/Supporting Files/Resource/en.lproj/Localizable.strings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,3 +976,5 @@ If the problem still persists, we recommend you remove the device and add it aga
976976
"access_photo_update_avatar" = "App需要访问您的相册用于上传头像";
977977
"turnon_photo_authorization" = "前往:设置开启相册授权";
978978
"agree_userAgreement_privacyPolicy" = "请同意用户协议和隐私协议后才能登录";
979+
"access_bluetooth_intro" = "如未能成功获取蓝牙状态,请尝试前往【设置】-【蓝牙】中开启,为了便于您访问蓝牙设备,因此腾讯连连需获取蓝牙权限";
980+
"would_lick_access_bluetooth" = "Would Like to Use Bluetooth";

Source/LinkApp/Supporting Files/Resource/zh-Hans.lproj/Localizable.strings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,3 +971,5 @@
971971
"access_photo_update_avatar" = "App需要访问您的相册用于上传头像";
972972
"turnon_photo_authorization" = "前往:设置开启相册授权";
973973
"agree_userAgreement_privacyPolicy" = "请同意用户协议和隐私协议后才能登录";
974+
"access_bluetooth_intro" = "如未能成功获取蓝牙状态,请尝试前往【设置】-【蓝牙】中开启,为了便于您访问蓝牙设备,因此腾讯连连需获取蓝牙权限";
975+
"would_lick_access_bluetooth" = "想要使用蓝牙";

0 commit comments

Comments
 (0)