React native Deepar SDK, Getting blank screen when reopens the camera in some Iphones #43

26 Views Asked by At

Camera got open fine at the first time, Then when i leave the page and comes back, I see blank screen. Some suggestions says to shutdown the camera when goes back and then when you come back to camera page it will reinitialised itself. But the deepARRef1 does not contain shutdown function to call. Here is the code i am using

 import React, { useEffect, useRef } from 'react';
 import { TouchableOpacity } from 'react-native';
 import { View } from 'react-native';
 import { Text } from 'react-native';
 import DeepARView from 'react-native-deepar';

 const DeepARWrapper = (props) => {
 const deepARRef1 = useRef(null);

 return (
 <View style={{ flex: 1 }}>
      <TouchableOpacity
      style={{
          position: 'absolute',
          top: 70,
          left: 20,
          zIndex: 33333,
          flexDirection: 'row',
          justifyContent: 'center',
          alignItems: 'center'
      }}
      onPress={()=>{
        deepARRef1.current.shutdown(); // tried to call here
        props.navigation.goBack();
      }}>
        <Text style={{ color: 'red', marginLeft: 5 }}>Go Back</Text>
      </TouchableOpacity>
      <DeepARView 
        ref={deepARRef1}
        apiKey="-" 
        style={{flex: 1}} 
        onInitialized={() => {
          console.log('==================initialized now==================');
        }}
        onShutdownFinished={() => {
          console.log('================== onShutdownFinished now ==================');
        }}
      />
 </View>
 );
 };

 export default DeepARWrapper;
0

There are 0 best solutions below