Closed danielolivaresd closed 5 years ago
Are you seeing your app boot and hanging at splash-screen periodically?
I'm experiencing this myself on iOS 11.1.2 / iPhone X. If this occurs, you will miss tracking for periods. These splash-screen hangs don't seem to occur on my iPhone 6s.
I'm erasing my iPhone 6s to do some further testing alongside the iPhone X to verify.
I'm thinking this is a Cordova issue related to apps booting in the background.
I'm also seeing a large number of app crashes (not related to the plugin):
Incident Identifier: A0F3F136-EE10-4360-A511-B65D535C65CC
CrashReporter Key: 5e43e12affadca8ecf3e8be2546fcf1c7b5b7ba7
Hardware Model: iPhone10,6
Process: BG Geo [14992]
Path: /private/var/containers/Bundle/Application/5D7AC67D-02BA-4488-A6B8-908F30908B09/BG Geo.app/BG Geo
Identifier: com.transistorsoft.backgroundgeolocation.ionic2
Version: 2.9.1 (2.9.1)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.transistorsoft.backgroundgeolocation.ionic2 [6029]
Date/Time: 2017-11-27 11:27:50.6976 -0500
Launch Time: 2017-11-27 11:24:44.2623 -0500
OS Version: iPhone OS 11.1.2 (15B202)
Baseband Version: 1.02.03
Report Version: 104
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace <0xF>, Code 0x8badf00d
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000182ee4bc4 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000182ee4a3c mach_msg + 72
2 CoreFoundation 0x0000000183395c74 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x0000000183393840 __CFRunLoopRun + 1424
4 CoreFoundation 0x00000001832b3fb8 CFRunLoopRunSpecific + 436
5 GraphicsServices 0x000000018514bf84 GSEventRunModal + 100
6 UIKit 0x000000018c8882e8 UIApplicationMain + 208
7 BG Geo 0x000000010297a3cc main + 25548 (main.m:32)
8 libdyld.dylib 0x0000000182dd656c start + 4
Are you seeing your app boot and hanging at splash-screen periodically?
I only notice this after a day or two, but I'm not constantly checking. The reason being, the main use for the app is to run in background, so when I do re-open the app is after I check my backend and see I'm not receiving updates anymore. I'll try to keep checking to see if the hanging occurs in the next hours, and compare this to the plugin's updates.
I'm experiencing this myself on iOS 11.1.2 / iPhone X. If this occurs, you will miss tracking for periods. These splash-screen hangs don't seem to occur on my iPhone 6s. I'm erasing my iPhone 6s to do some further testing alongside the iPhone X to verify.
I have an iPhone 4S lying around, so I will also install the app to this device and check how it goes.
I'm thinking this is a Cordova issue related to apps booting in the background. I'm also seeing a large number of app crashes (not related to the plugin):
Makes sense to me. Any ideas on how to make sure, or where to report this?
BTW: Thanks for your lightning-fast support!
Update: Just to give you more context.
By googling similar issues I found https://github.com/meteor/meteor/issues/8482#issuecomment-329103530 which mentions that when debugging the app when the splash screen hangs, the following error is returned:
exception native EvalAnd Fetch : ReferenceError: Can't find variable: cordova
and I remember I also found that error today, so this enforces your idea of it being a Cordova related issue.
I've just received a report from another iPhone X user experiencing same issue as me #539
@christocracy, I am experiencing the exact same issue, but with cordova-plugin-ibeacon. I think you're right that it must be caused by iOS launching the app in the background. I am about to try putting this script in below my Cordova reference to see if that makes a difference, but it's difficult to test as it doesn't always happen.
<script src="cordova.js"></script>
<script>
if (!window.cordova) {
window.cordova = require('cordova');
}
</script>
Try removing cordova-plugin-splashscreen
Neither of these fixes worked
More information here
I don't think splashscreen
is the culprit here. There's definitely something weird happening with cordova-plugin-ionic-webview
.
I'm having good performance now simply removing cordova-plugin-ionic-webview
. ionic-webview
is far too buggy for use with apps which can boot in the background.
cordova-plugin-splashscreen
was a red herring. It's not involved at all.
Are you getting same with iPhoneX as well?
Iβm primarily developing on iPhone X. Iβm not seeing whitescreen
I'm having the same problem described at the top on both iPhone SE and iPhone 6. We are not using cordova-plugin-ionic-webview
. Any idea of other plugins that might be causing the same problem?
Iβm no longer having this issue. Show me your cordova plugins.
Try the sample app.
My cordova plugins are:
cordova:cordova-background-geolocation-lt
cordova:cordova-custom-config
cordova:cordova-plugin-device
cordova:cordova-plugin-flashlight
cordova:cordova-plugin-meteor-webapp
Most likely related to cordova-plugin-meteor-webapp doing some poor behaviour.
I would check the issues at cordova-plugin-meteor to see if there's anything there matching your problem.
Is cordova-plugin-ionic-webview still causing problems? Because I also sometimes notice app being stuck at splashscreen and background location plugin seems to stop working sometimes when I close the app entirely - the debug message "App booted in background" does not appear and no locations are tracked.
I donβt use it. I would assume it still causes problems with iOS apps booted in the background.
Any recent updates on this issue?
This issue still persists using cordova-plugin-ionic-webview
i.e. WKWebView.
Any suggestions on alternatives for the cordova-plugin-ionic-webview
?
Has anyone tried a 'downgrade' from WKWebView to the legacy UIWebView?
I have not tried this since March. I do not trust webview
plugins in apps that boot in the background. Simply remove your -webview
plugin.
Hi Chris,
When the plugin is in Debug mode, should I expect to see a notification when the app is rebooted in the background?
Yes, it emits a βBooted in backgroundβ local-notification, in addition to all the usual notifications youβd see when launching from home-screen.
This is easy to observe in simulator by simulating location then terminating app.
Okay that's great. Thanks Chris.
When you say 'Terminating the app' do you mean clicking the home button on iPhone. Or do you mean swiping the app out of the selection of minimized apps?
When running in iOS, after some time (it can take hours or some days after the app was started and then put in the background) the app stops geolocating. We could see this because while other (non iOS devices) continue to POST to our endpoint, the iOS device running the same version of our app (i.e. same config) stops updating its location. This has happened multiple times during the last weeks.
Your Environment
cordova -v
): 7.1.0cordova platform ls
): 4.5.3Plugin config
Expected Behavior
I expect the app to keep tracking the device indefinitely either when in foreground or background, since the app never calls the plugin to stop doing so.
Actual Behavior
The app stops INSERTing locations (and therefore POSTing them to our endpoint) unexpectedly after some short time (hours - days). Note: We have detected that after this "interruption" happens, when we try to open the app, it hangs on the splash screen and we have to close it and reopen it to make it work again. At this point, the plugin starts working as expected.
Steps to Reproduce
Nothing is needed to reproduce the bug. It happens "by itself".
Context
Track the device constantly without it being interrupted in iOS devices
Debug logs
Note how after 2017-11-25 23:45:50.813, the plugin doesn't have any logs until today, after we opened, closed, and reopened the app (see "Actual Behavior")
EDIT: I forgot to mention, that I also add an HTTP header as follows.
PLUGIN_CONFIGURATION
is a constant with the contents that I mention above.