I can't get the WebIntent plugin to load on my Phonegap project.
On adb I get the error:
D/CordovaLog(27881): file:///android_asset/www/js/script.js: Line 28 : Uncaught TypeError: Cannot read property 'webintent' of undefined
Phonegap version 3.4.0-0.19.13
I am using this plugin that I found on Phonegap Build website: https://github.com/Tunts/WebIntent
The steps I took:
On terminal, ran phonegap plugin add https://github.com/Tunts/WebIntent
Confirmed that the plugin was installed with phonegap plugin list
In my script.js, I added some sample code from the project:
var address = "some place";
window.plugins.webintent.startActivity({
action: window.plugins.webintent.ACTION_VIEW,
url: 'geo:0,0?q=' + address},
function() {},
function() {alert('Failed to open URL via Android Intent')}
);
The error is from the above line, window.plugins.webintent.startActivity({
The plugin is loaded at res/xml/config.xml, automatically gets added this line:
<feature name="WebIntent">
<param name="android-package" value="net.tunts.webintent.WebIntent" />
</feature>