问题描述
这里的任何专家都可以向我指出一些有效的演练,介绍如何使ChildBrowser与iPhone的Cordova 1.7一起使用吗?我在那里找到了许多文档和博客,可以告诉您如何进行操作,但没有一个对我有用.当然,这并不是一个白名单问题,因为我暂时将其设置为通配符*,所以我猜可以安全地排除白名单问题.在某些情况下,ChildBrowser已成功安装,但是当我调用showwebpage
函数时,它不会显示(也不会有任何错误!).其他时候,它甚至都不会安装.我已经花了2天的时间,仍然一无所知.只是希望您能帮助我.任何帮助将不胜感激.
Can any expert here please point me to some valid walkthrough on how to make the ChildBrowser work with Cordova 1.7 in iPhone? I have found lots of documents and blogs out there that tell you how to do it, but none of them have worked for me. It is not a whitelist issue for sure, as for the time being I have set it to the wildcard *, so whitelisting problems can be safely ruled out I guess. In some cases, ChildBrowser was successfully installed, but when I called the showwebpage
function, it just would not show up (there wouldn't be any errors either!). Other times, it just won't even install. I have already spent 2 days on it, and am still clueless. Just hoping if you could help me out. Any help would be appreciated.
我终于可以按照Dhawal的建议打开ChildBrowser.但是onLocationChange
事件似乎从未触发.同样,这似乎是Cordova 1.7的常见问题.除了回滚到某些较旧的Cordova版本以外,是否还有其他解决方法?任何帮助将不胜感激.
I could finally get the ChildBrowser to open up following what Dhawal has suggested below. But the onLocationChange
event never seems to fire. Again, this seems to be a common problem with Cordova 1.7. Any workarounds apart from rolling back to some older Cordova version? Any help would be appreciated.
这就是我想要做的:
window.plugins.childBrowser.showWebPage(url, { showLocationBar: true });
window.plugins.childBrowser.onLocationChange = function(loc){ alert("In index.html new loc = " + loc); };
好,让它开始工作.似乎ChildBrowser仍仅与旧版本的Cordova兼容.必须深入研究Objective-C并在插件中进行更改以使其正常工作.
Ok, got it to work. Seems like ChildBrowser is still compatible with older versions of Cordova only. Had to delve into Objective-C and make changes in the plugin to make it work.
推荐答案
我有一个基本的应用程序,该应用程序具有与Cordova 1.7集成的子浏览器.我还采取了一些步骤来生成构建相同的应用程序.
I have a basic application which has childbrowser integration with Cordova 1.7. I have put the steps also to generate build same application.
Childbrowser事件未正确调用,因此我在ChildBrowser.js文件中添加了此修复程序以解决该问题.
Childbrowser events were not getting called properly so I added this fix in ChildBrowser.js file to resolve it.
if (cordovaRef && cordovaRef.addConstructor) {
cordovaRef.addConstructor(ChildBrowser.install);
// Make ChildBrowser global
window.ChildBrowser = ChildBrowser;
} else {
console.log("ChildBrowser Cordova Plugin could not be installed.");
return null;
}
这篇关于科尔多瓦1.7 iPhone版儿童浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!