Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unabled to save the lat and long while the phone is locked. #142

Open
SMuncal opened this issue Aug 6, 2024 · 2 comments
Open

Unabled to save the lat and long while the phone is locked. #142

SMuncal opened this issue Aug 6, 2024 · 2 comments

Comments

@SMuncal
Copy link

SMuncal commented Aug 6, 2024

Hi support team & co-developer,

I have a module where I need to track Point A and Point B of delivery, normally the process of delivery is the phone is always awake not in locked mode and this is working fine all the coordinate is saved, if the phone is locked the coordinates is not saving in the Mongodb, I don't understand where the problem is but currently we used Transistorsoft for live tracking and meteorrn/core for saving the information.

async componentDidMount() { this.watchPosition() }

watchPosition = () => { BackgroundGeolocation.start() this.subscriptions.push(BackgroundGeolocation.onLocation((location) => { const { latitude, longitude } = location?.coords const params = { _id: this.props.id, timestamp: location?.timestamp, lat: latitude, lng: longitude, truckId: profile?.truckerId, }; this.props.dispatch(Jobs.updateLocation(params)) BackgroundGeolocation.destroyLocation }, (error) => { console.log('[onLocation] ERROR:', error); })) /// 2. ready the plugin. BackgroundGeolocation.ready({ // Geolocation Config desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, distanceFilter: 10, // Activity Recognition stopTimeout: 5, // Application config debug: false, // <-- enable this hear sounds for background-geolocation life-cycle. logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE, stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app. startOnBoot: true, // <-- Auto start tracking when device is powered-up. batchSync: false, // <-- [Default: false] Set true to sync locations to server in a single HTTP request. autoSync: true, // <-- [Default: true] Set true to sync each location to server as it arrives. }).then((state) => { }) };

@christocracy
Copy link
Member

The first step when something unusual happens is to observe the logs and enable debug: true.

see wiki “Debugging” and api docs “.emailLog”

@christocracy
Copy link
Member

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants