pawanbenjamin / zen-g-2024

0 stars 0 forks source link

added accelerometer availability checks to useIsShake() #19

Closed samryderE closed 3 months ago

samryderE commented 3 months ago

Expo recommends that if using any sensor it should first be checked that it is available to app. In this PR I Implemented logic to the hook that will check if the accelerometer is already available, if not it will request permission via an alert for the end user to enable access to the accelerometer, and if the app is not allowed to request permission or permission has been previously denied, the end user will be directed to the Settings of their device to enable permissions for the accelerometer in this app.