iOS not loading iframe content

3,662 views
Skip to first unread message

npku...@gmail.com

unread,
Jul 7, 2016, 6:17:34 PM7/7/16
to phonegap
Hello. I am trying to get iframes to work on iOS using Cordova CLI 6.2.0 and PhoneGap Desktop 0.3.3 . The iframes were working earlier in the Spring, but have since stopped working. Due to attempts finding a solution, and other delays, I wasn't able to ask earlier and know the precise version numbers of when the error started. 

To test options, I made a simple app to test functionality. The parts I think are relevant include index.html here:
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, target-densitydpi=device-dpi" />
<meta http-equiv="Content-Security-Policy" 
content="default-src * 'unsafe-inline' 'unsafe-eval'; 
frame-src * 'self' 'unsafe-inline' 'unsafe-eval';
style-src * 'self' 'unsafe-inline' 'unsafe-eval';
script-src * 'self' 'unsafe-inline' 'unsafe-eval';">
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <link rel="stylesheet" type="text/css" href="css/page.css" />
<script type="text/javascript" src="js/jquery-1.12.3.min.js"></script>
        <title>Webpage Bring In Test</title>
    </head>
    <body>
        <div class="app">
            
<p>First Paragraph</p>
<iframe class="viewerStuff" src="http://www.uwsp.edu/library/Pages/default.aspx">
<p>IFrame failed.</p>
</iframe>
<p>Second Paragraph</p>
<object type="text/html" data="http://www.uwsp.edu/library/Pages/default.aspx" class="viewerStuff">
<p>Object failed.</p>
</object>
<p>Third Paragraph</p>

<p>-Update successfully loaded, though-</p>
        </div>



and config.xml here:
<feature name="IntentAndNavigationFilter">
<param name="ios-package" value="CDVIntentAndNavigationFilter"/>
<param name="onload" value="true"/>
</feature>
<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<gap:plugin name="org.apache.cordova.whitelist" source="npm" />
<plugin name="cordova-plugin-whitelist" version="1"/>
<platform name="ios">
    <allow-intent href="itms:*"/>
    <allow-intent href="itms-apps:*"/>
</platform>


Here's a picture of what it looks like on the Ipad being tested on.



Also, I can't use XCode for the solution. The place I am developing the app for doesn't want OS specific coding as part of their policy.

Let me know if you need more information or have any questions.

jcesarmobile

unread,
Jul 8, 2016, 6:21:52 PM7/8/16
to phonegap
You have to use the allow-navigation tag to allow the navigation inside your app

npku...@gmail.com

unread,
Jul 11, 2016, 2:32:18 PM7/11/16
to phonegap
Thanks for the response, jcesarmobile.

I tried adding that on its own like this:
<allow-navigation href="*" />


and in here:
<platform name="ios">
   <allow-intent href="itms:*"/>
   <allow-intent href="itms-apps:*"/>
   <allow-navigation href="*" />
 </platform>

to config.xml and tested both. Neither worked.

Am I adding it to the wrong place or using it wrong?

jcesarmobile

unread,
Jul 11, 2016, 5:14:25 PM7/11/16
to phonegap
You said that you are using phonegap desktop, are you testing on the phonegap developer app?
If yes that's the problem, you have to run your app, not simulate it on the developer app

npku...@gmail.com

unread,
Jul 11, 2016, 5:43:06 PM7/11/16
to phonegap
All right. I will try this soon and report back when I know if this works or not.

rui...@gmail.com

unread,
Mar 25, 2018, 12:26:12 AM3/25/18
to phonegap
hello, have you ever got a solution for this? Would you please update on your solution?
Thanks.

npku...@gmail.com

unread,
Mar 25, 2018, 10:17:59 PM3/25/18
to phonegap
Hello. Sorry about never replying earlier. A lot of things happened since that post.

In short, we found we could get the iframe to show on iOS in the built version of the app, even if not the development edition. I forget how we fixed it, though, as the app was cancelled not too much later. I'll see if I can find the files.
Reply all
Reply to author
Forward
0 new messages