Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

New Contributor
Posts: 6
Registered: ‎01-11-2014
My Device: torch
My Carrier: telenor

Cordova plugin method not called for BB10

I used template cordova plugin for BB10 which have built in methods. I am trying to change name of the methods but change is not taking effect and fail callback is being called each time.

In client.js I changed method name from `_self.test to _self.method1`


 _self.method1 = function (input) {
            var result,
                success = function (data, response) {
                    result = data;
                fail = function (data, response) {
                    console.log("Error: " + data);
            exec(success, fail, _ID, "method1", {});
            return result;


and in index.js following changes are done


 method1: function (success, fail, args, env) {        
            var result = new PluginResult(args, env);
            result.ok(template.getInstance().method1(), false);
    self.method1 = function () {
            return JNEXT.invoke(self.m_id, "testString");


now I am calling plugin using `community.templateplugin.method1();` code

but response is undefined as compared to string if we don't change method name.

so what might be the issue? While cleaning the project I have following output on console:


 03:17:32 **** Build of configuration Device-Debug for project APP_BB10 ****
    make -j3 Device-Debug
    make: *** No rule to make target `Device-Debug'.  Stop.
    03:17:32 Build Finished (took 127ms)