Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixed] NativeEventEmitter #52

Open
arthurgeron-work opened this issue Oct 10, 2023 · 0 comments
Open

[Fixed] NativeEventEmitter #52

arthurgeron-work opened this issue Oct 10, 2023 · 0 comments

Comments

@arthurgeron-work
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant