Maybe someone can help me. I have an ionic2 app and want to use one iframe. It works perfectly with ionic serve --lab. However as soon as I run it in Xcode or with ‘ionic run ios’ on simulator or device it stucks directly on the splash screen. When I remove the ‘src’ attribute it works again. But for sure the content is not available.
The last message of Xcode is:
2016-11-04 13:41:37.864621 appName[1917:655269] Resetting plugins due to page load.
From other topics I have seen that whitelist could be the problem. But my whitelist allows everything for now:
<allow-intent href="*"/>
<allow-navigation href="*"/>
<allow-navigation href="*://*.raywenderlich.com/*" />
<allow-navigation href="http://192.168.0.112:8100"/>
This turns out to be:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>raywenderlich.com/*</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>192.168.0.112</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
I use this URL just for test cases. However on other URLs it’s exactly the same. I have now used over 8 hours of research and don’t really know how to solve this.
This is how the html looks like:
<ion-header>
<ion-navbar color="primary">
<button ion-button menuToggle color="secondary">
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>
Test
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<main id="iframe-container">
<iframe src="https://www.raywenderlich.com/" frameborder="0" width="100%" height="100%" name="page_in_a_box" id="iframe-child" #iframeChild></iframe>
</main>
<div class="spinner" name="loading_spinner" #loadingSpinner>
<ion-spinner id="loading-spinner"></ion-spinner>
</div>
<main *ngIf="!connected" id="no-connection-error" padding>
<div id="no-connection-child">
<h3>Keine Netzwerkverbindung</h3>
<p>Leider haben Sie keine Netzwerkverbindung, daher kann der Inhalt nicht geladen werden. Stellen Sie sicher, dass eine Verbindung besteht.</p>
<button ion-button color="primary" (click)="checkNetworkAgain()">Erneut laden</button>
</div>
</main>
</ion-content>
EDIT:
On Android it works as expected. I can see the iframe exactly like in the browser.