From 8a4b7ba3e99d73a0c7b9957131d64401cbb53890 Mon Sep 17 00:00:00 2001 From: analuizaff Date: Fri, 5 Nov 2021 20:22:33 -0300 Subject: [PATCH] deprecated function to get permission to acess locationcupdating deprecated function to get permission to access the user's location --- src/app/hooks/useLocation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/hooks/useLocation.js b/src/app/hooks/useLocation.js index 0b5ab15..fba4310 100644 --- a/src/app/hooks/useLocation.js +++ b/src/app/hooks/useLocation.js @@ -6,7 +6,7 @@ function useLocation(defaultLocation = { longitude: 0.0, latitude: 0.0 }) { const getLocation = async () => { try { - const { granted } = await Location.requestPermissionsAsync(); + const { granted } = await Location.requestForegroundPermissionsAsync(); if (!granted) return; @@ -31,7 +31,7 @@ function useLocation(defaultLocation = { longitude: 0.0, latitude: 0.0 }) { const getLocation = async () => { try { - const { granted } = await Location.requestPermissionsAsync(); + const { granted } = await Location.requestForegroundPermissionsAsync(); if (!granted) return;