You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the instructions at (https://cordova.apache.org/docs/en/11.x/guide/platforms/ios/webview.html) on embedding a Cordova Web view into a Swift project. I used Carthage, and added the xcframework to my project. It all works, but with the default file protocol. I need the secure context, though, so I tried adding a custom scheme to the config.xml:
This results in a blank screen, with about:blank as the location.
My view controller doesn't do anything special, it just inherits CDVViewController.
class CordovaWebViewController: CDVViewController {
}
So I stepped through the CDVWebViewEngine code, and found that the URL being loaded is app://localhost/index.html. So far so good, but we never actually load that URL. Eventually we get to CDVWebViewEngine.decidePolicyForNavigationAction, which ultimately sends a CDVPluginHandleOpenURLNotification. This is handled by the CDVHandleOpenURL plugin, which wasn't being loaded automatically. This was suspicious - am I on the wrong track?
Anyway, I added it to the config.xml manually, and added some NSLogs to that plugin to make sure it loads. The logs revealed that the plugin's applicationLaunchedWithUrl is being called (with the correct URL), but it does nothing because self.pageLoaded is NO. At this point I'm a bit lost, because I don't understand how we expect the page to be loaded when we're in the process of loading it.
Any help would be appreciated. Thanks.
The text was updated successfully, but these errors were encountered:
The stringWithFormat should be combining two strings, but it is instead combining an NSString and an NSUrl. Adding .absoluteString to the startURL should address this (it's very difficult for me to raise a PR at work, otherwise I'd do this.)
cordova-ios 6.2.0
I followed the instructions at (https://cordova.apache.org/docs/en/11.x/guide/platforms/ios/webview.html) on embedding a Cordova Web view into a Swift project. I used Carthage, and added the xcframework to my project. It all works, but with the default file protocol. I need the secure context, though, so I tried adding a custom scheme to the config.xml:
This results in a blank screen, with about:blank as the location.
My view controller doesn't do anything special, it just inherits CDVViewController.
So I stepped through the
CDVWebViewEngine
code, and found that the URL being loaded is app://localhost/index.html. So far so good, but we never actually load that URL. Eventually we get toCDVWebViewEngine.decidePolicyForNavigationAction
, which ultimately sends aCDVPluginHandleOpenURLNotification
. This is handled by theCDVHandleOpenURL
plugin, which wasn't being loaded automatically. This was suspicious - am I on the wrong track?Anyway, I added it to the config.xml manually, and added some NSLogs to that plugin to make sure it loads. The logs revealed that the plugin's
applicationLaunchedWithUrl
is being called (with the correct URL), but it does nothing becauseself.pageLoaded
isNO
. At this point I'm a bit lost, because I don't understand how we expect the page to be loaded when we're in the process of loading it.Any help would be appreciated. Thanks.
The text was updated successfully, but these errors were encountered: