Open randy-johnson opened 7 years ago
@christocracy, pinging you on this since it has been a couple days. Thank You
distanceFilter: 50, heartbeatInterval: 60*15}
. Listen to heartbeat event.
Simulator is not the best way to test the plugin. The plugin relies on accelerometer-based Motion-detection APIs to decide when to start recording locations. Simulators don't have accelerometers.
If you want the plugin to record locations in Simulator, you have to manually tell the plugin to change to "moving" state with changePace(true)
.
Thank you. I was able to use a batch file script using genyshell.exe to feed latitude and longitude to the emulator along with the ChangePace(true) to simulate movement.
@christocracy,
I wanted to follow up on this. This configuration works awesome in Android but not IOS.
desiredAccuracy: 0,
distanceFilter: 50,
heartbeatInterval: 60*15,
foregroundService: false,
I have 2 questions:
Will the above configuration still allow the ios app to communicate on distance changes when the app is minimized? Currently my app only seems to be communicating with my server when the app is open so I want to make sure I am not missing some config settings here.
I was reading in the docs that in order to use heartbeat interval on IOS that I have to use preventSuspend = true which is a bad idea because of battery. Does IOS ignore the setting since I am not using preventSuspend?
Thank You,
There is no heartbeat on iOS without preventSuspend.
When iOS app is placed in background while in stationary state, iOS has suspended your app.
When the iOS device moves about 200 meters beyond last know location, iOS will awaken your app, the plugin will turn on location services and your app is now completely alive in background (just as if it was running in foreground). It will stay alive, recording a location each distanceFilter meters until the device is detected to have become stationary, when the plugin will initiate the stopTimeout timer. When stopTimeout elapses, the plugin will turn off location-services and iOS will immediately put your app to sleep. And the whole cycle begins again.
There is no heartbeat on iOS without preventSuspend.
When iOS app is placed in background while in stationary state, iOS has suspended your app.
When the iOS device moves about 200 meters beyond last know location, iOS will awaken your app, the plugin will turn on location services and your app is now completely alive in background (just as if it was running in foreground). It will stay alive, recording a location each distanceFilter meters until the device is detected to have become stationary, when the plugin will initiate the stopTimeout timer. When stopTimeout elapses, the plugin will turn off location-services and iOS will immediately put your app to sleep. And the whole cycle begins again.
So, anytime I lock my iphone, distanceFilter is no longer being respected? Is this why? I am still getting GPS captures, just not with the accuracy my config suggests. From my understanding preventSuspend only affects heartbeatInterval, but without preventSuspend my gps does not capture at the correct intervals.
So, anytime I lock my iphone, distanceFilter is no longer being respected?
The plug-in doesn’t care if your phone is locked. If the device moves at least 200 meters, the plug-in begins tracking, even if your phone is locked and in your pocket.
but without preventSuspend my gps does not capture at the correct intervals.
The plug-in does not require preventSuspend to operate. You just need to go outside and move at least 200 meters.
Your Environment
tns info
): 2.5.3I am wondering what config options I would use to have the app communicate every 50 meters and then perhaps every 15 minutes if the app doesn't move more than 50 meters?
I have distanceFilter: 50,
I was thinking maybe this: locationUpdateInterval but the docs make it sound like distanceFilter has to be 0.
heartbeat interval sounds like it could be a possibly too.
Thank You,
Randy