Kaynağa Gözat

Fixed camera facing giving wrong value on startup on iOS

flutter-beta
Julian Steenbakker 5 yıl önce
ebeveyn
işleme
f439cd5a61
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 16E437C7A3D94250
2 değiştirilmiş dosya ile 3 ekleme ve 6 silme
  1. +1
    -0
      .gitignore
  2. +2
    -6
      ios/Classes/QRView.swift

+ 1
- 0
.gitignore Dosyayı Görüntüle

@@ -79,6 +79,7 @@ unlinked_spec.ds
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/.symlinks/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata


+ 2
- 6
ios/Classes/QRView.swift Dosyayı Görüntüle

@@ -204,12 +204,7 @@ public class QRView:NSObject,FlutterPlatformView {
func getCameraInfo(_ result: @escaping FlutterResult) -> Void {
MTBBarcodeScanner.requestCameraPermission(success: { permissionGranted in
if permissionGranted {
if let sc: MTBBarcodeScanner = self.scanner {
result(sc.camera.rawValue)
} else {
let error = FlutterError(code: "cameraInformationError", message: "Could not get camera information", details: nil)
result(error)
}
result(self.cameraFacing.rawValue)
} else {
return result(FlutterError(code: "cameraPermission", message: "Permission denied to access the camera", details: nil))
}
@@ -222,6 +217,7 @@ public class QRView:NSObject,FlutterPlatformView {
if let sc: MTBBarcodeScanner = self.scanner {
if sc.hasOppositeCamera() {
sc.flipCamera()
self.cameraFacing = sc.camera
}
return result(sc.camera.rawValue)
}


Yükleniyor…
İptal
Kaydet