Using Camera methods in BarCodeScanner

#1

Hey there,

I’m having the same problem than the one mentioned here: Difference between Camera and BarcodeScanner?.
I’m trying to use Camera methods with BarCodeScanner (Doc says it’s possible) but the app crashes when I try to use takePictureAsync. I’ve made a snack that shows what I’m trying to accomplish:
https://snack.expo.io/@afortunato/barcodescanner-taking-picture

I didn’t want to use the Camera component because I only need it for scanning codes and saving them, so it would be much simpler to just use the one above.
What am I doing wrong?

Thank you in advance.

0 Likes

#2

cc: @aalices

0 Likes

#3

Hello @afortunato sorry for this, we needed to make some changes to BarCodeScanner so it is a separate component from Camera for a time being and we did not update the docs :disappointed_relieved: however, we’re going to make it work again. But using Camera is not an overkill so feel free to use it. Once, we make the Scanner to have Camera’s methods available again it would just be Camera component but with some additional stuff.

1 Like

#4

OK, good to know!
Thank you for your response :smile:

0 Likes

closed #5

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

0 Likes