![](/img/trans.png)
[英]WebIntent error using PhoneGap 2.4. Reference error: WebIntent is not defined?
[英]I keep getting an error when using webintent
我正在尝试使用此代码打开cordova的网页:
window.plugins.webintent.startActivity({action: WebIntent.ACTION_VIEW,url: 'geo:0,0?q=' + address},
function() {},
function() {alert('Failed to open URL via Android Intent')}
)
但我一直收到这个错误:
ReferenceError: WebIntent is not defined
有什么想法吗?
如果您使用的是Cordova 2.0
确保在config.xml
有以下条目:
<plugin name="WebIntent" value="com.borismus.webintent.WebIntent" />
WebIntent.java
文件也需要存储在:
src\com\borismus\webintent\
最后确保在cordova.js之后包含webintent.js:
<script src="cordova-2.2.0.js"></script>
<script src="js/webintent.js"></script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.