From 1633b2a1311b7bc859db5612c05ce67b393a4d8e Mon Sep 17 00:00:00 2001 From: denispapakul Date: Wed, 13 May 2020 13:17:55 +0300 Subject: [PATCH] Add opening settings after geolocation start --- app/services/LocationService.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/services/LocationService.js b/app/services/LocationService.js index 20d370e8cf..730168a39d 100644 --- a/app/services/LocationService.js +++ b/app/services/LocationService.js @@ -1,6 +1,7 @@ import BackgroundGeolocation from '@mauron85/react-native-background-geolocation'; import PushNotificationIOS from '@react-native-community/push-notification-ios'; import { NativeModules } from 'react-native'; +import { openSettings } from 'react-native-permissions'; import PushNotification from 'react-native-push-notification'; import { CROSSED_PATHS, PARTICIPATE } from '../constants/storage'; @@ -154,7 +155,7 @@ export default class LocationServices { console.log('[INFO] BackgroundGeolocation service has been started'); }); - BackgroundGeolocation.on('authorization', status => { + BackgroundGeolocation.on('authorization', async status => { console.log( '[INFO] BackgroundGeolocation authorization status: ' + status, ); @@ -175,6 +176,9 @@ export default class LocationServices { }); } }); + } else { + await SetStoreData(PARTICIPATE, 'false'); + openSettings(); } });