This is a migrated thread and some comments may be shown as answers.

Embed iframe to IOS app

2 Answers 800 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sergey
Top achievements
Rank 1
Sergey asked on 26 Apr 2017, 09:03 AM

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 Answers, 1 is accepted

Sort by
0
Sergey
Top achievements
Rank 1
answered on 26 Apr 2017, 10:46 AM
This problem occurs in the Cordova test app. The iframe works fine if application deployed directly.
0
Martin
Telerik team
answered on 28 Apr 2017, 07:25 AM

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
Tags
General Discussions
Asked by
Sergey
Top achievements
Rank 1
Answers by
Sergey
Top achievements
Rank 1
Martin
Telerik team
Share this question
or