Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Cordova plugins with Meteor.js

After adding a Cordova plugin using meteor add cordova:[email protected], I see this plugin installed using meteor list.

However on the desktop browser console, I can't seem to find any methods exposed by cordova:org.apache.cordova.dialogs, such as navigator.notification.alert. How do we do something like

navigator.notification.confirm(
    'Hello there',
    onConfirm,
    'Welcome',
    ['Hey']
)

Also tried cordova:[email protected] and the device object the plugin is supposed to expose globally cannot be found.

Meteor.startup(function() {
    console.log(device.cordova)  // Uncaught ReferenceError: device is not defined
})
like image 326
Nyxynyx Avatar asked Oct 20 '22 21:10

Nyxynyx


1 Answers

The whole point of Cordova plugins is to give your JavaScript code access to some device-specific native features on mobile.

The features from Cordova plugins are not available on browsers.

like image 129
imslavko Avatar answered Oct 22 '22 10:10

imslavko