Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

Cannot load cordova plugins in Onsenui 2



  • I am trying to load a cordova plugin but it keeps giving an error: **"Uncaught (inpromise) module bluetoothSerial not found undefined:0. **

    How would I go about loading a cordova plugin inside Monaca, I have tried:

    1. window.bluetoothSerial()
    2. cordova.require(‘bluetoothSerial’)
    3. new cordova.plugins.bluetoothSerial();

    All give the same error message

    
    app.service('bleService', function() {
        var bluetoothSerial = cordova.require('bluetoothSerial');//new cordova.plugins.bluetoothSerial.Delegate();
    
        return {
            sendMessage: function(message) {
                // interact with bluetoothSerial
            }
        };
    });
    
    app.controller('InfoPageCtrl', ['$scope', 'bleService', function($scope, bleService) {
             
             bluetoothSerial.isEnabled(
                function() {
                    console.log("Bluetooth is enabled");
                },
                function() {
                    console.log("Bluetooth is *not* enabled");
                }
            );
    }]);
    


  • @peabucket Please consolidate your questions to one thread. I am chasing all of your questions across numerous threads and they all involve the ability to utilize a bluetooth plugin with Onsen. Thanks!



  • This post is deleted!