We have created a sample HTML page with service worker to enable offline load for iOS 15, And we are loading the sample HTML page in IOS Sample App .
Sample app contains the WKWebview(which is webkit framework) which loads the sample HTML. we have added the app bound domain in the Info.plist to support the Service Worker.
AppBoundDomains in Info.plist is
<key>WKAppBoundDomains</key>
<array>
<string>https://ottapp-appgw-client.dev.mr.tv3cloud.com</string>
</array>
And configured the WKWebViewConfiguration for WKWebView through code:
if (@available(iOS 14.0, *)) {
configuration.limitsNavigationsToAppBoundDomains = YES;
}
Working Scenario is :
When we launch the application in online mode for the first time, it is successfully registering the ServiceWorker. On launching the application in offline mode, it successfully loads the offline page in iOS 15.
Issue is :
After repeatedly killing and relaunching the application many time (say 5-6 times), we are seeing the blank screen instead of loading the offline page (which is Service Worker Enabled)
we are receiving the below error when service worker is not working:
[Process] 0x10581f018 - [pageProxyID=5, webPageID=6, PID=8803] WebPageProxy::didFailProvisionalLoadForFrame: frameID=3, domain=NSURLErrorDomain, code=-1009
2022-03-21 19:32:40.651305+0530 WKWebViewSample[8800:1490156] didFailProvisionalNavigation
Issue Repro rate 5 Out of 10
Added the logs for the same