cordova - Working with non ionic-native plugins in Ionic 2 -


i'm using custom cordova plugin (https://github.com/vjai/simple-crypto), not available in ionic native.

i'm using ionic 2 , have installed plugin using command: cordova plugin add https://github.com/vjai/simple-crypto

the interface this:

var rncryptor = cordova.require("com.disusered.simplecrypto.simplecrypto");  rncryptor.encrypt(key, data, successcallback, failurecallback) rncryptor.decrypt(key, data, successcallback, failurecallback)` 

method 1:
have tried invoke plugin using

window.plugins.simplecrypto.encrypt(...) 

but when run ionic serve, error:

typeerror: cannot read property 'simplecrypto' of undefined

method 2:
way tried

cordova.plugins.simplecrypto.encrypt(...) 

the error got

referenceerror: cordova not defined

is there way go around doing this?

have tried use

cordova.plugins.simplecrypto.encrypt  

function on device?

it working case. reason being, emulator unable run cordova.js


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -