Browse Source

摄像头权限弹窗

Steven 7 months ago
parent
commit
3224799dbe

+ 15 - 12
KulexiuForStudent/KulexiuForStudent/Common/Base/WebView/KSBaseWKWebViewController.m

@@ -766,11 +766,26 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
                 NSMutableDictionary *sendParm = [NSMutableDictionary dictionaryWithDictionary:parm];
                 [sendParm setValue:sendContent forKey:@"content"];
                 [self postMessage:sendParm];
+                [self showAlertWithMessage:@"请开启相机访问权限" type:CHECKDEVICETYPE_CAMREA];
             }
         }];
     }
 }
 
+- (void)showAlertWithMessage:(NSString *)message type:(CHECKDEVICETYPE)deviceType {
+    [KSPremissionAlert shareInstanceDisplayImage:deviceType message:message showInView:self.view cancel:^{
+        
+    } confirm:^{
+        [self openSettingView];
+    }];
+    
+}
+
+- (void)openSettingView {
+    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
+
+}
+
 - (void)openOutLink:(NSString *)url {
     // 外部浏览器打开
     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[url getUrlEndcodeString]] options: @{} completionHandler: nil];
@@ -1160,18 +1175,6 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     }
 }
 
-- (void)showAlertWithMessage:(NSString *)message type:(CHECKDEVICETYPE)deviceType {
-    [KSPremissionAlert shareInstanceDisplayImage:deviceType message:message showInView:self.view cancel:^{
-        
-    } confirm:^{
-        [self openSettingView];
-    }];
-    
-}
-
-- (void)openSettingView {
-    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
-}
 
 - (void)displaySource:(NSURL *)localUrl {
     KSLocalWebViewController *ctrl = [[KSLocalWebViewController alloc] init];