EddyVerbruggen / nativescript-clipboard

:clipboard: NativeScript plugin to copy stuff to the device clipboard, and read from it again

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setText not working on android

middle21 opened this issue · comments

Hello there.I am using Nativescript with Vue.I have a button that fires a method on tap.

copyToClip(){
var clipboard = require("nativescript-clipboard");
clipboard.setText(this.shorted).then(function(){
console.log("OK, copied to the clipboard");
});
},

When I tap the button I get the following error log in my console :
'Error in clipboard.setText: TypeError: Cannot read property 'getSystemService' of undefined'.
Note that this doesn't work either if I replace this.shorted with something else like 'string' and it still doesn't work if a put the require before the export default section of my vue component.
I haven't tested this on IPhone yet.
Any suggestions ? Thanks a lot.

Same with me!

I couldn't reproduce it, but I've changed the implementation nonetheless. So please check out 1.2.0 to see if it's any better.