I am trying to open pdf and ppt files in my phonegap application. i am using phonegap 2.4 and the latest version of WebIntent plugin. I did as told on Webintent
but i still get this error:
Reference error: WebIntent is not defined
here is part of my html head section:
<script type="text/javascript" src="js/cordova-2.4.0.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.2.0.min.js"></script>
<script type="text/javascript" src="js/webintent.js"></script>
here is part of my config.xml file
<cordova>
...
<plugins>
...
<plugin name="Globalization" value="org.apache.cordova.Globalization"/>
<plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser"/>
<plugin name="WebIntent" value="com.borismus.webintent.WebIntent"/>
</plugins>
</cordova>
here is js portion of the code where i use the plugin
function openFile(filePath){
window.plugins.webintent.StartActivity({
action: WebIntent.ACTION_VIEW,
url: filePath},
function(){},
function(){alert("failed to open file")}
);
}
where filePath is something like "file:///mnt/sdcard/file.pdf"
Please someone tell me what am I doing wrong. P.S.: I am pretty new to phonegap and eclipse.