Embed iframe to IOS app

3 posts, 0 answers
  1. Sergey
    Sergey avatar
    2 posts
    Member since:
    Nov 2008

    Posted 26 Apr Link to this post

    I'm trying to embed iframe to my hybrid app. Iframe pointed to external resource.

    Config.xml contains:
      <allow-navigation href="*" />
      <allow-intent href="*" />
      <access origin="*" allows-arbitrary-loads-in-media="true" allows-arbitrary-loads-in-web-content="true" allows-local-networking="true" />

    Index.html contains: 

        <meta http-equiv="Content-Security-Policy" content="default-src 'self' * data: gap: filesystem: 'unsafe-eval'; 
              style-src 'self' * data: gap: filesystem: 'unsafe-inline' 'unsafe-eval';  
              script-src 'self' * data:  gap: filesystem: 'unsafe-inline' 'unsafe-eval'; 
              child-src 'self' * data: gap: filesystem: 'unsafe-inline' 'unsafe-eval'; 
              frame-ancestors 'self' * data: gap: filesystem: 'unsafe-inline' 'unsafe-eval'">

    Cordova version 6.4.0

    Could you please help me. What I need to do to embed iframe to app?

  2. Sergey
    Sergey avatar
    2 posts
    Member since:
    Nov 2008

    Posted 26 Apr in reply to Sergey Link to this post

    This problem occurs in the Cordova test app. The iframe works fine if application deployed directly.
  3. Martin
    Admin
    Martin avatar
    103 posts

    Posted 28 Apr Link to this post

    Hi Sergey,

    When adding the iframe, you make changes to the confix.xml to allow loading of the content. Still, the Developer app has certain limitations, one of which is to test changes in:

    • Info.plist and config.xml for iOS
    • AndroidManifest.xml and config.xml for Android
    • WMAppManifest.xml and config.xml for Windows Phone

    That is why I would suggest to test on a physical device, where as you noted would run fine.

    You may also review the Cordova InAppBrowser plugin for loading external content in a hybrid app.

    I hope this has helped.

    Regards,
    Martin
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top