android - InAppBrowser not working in Phonegap 3.4.0 for iOS -
android - InAppBrowser not working in Phonegap 3.4.0 for iOS -
i'm trying build app ios using phonegap 3.4.0 , jquery mobile 1.4.0. i've tried everyone's suggested. in app, i'll click on link, opens within app, there no button or anything. hence have forcefulness close app , start 1 time again main home screen. have following:
<a href="#" onclick="window.open('http://ok-ecig.com','_blank','location=no,closebuttoncaption=done');" class="ui-btn"><i class="fa fa-shopping-cart fa-2x"></i><span> shop now</span></a> and in config.xml file:
<?xml version="1.0" encoding="utf-8"?> <!-- config.xml reference: https://build.phonegap.com/docs/config-xml --> <widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "com.[author].[appname]" version = "1.0.0"> <name>app name</name> <description> </description> <author href="http://appauthor.com"> app author </author> <!-- enable individual api permissions here. "device" permission required 'deviceready' event. --> <feature name="http://api.phonegap.com/1.0/device" /> <feature name="inappbrowser"> <param name="ios-package" value="cdvinappbrowser" /> </feature> <plugin name="inappbrowser" value="org.apache.cordova.inappbrowser" /> <!-- if not want permissions added app, add together next tag config.xml; still have net permission on app, phonegap requires. --> <preference name="permissions" value="none"/> <!-- customize app , platform preference element. --> <!-- <preference name="phonegap-version" value="3.4.0" /> --> <!-- all: current version of phonegap --> <preference name="orientation" value="portrait" /> <!-- all: default means both landscape , portrait enabled --> <preference name="target-device" value="handset" /> <!-- all: possible values handset, tablet, or universal --> <preference name="fullscreen" value="true" /> <!-- all: hides status bar @ top of screen --> <preference name="disallowoverscroll" value="true" /> <preference name="webviewbounce" value="false" /> <preference name="uiwebviewbounce" value="false" /> <!-- ios: command whether screen 'bounces' when scrolled beyond top --> <preference name="prerendered-icon" value="true" /> <!-- ios: if icon prerendered, ios not apply it's gloss app's icon on user's home screen --> <preference name="stay-in-webview" value="true" /> <!-- ios: external links should open in default browser, 'true' utilize webview app lives in --> <preference name="ios-statusbarstyle" value="black-opaque" /> <!-- ios: black-translucent appear black because phonegap webview doesn't go beneath status bar --> <preference name="detect-data-types" value="true" /> <!-- ios: controls whether info types (such phone no. , dates) automatically turned links scheme --> <preference name="exit-on-suspend" value="false" /> <!-- ios: if set true, app terminate when home button pressed --> <preference name="show-splash-screen-spinner" value="true" /> <!-- ios: if set false, spinner won't appear on splash screen during app loading --> <preference name="auto-hide-splash-screen" value="true" /> <!-- ios: if set false, splash screen must hidden using javascript api --> <preference name="disable-cursor" value="false" /> <!-- blackberry: prevents mouse-icon/cursor beingness displayed on app --> <preference name="android-minsdkversion" value="7" /> <!-- android: min sdk version supported on target device. max version blank default. --> <preference name="android-installlocation" value="auto" /> <!-- android: app install location. 'auto' choose. 'internalonly' device memory. 'preferexternal' sdcard. --> <!-- plugins can added here. --> <!-- <gap:plugin name="example" /> list of available plugins available @ https://build.phonegap.com/docs/plugins --> <gap:plugin name="org.apache.cordova.inappbrowser" version="0.2.4" /> <!-- define app icon each platform. --> <icon src="icon.png" /> <icon src="res/icon/android/icon-36-ldpi.png" gap:platform="android" gap:density="ldpi" /> <icon src="res/icon/android/icon-48-mdpi.png" gap:platform="android" gap:density="mdpi" /> <icon src="res/icon/android/icon-72-hdpi.png" gap:platform="android" gap:density="hdpi" /> <icon src="res/icon/android/icon-96-xhdpi.png" gap:platform="android" gap:density="xhdpi" /> <icon src="res/icon/blackberry/icon-80.png" gap:platform="blackberry" /> <icon src="res/icon/blackberry/icon-80.png" gap:platform="blackberry" gap:state="hover"/> <icon src="res/icon/ios/icon-57.png" gap:platform="ios" width="57" height="57" /> <icon src="res/icon/ios/icon-72.png" gap:platform="ios" width="72" height="72" /> <icon src="res/icon/ios/icon-57-2x.png" gap:platform="ios" width="114" height="114" /> <icon src="res/icon/ios/icon-72-2x.png" gap:platform="ios" width="144" height="144" /> <icon src="res/icon/webos/icon-64.png" gap:platform="webos" /> <icon src="res/icon/windows-phone/icon-48.png" gap:platform="winphone" /> <icon src="res/icon/windows-phone/icon-173.png" gap:platform="winphone" gap:role="background" /> <plugin name="inappbrowser" value="cdvinappbrowser" /> <!-- define app splash screen each platform. --> <gap:splash src="res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:density="ldpi" /> <gap:splash src="res/screen/android/screen-mdpi-portrait.png" gap:platform="android" gap:density="mdpi" /> <gap:splash src="res/screen/android/screen-hdpi-portrait.png" gap:platform="android" gap:density="hdpi" /> <gap:splash src="res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:density="xhdpi" /> <gap:splash src="res/screen/blackberry/screen-225.png" gap:platform="blackberry" /> <gap:splash src="res/screen/ios/screen-iphone-portrait.png" gap:platform="ios" width="320" height="480" /> <gap:splash src="res/screen/ios/screen-iphone-portrait-2x.png" gap:platform="ios" width="640" height="960" /> <gap:splash src="res/screen/ios/screen-ipad-portrait.png" gap:platform="ios" width="768" height="1024" /> <gap:splash src="res/screen/ios/screen-ipad-landscape.png" gap:platform="ios" width="1024" height="768" /> <gap:splash src="res/screen/windows-phone/screen-portrait.jpg" gap:platform="winphone" /> <gap:config-file platform="ios" parent="uiviewcontrollerbasedstatusbarappearance" overwrite="true"> <false/> </gap:config-file> <!-- define access external domains. <access /> - blank access tag denies access external resources. <access origin="*" /> - wildcard access tag allows access external resource. otherwise, can specify specific domains: --> <access origin="http://127.0.0.1*"/> <!-- allow local pages --> <access origin="*" /> <!-- <access origin="http://phonegap.com" /> - allow secure requests http://phonegap.com/ <access origin="http://phonegap.com" subdomains="true" /> - same above, including subdomains, such http://build.phonegap.com/ <access origin="http://phonegap.com" browseronly="true" /> - allows http://phonegap.com opened kid browser. --> my index.html header:
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" type="text/css" href="css/jquery.mobile.flatui.min.css" /> <link rel="stylesheet" href="fa/css/font-awesome.min.css"> <script src="js/jquery.js"></script> <script src="js/jquery.mobile-1.4.0-rc.1.js"></script> <script src="cordova.js"></script><!-- 3.4.0 --> what missing?
let me tell how utilize it. may help find out problem.
in config.xml should have following:
<widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "...." version = "...."> ....
<access origin="*" /> ....
<feature name="inappbrowser"> <param name="android-package" value="org.apache.cordova.inappbrowser"/> </feature> <feature name="inappbrowser"> <param name="ios-package" value="cdvinappbrowser" /> </feature> ....
<gap:plugin name="org.apache.cordova.inappbrowser" /> in every .html file want open link innappbrowser should have following:
<link rel="stylesheet" href="css/jquery.mobile-1.4.2.min.css"> <script type="text/javascript" charset="utf-8" src="cordova.js"></script> <script type="text/javascript" charset="utf-8" src="js/jquery-1.11.1.min.js"></script> <script type="text/javascript" charset="utf-8" src="js/jquery.mobile-1.4.2.min.js></script> note: think cordova.js should first javascript included in code. other javascripts should follow. hope helps!
android ios cordova phonegap-plugins inappbrowser
Comments
Post a Comment