iOS / Cordova:InAppBrowser不工作 [英] iOS / Cordova: InAppBrowser not working
问题描述
我正在使用Cordva(v3.3.0)和JQuery Mobile建立Android和iOS应用程式。
现在我想使用InAppBrowser插件。在Android上这个工作正常,但在iOS上的网页似乎打开在Cordova WebView,而不是在系统浏览器。问题是,一旦浏览器打开,就不可能返回到应用程序,因为没有位置栏/后退按钮。
我已经尝试删除插件并再次添加它,我也更新了Cordova到最新版本(3.3.0)
任何人都可以帮我找到Bug?
感谢!
config.xml
< access origin =*/>
< feature name =InAppBrowser>
< param name =ios-packagevalue =CDVInAppBrowser/>
< / feature>
index.html
< a href =#onclick =window.open('http://google.com','_system','location = yes'); data-role =buttondata-icon =arrow-rdata-iconpos =right> Google< / a>
日志输出
由于网页加载而重置插件。
完成的加载:https://www.google.ch/?gws_rd=cr&ei=hj31Up7fEYXgygXXXXXXXX
以下条目在iOS cordova_plugins.js文件中缺失。在Android中可用....
{
file:plugins / org.apache.cordova 。$。$。
clobbers:[
窗口。打开
]
},
I'm building an app for Android and iOS using Cordva (v3.3.0) and JQuery Mobile. Now I'm trying to use the InAppBrowser plugin. On Android this works fine but on iOS the webpage seems to open in the Cordova WebView and not in the system browser. The problem ist that it is not possible to return to the app as soon as the browser is opened because there is no location bar / back button.
I already tryed to remove the plugin and to add it again and I also updated Cordova to the latest Version (3.3.0)
Can anybody help me to find the Bug?
Thanks!
config.xml
<access origin="*" />
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
index.html
<a href="#" onclick="window.open('http://google.com', '_system', 'location=yes');" data-role="button" data-icon="arrow-r" data-iconpos="right">Google</a>
Log Output
Resetting plugins due to page load.
Finished load of: https://www.google.ch/?gws_rd=cr&ei=hj31Up7fEYXgygXXXXXXXX
Just found the solution.
The following entry was missing in the iOS cordova_plugins.js File. In Android it was available....
{
"file": "plugins/org.apache.cordova.core.inappbrowser/www/InAppBrowser.js",
"id": "org.apache.cordova.core.inappbrowser.InAppBrowser",
"clobbers": [
"window.open"
]
},
这篇关于iOS / Cordova:InAppBrowser不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!