Reputation: 48
So I'm using PhoneGap Build to build my app.
The InAppBrowser works fine when running the app via the PhoneGap Developer application however when I use PhoneGap Build and install the IPA file onto the iPad the button that I click to open up the InAppBrowser does not open InAppBrowser. I have to double tap on the home button and then go back into the app for it to appear. Has anyone else ever experienced this?
The code for the button is as follow:
$("#dashboardSmPC").on(app.interactionEvent, function () {
var inAppBrowser = cordova.InAppBrowser.open('pdf/SmPC.pdf', '_blank', 'closebuttoncaption=Back,location=no,presentationstyle=fullscreen,transitionstyle=coververtical');
});
EDIT: This problem seems to be in iOS 10.3.2., 9.3.5 works fine.
Upvotes: 0
Views: 190
Reputation: 48
This was because of too tight an CSP (Content Security Policy) meta tag in the index.html. I changed it to this and it works in iOS 10.3.2:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' gap://ready file://* *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; media-src *; img-src * data:">
Upvotes: 1