cordova-plugin-geolocation icon indicating copy to clipboard operation
cordova-plugin-geolocation copied to clipboard

watchPosition on iphoneXR causes Cordova crash/restart

Open EZSlim opened this issue 6 years ago • 3 comments

Bug Report

Using this code on an iPhone XR var watchID = navigator.geolocation.watchPosition(onSuccess, onError, { maximumAge: 3, timeout: 5000, enableHighAccuracy: true });

ios version 12.2

NOTE: same code on other iphone devices (iphone 5SE, iphone 6S, iphone 7) does NOT cause the crash.

Causes what I believe to be a Cordova crash and restart. See ios analytics files (attached/included)

Problem

After about 2 minutes after starting up the watchPosition with the given parameters, the app appeared to crash. This information from the ios analytics file led me to watchPosition: Event: wakeups Action taken: none Wakeups: 45001 wakeups over the last 211 seconds (213 wakeups per second average), exceeding limit of 150 wakeups per second over 300 seconds Wakeups limit: 45000 Limit duration: 300s Wakeups caused: 45001 Duration: 145.75s Steps: 11

Suppressed the start of watchPosition and the app operated stable.

Command or Code

var watchID = navigator.geolocation.watchPosition(onSuccess, onError, { maximumAge: 3, timeout: 5000, enableHighAccuracy: true });

Environment, Platform, Device

iphone XR (new on 5/2/19)

Version information

Phonegap version: CLI 7.1.0 Phonegap builder version: 2

Geolocation plugins tested: 2.4.3 and 4.0.1

Checklist

  • [X ] I searched for existing GitHub issues
  • [ X] I updated all Cordova tooling to most recent version
  • [ X

LTIS_OH_DEV.wakeups_resource-2019-05-09-092828.txt LTIS_OH_DEV-2019-05-09-102418.txt

] I included all the necessary information above

EZSlim avatar May 10 '19 01:05 EZSlim

More information: It isn't necessarily the watchPosition that is the cause...it is some combination of the usage of watchPosition and clearWatch that is the issue.....I'm doing more testing and analysis and will post more information at a later time.

EZSlim avatar May 10 '19 11:05 EZSlim

I can confirm this issue on iOS 12.2 and 12.3, Although I just get a timeout error.

I've reverted to polling getCurrentPermission.

synnottd avatar May 20 '19 11:05 synnottd

Is this reproducible in a new, plain Cordova app? A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md

janpio avatar Jun 12 '19 14:06 janpio

Closing as stale.

breautek avatar Jun 05 '23 01:06 breautek