Skip to content

Commit 6a8e7da

Browse files
fix(event-emitter): add missing android stubs (#202)
1 parent 5b2da48 commit 6a8e7da

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

android/src/legacy/RNCGeolocationModule.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,15 @@ public void startObserving(ReadableMap options) {
5050
public void stopObserving() {
5151
mImpl.stopObserving();
5252
}
53+
54+
@ReactMethod
55+
public void addListener(String eventName) {
56+
// Keep: Required for RN RCTEventEmitter class (iOS).
57+
}
58+
59+
@ReactMethod
60+
public void removeListeners(double count) {
61+
// Keep: Required for RN RCTEventEmitter class (iOS).
62+
}
5363
}
5464

android/src/turbo/RNCGeolocationModule.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,15 @@ public void startObserving(ReadableMap options) {
5151
public void stopObserving() {
5252
mImpl.stopObserving();
5353
}
54+
55+
@Override
56+
public void addListener(String eventName) {
57+
// Keep: Required for RN RCTEventEmitter class (iOS).
58+
}
59+
60+
@Override
61+
public void removeListeners(double count) {
62+
// Keep: Required for RN RCTEventEmitter class (iOS).
63+
}
5464
}
5565

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ SPEC CHECKSUMS:
845845
React-jsiexecutor: 53bd208e5c27939c6e6365528393445a596a9a2b
846846
React-jsinspector: 26c42646ab0bb69e29e837e23754fe7121eeaf94
847847
React-logger: 1bfd109a0ffa4c0989bbfac0c2d8c4abe4637faa
848-
react-native-geolocation: 8f885d2f684fc34ba794e049393e86abd170119d
848+
react-native-geolocation: a58ed89465cd3876d47aa76eb4a4b7d5b8b86524
849849
react-native-safe-area-context: 2f75b317784a1a8e224562941e50ecbc932d2097
850850
React-perflogger: 6009895616a455781293950bbd63d53cfc7ffbc5
851851
React-RCTActionSheet: 5e90aa5712af18bfc86c2c6d97d4dbe0e5451c1d
@@ -864,6 +864,6 @@ SPEC CHECKSUMS:
864864
RNScreens: e2cd04caa74748a6e42609a7b84f76c71d70a6ee
865865
Yoga: 043f8eb97345d0171f27fead4d1849cacf0472a5
866866

867-
PODFILE CHECKSUM: e4a78b765b8b00ec2c0a542d3b9af6a4a94e10f8
867+
PODFILE CHECKSUM: fd0a9b0c025fdffd0d1760eb77f3cbf23faf9222
868868

869869
COCOAPODS: 1.11.3

js/NativeRNCGeolocation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ export interface Spec extends TurboModule {
5454
): void;
5555
startObserving(options: GeolocationOptions): void;
5656
stopObserving(): void;
57+
58+
// RCTEventEmitter
59+
addListener: (eventName: string) => void;
60+
removeListeners: (count: number) => void;
5761
}
5862

5963
export default TurboModuleRegistry.getEnforcing<Spec>('RNCGeolocation');

0 commit comments

Comments
 (0)