Saturday, September 24, 2022
HomeiOS DevelopmentExpo web-app not asking for digicam permission on iOS and Android browsers

Expo web-app not asking for digicam permission on iOS and Android browsers


Inside my Expo mission 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 mission on a cell machine 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 exploit 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)} sort={sort} model={{ flex: 1 }}/>
)

How can I make a cell browser additionally ask for digicam permission and stop it from denying instantly?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

1 × 2 =

Most Popular

Recent Comments