You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// In root component's render methoduseEffect(()=>{asyncfunctionexecute(){awaitBackgroundGeolocation.ready({reset: false,});}execute();},[]);
...
// in code that handles user setting a day based scheduleasyncfunctionstopBGSchedule(){conststate=awaitBackgroundGeolocation.stopSchedule();if(state.enabled){awaitBackgroundGeolocation.stop();}}// e.g `[ '1 00:01-23:59']`functionsetSchedule(scheduleArray){awaitstopBGSchedule();awaitBackgroundGeolocation.setConfig({distanceFilter: 25,stopOnTerminate: false,startOnBoot: true,foregroundService: true,schedule: scheduleArray,// Androidnotification: {title: 'Tern',text: 'Detecting when you cycle, walk and run to work.',channelName: 'Active commute detection',color: BRAND_COLOR,smallIcon: 'drawable/ic_stat_ic_notification',largeIcon: 'drawable/ic_stat_ic_notification',priority: BackgroundGeolocation.NOTIFICATION_PRIORITY_MIN,},// http optionsurl: generateTrackingUrl(userId),params: {device: {uuid: deviceInfo.getModel().replace(/[\s.,]/g,'-'),model: deviceInfo.getModel(),platform: deviceInfo.getSystemName(),manufacturer: awaitdeviceInfo.getManufacturer(),version: deviceInfo.getSystemVersion(),framework: 'ReactNative',},},autoSyncThreshold: 20,batchSync: true,maxBatchSize: 60,showsBackgroundLocationIndicator: true,});awaitBackgroundGeolocation.startSchedule();}
Expected Behavior
The plugin should automatically stop tracking the when the current time falls outside of the users schedule.
Actual Behavior
The plugin carries on tracking, this is shown to users by the blue pill surrounding the clock in the top left corner of iOS, and location data carries on coming though to the server.
It's not until you open the app and reset the schedule with the same schedule array, it realises the current time is outside of the schedule and turns off.
Steps to Reproduce
On a real device, set a schedule that spans the whole of the current day, for example if it was Sunday, set the schedule to [1 00:01-23:59].
The plugin goes into an enabled state
The morning after (Monday morning), without opening the app, the plugin carries on tracking
Thanks Chris
The text was updated successfully, but these errors were encountered:
Ok, I reproduced this in the simulator by manually modifying my work-station's date/time (you terminate the iOS Simulator after doing so, for it to catch the updated time).
I found the problem and released a fix to v4.15.2.
Your Environment
react-native -v
): 0.71.16Expected Behavior
The plugin should automatically stop tracking the when the current time falls outside of the users schedule.
Actual Behavior
The plugin carries on tracking, this is shown to users by the blue pill surrounding the clock in the top left corner of iOS, and location data carries on coming though to the server.
It's not until you open the app and reset the schedule with the same schedule array, it realises the current time is outside of the schedule and turns off.
Steps to Reproduce
[1 00:01-23:59]
.Thanks Chris
The text was updated successfully, but these errors were encountered: