I'm trying to add Ionic 2 app as part of the native iOS application. As I found, CDVViewController should be used for integration.
pod 'Cordova', '4.2.1'
config.xml
which Ionic generated (not adding other files, because I need to display remote content)<content src="index.html" />
with <content src="http://localhost:8100/" />
in config.xml as their documentation says to do for remote content.localhost
to App Transport Security exceptions (I tested it in another UIWebView and it's definitely working)After all that CDVViewController still doesn't display my remote URL. Tried in many different ways with no luck.. Tried to navigate with JS — not working. Tried another domains as https://github.com. CDVViewController definitely see my config.xml
and drops errors if it not there. If I replace back to <content src="index.html" />
(and add index.html to resources), it displays that index page, no problems.
Finally found: needed to add <allow-navigation href="..." />
tag. In my case it was <allow-navigation href="http://localhost" />
.
Check https://github.com/apache/cordova-plugin-whitelist#navigation-whitelist