Skip to content

Commit 16fb9d8

Browse files
committed
add missing listener methods (new architecture)
Methods `addListener` and `removeListeners` were missing from the codegen spec. Without them, events emitted from native code do not get sent to JS, and warnings are logged complaining about the missing methods. Fixes: #283 Possibly also fixes: #274 #292
1 parent 2531333 commit 16fb9d8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

android/src/newarch/java/com/ReactNativeBlobUtil/ReactNativeBlobUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void addListener(String eventName) {
3434
}
3535

3636
@ReactMethod
37-
public void removeListeners(Integer count) {
37+
public void removeListeners(double count) {
3838

3939
}
4040

codegenSpecs/NativeBlobUtils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ export interface Spec extends TurboModule {
7575
+getSDCardApplicationDir: () => Promise<string>;
7676
+scanFile: (pairs: Array<any>, callback: (value: Array<any>) => void) => void;
7777
+writeToMediaFile: (fileUri: string, path: string, transformFile: boolean) => Promise<string>;
78+
79+
// RCTEventEmitter
80+
+addListener: (eventName: string) => void;
81+
+removeListeners: (count: number) => void;
7882
}
7983

8084
export default (TurboModuleRegistry.get<Spec>('ReactNativeBlobUtil'): ?Spec);

0 commit comments

Comments
 (0)