[ad_1]
Inside my Expo venture I am utilizing expo-camera. Each on Android and iOS the digicam asks permission earlier than opening it.
However when I attempt to open the net model of my venture on a cellular system browser, the digicam entry is denied instantly with out asking. I attempted this on an iPhone 12 and a Samsung Galaxy S20. However each did not ask permission.
Inside my code I take advantage of the next line to ask for permission:
const [hasPermission, setHasPermission] = useState(null)
useEffect(() => {
;(async () => {
const { standing } = await Digital camera.requestCameraPermissionsAsync()
setHasPermission(standing === 'granted')
})()
}, [])
That is how I name the digicam part from expo-camera
import { Digital camera, CameraType } from 'expo-camera'
return (
<Digital camera ref={ref => set_camera(ref)} kind={kind} fashion={{ flex: 1 }}/>
)
How can I make a cellular browser additionally ask for digicam permission and forestall it from denying instantly?
[ad_2]
