Giter VIP home page Giter VIP logo

Comments (7)

abelabbesnabi avatar abelabbesnabi commented on June 13, 2024 2

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.

mohamdio avatar mohamdio commented on June 13, 2024 1

@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.

ThijmenDF avatar ThijmenDF commented on June 13, 2024

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.

trinhnguyense avatar trinhnguyense commented on June 13, 2024

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.

gmarkoss avatar gmarkoss commented on June 13, 2024

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.

sdkcarlos avatar sdkcarlos commented on June 13, 2024

Cannot paste content into my app (copied from another app) with this plugin in Android 6.0

from cordovaclipboard.

mebitek avatar mebitek commented on June 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.