Comments (6)
Hey all!
I patched ClipboardModule.java
to make it compatible with the latest changes in RN. Seems to work fine for now.
diff --git a/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java b/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java
index 4ecb0cb..b664b3c 100644
--- a/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java
+++ b/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java
@@ -11,7 +11,9 @@ import android.content.ClipboardManager;
import android.content.ClipData;
import android.content.Context;
-import com.facebook.react.bridge.ContextBaseJavaModule;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReactContext;
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Promise;
import com.facebook.react.module.annotations.ReactModule;
@@ -20,10 +22,13 @@ import com.facebook.react.module.annotations.ReactModule;
* A module that allows JS to get/set clipboard contents.
*/
@ReactModule(name = ClipboardModule.NAME)
-public class ClipboardModule extends ContextBaseJavaModule {
+public class ClipboardModule extends ReactContextBaseJavaModule {
+ private Context context;
- public ClipboardModule(Context context) {
+ public ClipboardModule(ReactApplicationContext context) {
super(context);
+
+ this.context = context;
}
public static final String NAME = "RNCClipboard";
@@ -34,7 +39,7 @@ public class ClipboardModule extends ContextBaseJavaModule {
}
private ClipboardManager getClipboardService() {
- return (ClipboardManager) getContext().getSystemService(getContext().CLIPBOARD_SERVICE);
+ return (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
}
@ReactMethod
from clipboard.
me too
from clipboard.
same for me
from clipboard.
same for me
from clipboard.
Is there a way to solve this problem yet, everyone?
from clipboard.
@Naturalclar isn't it the same #238
@mykhailoperemitko can you check ?
from clipboard.
Related Issues (20)
- Android: After upgrading to React Native version 0.73, build failed HOT 8
- Monorepo REACT_NATIVE_NODE_MODULES_DIR error HOT 2
- Getting "copied" send to device in android 13 HOT 1
- Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED HOT 14
- SetString("") not clear Gboard's clipboard
- Expose access to EXTRA_IS_SENSITIVE for setString on Android
- ios listener not being called
- public class ClipboardModule extends NativeClipboardModuleSpec HOT 6
- Allowing RN 0.74 as a peer dependency HOT 30
- pod install fails undefined method `visionos' HOT 7
- Can we use this clipboard to listen to iOS AutoFill text?
- How to remove the default toast msg 'copied' HOT 1
- Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCClipboard' could not be found. HOT 12
- Error: Attempt to invoke virtual method 'android.content.ClipData$Item android.content.ClipData.getItemAt(int)' on a null object reference HOT 1
- Library unusable with react native 0.74.2 HOT 17
- implement getImage and hasImage for macos
- TypeError: NativeClipboardModule_1.default.setStrings is not a function (it is undefined) on Android
- Installation error HOT 9
- react-native-clipboard
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 clipboard.