Comments (7)
I forked the plugin to fix the issue. It has to do with when you copy text from an html page. The mime type is text/html, different from text/plain. The plugin was sending two results in a row which made the call to never comeback even with an error. To get it to work, you can just replace the Clipboard.java class with my class from https://github.com/abelabbesnabi/cordova-plugin-clipboard
from cordovaclipboard.
@abelabbesnabi 👍
your updated repo working fine and solving this issues, which now i can copy from my app and past in the same app and in others apps also, and can past from other apps, so everything working fine with me now, so what i did which i using ionic 3 :
cordova plugin add https://github.com/abelabbesnabi/cordova-plugin-clipboard --save
and in my ts file from app i did that :
declare var cordova;
@Component({ ....
and inside my file using plugin like that :
cordova.plugins.clipboard.copy(text);
cordova.plugins.clipboard.paste(function (text) { alert(text); });
from cordovaclipboard.
Hey @marinsokol
First and foremost, you're calling the function incorrectly. You should begin with cordova
(or window.cordova
) if you're using Cordova. If you use another build system you might have to use window
instead.
cordova.plugins.clipboard.paste(function(text) {console.log(text);});
window.plugins.clipboard.paste(function(text) {console.log(text);});
Secondly, are you sure you're calling this function after the deviceready
event has fired?
from cordovaclipboard.
When I view log in DDMS, I found this error:
Attempted to send a second callback for ID:
Paste function at native layer is working done, but it can not pass result to web layer.
from cordovaclipboard.
I have a very similar issue. My copy/paste functionality works perfect while in app, but if I try to paste some text that was copied in my app, to some other app, it simply doesn't work. The text that was in clipboard before I copied a new one in my app, got pasted.
from cordovaclipboard.
Cannot paste content into my app (copied from another app) with this plugin in Android 6.0
from cordovaclipboard.
I have a similar problem:
my app use paste to copy a text as body for mail and/or whatsupp application.
it works well the first time, but i I switch application to copy something, the paste mwthod stop working until I clear the clipboard. I tried to use also the plugin mentioned by @ihadeed,
here a part of code:
cordova.plugins.clipboard.paste(
(resolve: string) => {
console.log(resolve);
window.open("mailto:" + (email || '') + "?body=" + encodeURIComponent(resolve), "_system");
}, (reject: string) => {
console.log(reject);
window.open("mailto:" + (email || ''), "_system");
}
)
note that I tried to use also a var called this.clipboiard initalized in the constructor without success.
any idea in how to solve my problem?
from cordovaclipboard.
Related Issues (20)
- Solution here
- Not working on iOS 9 HOT 4
- CordovaClipboard and Cordova 5.1.1 HOT 2
- About "undefined" error using clipboard HOT 2
- Cordova Windows Build. HOT 1
- Issue pasting Imgur app link (ios)
- RegistrationIntentService.java blocks PhoneGap Build HOT 1
- It is not working on phonegap build 5.2.0
- cordova.plugins.clipboard.copy slow on Ionic + Windows Phone
- Not working in iOS 10? HOT 4
- Plugin cannot install with Cordova 7 (latest Cordova Version) HOT 17
- Help to install HOT 3
- Text not added to my phone clipboard HOT 1
- Copy no longer works in iOS 11 HOT 1
- Copy does not work correctly on ios11 HOT 6
- Unable to build ionic app with clipboard plugin
- package.json HOT 1
- 💀☠️NEW PLUGIN, PLEASE DON'T USE THIS ONE ANYMORE☠️💀 HOT 7
- iOS Working on simulator but not on the device
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordovaclipboard.