martijnwalraven / meteor-ios

Meteor iOS integrates native iOS apps with the Meteor platform (http://www.meteor.com) through DDP
MIT License
741 stars 82 forks source link

[IOS][1.3+] WKWebView terminated [White Screen of Death] - kills Geofence events #110

Closed Wade-BuildOtto closed 7 years ago

Wade-BuildOtto commented 7 years ago

When IOS WkWebview is terminated because the device is low on resources the apps Webview is no longer running and components like Geofence events are killed along with it.

I have added the below fix that recovers the app on open, but when the app is killed the geofences that were added, no longer trigger the transition event which allows me to call a method to track Exits and Enters from the user's device. This was working perfectly on 1.2.1 I had no issues for months.

Reference: [IOS] [1.3] White Screen Of Death ... #7018 pmwisdom commented on May 12 - "apple has basically said its a bug in the WebView. Here's an issue along the same lines on the plugin page:" - Telerik#41

I am using:

Meteor 1.3.5.1 cordova-plugin-geofence@0.6.0 cordova-plugin-wkwebview-engine@https://github.com/apache/cordova-plugin-wkwebview-engine.git#815ed0741b9ae30b343d6429bd8ff2ad37ec5790 (Web View Fix)

Wade-BuildOtto commented 7 years ago

here is a more basic run down:

IOS/Meteor 1.3 introduced using WkWebView when the phone requires more resources the device terminates the Webview and intern stops the core js from executing any further commands from things such as Geofence transition Events.

I have added the Wkwebview-engine fix to no effect, even when I add the orginal WebviewEngine setting it also had no effect. (I thought this would have resolved it.)

App.setPreference("CordovaWebViewEngine", "CDVUIWebViewEngine");

Wade-BuildOtto commented 7 years ago

any one know if this got fixed with ios 10

lceboy commented 7 years ago

I also met the same problem, you solve it?

Wade-BuildOtto commented 7 years ago

no and on top of it cowbell/geofence plugin isn't compatible with swift 3 so I had to remove half the features on our app

Wade-BuildOtto commented 7 years ago

I am calling this solved with meteor/cordova-plugin-meteor-webapp#30

cordova-plugin-meteor-webapp@https://github.com/panter/cordova-plugin-meteor-webapp.git#7bb095ce393d17f662cc6bb596ce91acf743d17a

This has recovered that app every time, no issues same day, 1 day, and 2 days of termination the app opened every time,