Skip to content

Commit e24ca89

Browse files
merged changes from PR rnmapbox#3869
1 parent 60d0bb2 commit e24ca89

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXLocationModule.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ class RNMBXLocationModule(reactContext: ReactApplicationContext) :
132132
}
133133

134134
@ReactMethod
135-
fun addListener(eventName: String?) {
135+
override fun addListener(eventName: String?) {
136136
// Required for rn built in EventEmitter Calls.
137137
}
138138

139139
@ReactMethod
140-
fun removeListeners(count: Int?) {
140+
override fun removeListeners(count: Double) {
141141
// Required for rn built in EventEmitter Calls.
142142
}
143143

android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXOfflineModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class RNMBXOfflineModule(private val mReactContext: ReactApplicationContext) :
125125
}
126126

127127
@ReactMethod
128-
fun removeListeners(count: Int?) {
128+
fun removeListeners(count: Double) {
129129
// Remove upstream listeners, stop unnecessary background tasks
130130
}
131131

android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXLocationModuleSpec.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,12 @@ protected final void emitOnLocationUpdate(ReadableMap value) {
6565
@ReactMethod
6666
@DoNotStrip
6767
public abstract void setLocationEventThrottle(double throttle);
68+
69+
@ReactMethod
70+
@DoNotStrip
71+
public abstract void addListener(String eventName);
72+
73+
@ReactMethod
74+
@DoNotStrip
75+
public abstract void removeListeners(double count);
6876
}

src/specs/NativeRNMBXLocationModule.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export interface Spec extends TurboModule {
2424
getLastKnownLocation(): Promise<LocationEvent['payload']>
2525
simulateHeading(changesPerSecond: number, increment: number): void
2626
setLocationEventThrottle(throttle: number): void
27+
addListener(eventName: string): void;
28+
removeListeners(count: number): void;
2729

2830
readonly onLocationUpdate: EventEmitter<LocationEvent>
2931
}

0 commit comments

Comments
 (0)