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
As the title explains, on iOS if your app has watchPosition enabled and tracking user movement and the user puts your app in the background, later when the app comes back to the foreground watchPosition does not resume. It does auto-resume on Android.
What is expected to happen?
On iOS, for watchPosition to resume tracking the users position when app is restored to foreground.
What does actually happen?
watchPosition fails to reactivate
Information
On Android, wathcPosition automatically restarts. But for iOS I had to add this code in my device.ready() :
document.addEventListener("resume", onResume, false);
function onResume() {
// Handle the resume event
if (ionic.Platform.isIOS()) {
// gpsInfo.gpsEnbaled = user had already enabled GPS
// gpsInfo.gpsTrackingEnabled = watchPosition() had already been initiated
// gpsInfo.watchID = current instance of active watchPosition()
if (gpsInfo.gpsEnabled == true && gpsInfo.gpsTrackingEnabled == true) {
// if a previous watchID still exists, then kill it.
if (gpsInfo.watchID != null) {
gpsPositionTracking(0) ; // kill existing watchID if exists
}
// restart watchPosition()
gpsPositionTracking(1) ; // restart positionTracking
}
}
}
The text was updated successfully, but these errors were encountered:
Bug Report
As the title explains, on iOS if your app has watchPosition enabled and tracking user movement and the user puts your app in the background, later when the app comes back to the foreground watchPosition does not resume. It does auto-resume on Android.
What is expected to happen?
On iOS, for watchPosition to resume tracking the users position when app is restored to foreground.
What does actually happen?
watchPosition fails to reactivate
Information
On Android, wathcPosition automatically restarts. But for iOS I had to add this code in my device.ready() :
The text was updated successfully, but these errors were encountered: