react-native-actions-shortcuts icon indicating copy to clipboard operation
react-native-actions-shortcuts copied to clipboard

[Fixed] NativeEventEmitter

Open arthurgeron-work opened this issue 2 years ago • 0 comments

addListener and removeListeners is not necessary for this lib's functionality, React will generate a NativeEventEmitter warning on Android anyway, the following patch-package fixes this error on 1.0.1:

diff --git a/node_modules/react-native-actions-shortcuts/android/src/main/java/com/reactnativeshortcuts/ShortcutsModule.kt b/node_modules/react-native-actions-shortcuts/android/src/main/java/com/reactnativeshortcuts/ShortcutsModule.kt
index ec847cc..cc2658c 100644
--- a/node_modules/react-native-actions-shortcuts/android/src/main/java/com/reactnativeshortcuts/ShortcutsModule.kt
+++ b/node_modules/react-native-actions-shortcuts/android/src/main/java/com/reactnativeshortcuts/ShortcutsModule.kt
@@ -145,6 +145,14 @@ class ShortcutsModule(reactContext: ReactApplicationContext) :
     fun isSupported(): Boolean {
         return Build.VERSION.SDK_INT >= 25
     }
+
+    @ReactMethod
+    fun addListener(eventName: String?) {
+    }
+
+    @ReactMethod
+    fun removeListeners(count: Int?) {
+    }
 }
 
 object NotSupportedException: Throwable("Feature not supported, requires version 25 or above")
\ No newline at end of file

arthurgeron-work avatar Oct 10 '23 21:10 arthurgeron-work