EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 444 forks source link

barcode scanner doesn't work on ios #1497

Closed alqabali closed 4 years ago

alqabali commented 4 years ago

Hi. i have installed the plugin every thing works great except the barcode scanner it works only on android , but on the ios it doesn't . i have given the the permission to the app to use camera + adding the motif on the infoplist as recomanded in the documentation . i have set the appropriate formats and everything the app open the camera but it doesn't recognize barcodes and it doesn't show any error on the console.

tns-core-modules : 6.0.1 (i tried also last version without success) . tns-ios : 6.1.1 nativescript-plugin-firebase: 10.0.1

my package :

{
  "nativescript": {
    "id": "com.alaqial",
    "tns-ios": {
      "version": "6.1.1"
    },
    "tns-android": {
      "version": "6.0.2"
    }
  },
  "description": "",
  "license": "",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "~8.2.0",
    "@angular/common": "~8.2.0",
    "@angular/compiler": "~8.2.0",
    "@angular/core": "~8.2.0",
    "@angular/forms": "~8.2.0",
    "@angular/platform-browser": "~8.2.0",
    "@angular/platform-browser-dynamic": "~8.2.0",
    "@angular/router": "~8.2.0",
    "@nstudio/nativescript-loading-indicator": "^1.0.0",
    "nativescript-angular": "~8.2.0",
    "nativescript-appavailability": "^1.3.2",
    "nativescript-appversion": "^1.4.2",
    "nativescript-audio": "^5.0.5",
    "nativescript-barcodescanner": "^3.4.1",
    "nativescript-directions": "^1.3.1",
    "nativescript-drop-down": "^5.0.4",
    "nativescript-exit": "^1.0.1",
    "nativescript-fancyalert": "^3.0.9",
    "nativescript-geolocation": "^5.1.0",
    "nativescript-google-maps-sdk": "^2.8.0",
    "nativescript-image": "^2.2.5",
    "nativescript-ngx-slides": "^6.1.0",
    "nativescript-permissions": "^1.3.7",
    "nativescript-phone": "^1.4.0",
    "nativescript-plugin-firebase": "^10.0.1",
    "nativescript-sqlite": "^2.3.3",
    "nativescript-toasty": "^2.0.1",
    "nativescript-ui-listview": "^7.1.0",
    "reflect-metadata": "~0.1.12",
    "rxjs": "^6.4.0",
    "tns-core-modules": "~6.1.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~8.2.0",
    "@ngtools/webpack": "~8.2.0",
    "nativescript-dev-webpack": "~1.2.0",
    "node-sass": "^4.12.0",
    "sass-loader": "^8.0.0",
    "typescript": "~3.5.3"
  },
  "gitHead": "1964ea9e8ca1a0518e0d6370781eedcf6c23db42",
  "readme": "Native application"
}
fabioaraujo121 commented 4 years ago

Same issue here, trying to read and getting:

CONSOLE LOG file:///app/vendor.js:68384:20: 'Barcode engine is nil.'
2019-12-06 12:46:58.216961-0300 mpbpay[367:34855] 6.13.0 - [Firebase/MLKit][I-MLK006006] Barcode engine is nil.
2019-12-06 12:46:58.627664-0300 mpbpay[367:33494] CONSOLE LOG file:///app/vendor.js:68384:20: 'Barcode engine is nil.'
EddyVerbruggen commented 4 years ago

Did you try demo-ng? Instructions at the top of this readme: https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/docs/ML_KIT.md

alqabali commented 4 years ago

@EddyVerbruggen did all what you mentioned and the barcode scanner doesn't works on ios !

EddyVerbruggen commented 4 years ago

Does anyone else have this exact problem?

gitgmontoya commented 4 years ago

same issue on IOS 13.3.1, Iphone 7 Plus. The same project is working fine in Android >= 9. I'm using Nativescript-Vue. I can see what the camera is watching but the scanResult doesn't get triggered. tns-ios: version: 6.4.0 nativescript-plugin-firebase: ^10.4.0 XCode 11.3.1

gitgmontoya commented 4 years ago

fixed by reinstalling the plugin and reconfiguring it.

sitefinitysteve commented 4 years ago

@EddyVerbruggen Hey eddy, I'm sorry to bother, I am hitting this guy too, and I have no idea, man it's driving me nuts. I have reinstalled the plugin and ios platform more than I care to admit :)

Debug video: https://www.screencast.com/t/JrY6hhiE

image

Tried disabling beep

CONSOLE LOG file: node_modules/nativescript-plugin-firebase/mlkit/barcodescanning/index.ios.js:37:0: Barcode engine is nil.
6.16.0 - [Firebase/MLKit][I-MLK006006] Barcode engine is nil.
<Firebase:MLKitBarcodeScanner
                                class="scanner-cam mb-20"
                                width="350"
                                height="350"
                                beepOnScan="false"
                                formats="QR_CODE"
                                scanResult="onBarcodeScanningResult" />

I see the preview, but the success handler just trips the error handler every run

sgehrman commented 4 years ago

same problem, works fine on Android.

ghost commented 4 years ago

I solved this by adding "ml_kit_barcode_scanning": true in the firebase.nativescript.json, and rebuild project after remove node_modules and platform.