Comments (22)
well~
I finally find a way to solve my problem in phonegap build 3.1
is to use...window,not cordova
window.plugins.clipboard.copy(text);
window.plugins.clipboard.paste(function (text) { alert(text); });
from cordovaclipboard.
From phonegap build 3.1.0 , you dont need to write-
$.getScript("js/plugins/com.verso.cordova.clipboard/www/clipboard.js");
Use the code in the following way -
var text="Sample Text";
cordova.plugins.clipboard.copy(text);
from cordovaclipboard.
when I just use
http://www.littlebau.com/copy.html
but nothing happened too
from cordovaclipboard.
Make sure the plugin has been properly configured in your project.You can confirm this by checking in the YourProject/res/xml/config.xml , the plugin should be registered in this way:
<feature name="Clipboard">
<param name="android-package" value="com.verso.cordova.clipboard.Clipboard" />
</feature>
Or by running this command from CLI interface:
$ phonegap local plugin list
If properly configured, the plugin should be listed there.
From Phonegap 3.1.0, you dont need to import any specific js files of plugins. Just register them by CLI Interface.
from cordovaclipboard.
As @gouravkakkar pointed out, it seems that the plugin hasn't been installed properly. You should try reinstalling it.
from cordovaclipboard.
OK
I will try later,really thanks
from cordovaclipboard.
I tried many many times,it still not work by "phonegap build" 3.1
in phonegap build just like that way
https://build.phonegap.com/plugins/67
is it real work by "phonegap build"?
PS,I am very sure that the Clipboard plugin has been install
http://www.littlebau.com/clipboard.jpg
from cordovaclipboard.
Using Phonegap 3.1 in iOS 7, it works just fine for me.
Example:
cordova.plugins.clipboard.copy('some text');
from cordovaclipboard.
thanks for jprichardson reply
did you use "phonegap build" 3.1 or just phonegap 3.1(Eclipse or xcode) ?
from cordovaclipboard.
phonegap build ios
from cordovaclipboard.
ok
Could you help me to check out your cordova_plugins.js
There are some code written by...
http://www.littlebau.com/abc.html
is it as same as yours?
from cordovaclipboard.
Are you building locally or remotely with PhoneGap Build, and for what platform?
from cordovaclipboard.
remotely
Android,4.03,HTC Sensationa XL
iOS,7.0.4,iPad mini
I will try in locally building
If I have any problem then ask your again,tks~
from cordovaclipboard.
I just test the Android 4.1.1 and iOS 7.0.4
this is my "local" index.html code,and I am very sure that my phonegap.js is loaded success
and the plugin is install success too
http://www.littlebau.com/local.gif
<script src="phonegap.js" type="text/javascript"></script>
<script type="text/javascript">
function local1()
{
var text = "Hello World!";
window.plugins.copy(text);
window.plugins.paste(function (text) { alert(text); });
}
function local2()
{
var text = "Hello World!";
cordova.plugins.copy(text);
cordova.plugins.paste(function (text) { alert(text); });
}
function local3()
{
cordova.plugins.copy('Hello World!');
cordova.plugins.paste(function (text) { alert(text); });
}
</script>
<body>
<a onClick="local1();">local1</a></br></br>
<a onClick="local2();">local2</a></br></br>
<a onClick="local3();">local3</a></br></br>
</body>
no mater I click the local1 or local2 or local3,the alert message never appear
from cordovaclipboard.
You have to change your commands to cordova.plugins.clipboard.copy
and cordova.plugins.clipboard.paste
.
from cordovaclipboard.
thanks to @ctrevisan
but not work too by phonegap build 3.1....no "alert" message appear
I am not lying,this is the apk file,you can extract the apk file by winzip or winrar to see the index.html
http://www.littlebau.com/clipboard.apk
by the way
my config.xml "android-minSdkVersion" is 11
from cordovaclipboard.
The sources for the plugin are missing from your project. You should have Clipboard.java under platforms/android/src/com/verso/cordova/clipboard
. This might happen if the platform was added (e.g. compiled for using phonegap) before the plugin was added. Try creating a blank project from the CLI, add the plugin, copy your basic example, and compile.
from cordovaclipboard.
I don't know how to use the CLI
I am just only use "phonegap build" and use you plugin by this address
https://build.phonegap.com/plugins/67
anyway...tks~
from cordovaclipboard.
Strange... Anyway, I'm glad it solved your problem :-)
from cordovaclipboard.
For cordova CLI use cordova.plugins.clipboard.copy and cordova.plugins.clipboard.paste
from cordovaclipboard.
@bau720123 : hi can you give me a link of your example?
from cordovaclipboard.
i am getting the same problem with ionic ngCordova i have opened a new issue here #14
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
- Clipboard not pasting on android HOT 7
- 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.