ashish thakre
Posts: 0
Joined: Wed Apr 15, 2015 9:45 am

Custom cordova plugin "ReferenceError: DHSPluginApperyIO is not defined

Hi,
I create custom cordova plugin and trying to call that plugin but giving me an Reference error "ReferenceError: DHSPluginApperyIO is not defined .

Cordova_plugin.js
{
"file": "plugins/com.dhs.plugin/www/DHSPlugin.js",
"id": "com.dhs.plugin.DHSPlugin",
"clobbers": [
"DHSPluginApperyIO"
]
}
config.xml

Code: Select all

     param name="android-package" value="com.dhs.plugin.DHSPlugin"  

DHSPlugin.js
cordova.define("com.dhs.plugin.DHSPlugin", function(require, exports, module) {
function DHSPlugin() {
}

DHSPlugin.prototype.fileDownload = function (message successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, "DHSPlugin", "fileDownload", message);
};

DHSPlugin.prototype.getFileNameArray = function (message successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, "DHSPlugin", "getFileNameArray", message);
};

DHSPlugin.install = function () {
if (!window.plugins) {
window.plugins = {};
}

window.plugins.dhsplugin = new DHSPlugin();
return window.plugins.dhsplugin;
};

cordova.addConstructor(DHSPlugin.install);

var dhsplugin = new DHSPlugin();

module.exports = dhsplugin;
});

Any help on this will be appreciate

Regards
Ashish

ashish thakre
Posts: 0
Joined: Wed Apr 15, 2015 9:45 am

Custom cordova plugin "ReferenceError: DHSPluginApperyIO is not defined

Calling native function like this

function sucessFileDownload(){
alert('sucess');
}
function errorFileDownloading(){
alert('failed');
}
DHSPluginApperyIO.fileDownload(jsonArray, sucessFileDownload, errorFileDownloading);

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Custom cordova plugin "ReferenceError: DHSPluginApperyIO is not defined

Hi Ashish -

It is hard to say what could be wrong here, since if you've created this plugin it is hard to say how it should be defined.

You can review our section here to better understand how you can integrate Cordova/PhoneGap plugin in Appery.io: https://devcenter.appery.io/documenta...

Return to “Issues”