I experienced an issue with my App on an iPhone 8. The WebView does reload sometimes, when I use Capacitors Camera getPhoto function. This seems to happen more often, if I have some more apps open in background.
Some more infos I found out:
webViewWebContentProcessDidTerminate gets called to reload the view
Xcode logs before webViewWebContentProcessDidTerminate does get called:
[ProcessSuspension] 0x10d2d42d0 - ProcessAssertion::processAssertionWasInvalidated()**
[ProcessSuspension] 0x10d2d4300 - ProcessAssertion::processAssertionWasInvalidated()**
[assertion] Error acquiring assertion: <NSError: 0x2833e7630; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">**
[assertion] Error acquiring assertion: <NSError: 0x2833dc3c0; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">**
That suggests to me that it’s a resource starvation issue, which if true would place it squarely outside of the locus of control of your app. The phone is killing things in order to free up memory.
Are you using result type of Uri or base64? base64 can cause performance/memory issues on lower end devices, so we recommend Uri. See our First App example here for a real implementation.
This is also the last thing I call from my JavaScript code before the native camera view is shown. I can see the WebView reloading in my Xcode and Safari logs, right after i take the photo or just after pressing “Use Photo”.
Some context: The user of my app needs to take 8 photos in total, but the WebView keeps reloading sometimes and I need to retake the photo after that happens. I didn’t have this problem with my cordova apps.