FIX: Import QR Code from screenshot not working

This commit is contained in:
Marcos Rodriguez 2019-11-25 21:56:17 -06:00 committed by Overtorment
parent 76ed479846
commit 6d025bc9cb

View file

@ -1,6 +1,6 @@
/* global alert */
import React from 'react';
import { Image, TouchableOpacity } from 'react-native';
import { Image, TouchableOpacity, Platform } from 'react-native';
import PropTypes from 'prop-types';
import { RNCamera } from 'react-native-camera';
import { SafeBlueArea } from '../../BlueComponents';
@ -74,7 +74,7 @@ export default class ScanQRCode extends React.Component {
},
response => {
if (response.uri) {
const uri = response.uri.toString().replace('file://', '');
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
LocalQRCode.decode(uri, (error, result) => {
if (!error) {
this.onBarCodeRead({ data: result });