StephenGrider / rn-casts

Companion Repo for a React Native course on Udemy
https://www.udemy.com/the-complete-react-native-and-redux-course
865 stars 472 forks source link

requestPermissionsAsync() does not reject the promise in case of failure #3

Closed erichimm closed 4 years ago

erichimm commented 4 years ago

In useLocation.js, requesting user permissions is incomplete. As per the docs here, this function always resolves with a PermissionResponse object, even if permission is not granted.

Our code needs to check the response object, and throw an error manually in order to enter the catch block as expected.