I'm developing an app using react-native-camera, RNCamera, on ejected mode.
BTW, the text recognition feature is supposed to work only for Android.
On Portrait mode, it only detects Single or double characters on each detect event, like 'O', 'IC'.
When I rotate to landscape mode, it works perfectly.
Heres is how I handle the event and render it:
onTextRecognized = ({textBlocks}) => this.setState({ detectedTexts: textBlocks.map(b => b.value) })
renderDetectedText() {
return (
<View style={[styles.facesContainer,{left: 10, top:"50%"}]}>
<Text style={styles.flipText}>{this.state.detectedTexts.join("\n")}</Text>
</View>
)
}
renderCamera() {
<RNCamera
ref={ref => {this.camera = ref;}}
style={{flex: 1}}
type={this.state.type}
flashMode={this.state.flash}
autoFocus={this.state.autoFocus}
zoom={this.state.zoom}
whiteBalance={this.state.whiteBalance}
ratio={this.state.ratio}
onTextRecognized={this.onTextRecognized}
focusDepth={this.state.depth}
permissionDialogTitle={'Permission to use camera'}
permissionDialogMessage={'We need your permission to use your camera phone'}>
{this.renderDetectedText()}
</RNCamera>
}
A'm testing int using a real Android 7.0 device
Here's the link for the React-native-community Issue gitHub page.