Skip to content

Commit 90c0548

Browse files
Merge pull request #8 from SourcePointUSA/fix_eventemitter_warning_android
Fix eventemitter warning android
2 parents 1328f1b + a7875ce commit 90c0548

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt

+6
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ class RNSourcepointCmpModule internal constructor(context: ReactApplicationConte
106106
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
107107
.emit(event.name, params)
108108

109+
@ReactMethod
110+
fun addListener(eventName: String) {}
111+
112+
@ReactMethod
113+
fun removeListeners(count: Int) {}
114+
109115
companion object {
110116
const val NAME = "RNSourcepointCmp"
111117
}

example/src/App.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const styles = StyleSheet.create({
160160
container: { flex: 1 },
161161
title: {
162162
textAlign: 'center',
163-
fontSize: 20,
163+
fontSize: 22,
164164
},
165165
status: {
166166
textAlign: 'center',
@@ -169,10 +169,11 @@ const styles = StyleSheet.create({
169169
authIdInput: {
170170
marginVertical: 12,
171171
marginHorizontal: 'auto',
172-
width: '70%',
172+
width: '90%',
173173
padding: 8,
174174
fontSize: 18,
175175
textAlign: 'center',
176176
borderWidth: 1,
177+
borderColor: '#999',
177178
},
178179
});

example/src/UserDataView.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ type UserDataViewProps = {
3838

3939
const styles = StyleSheet.create({
4040
container: {
41-
padding: 10,
41+
padding: 8,
4242
},
4343
header: {
4444
fontSize: 18,
4545
},
4646
userDataText: {
4747
fontSize: 10,
48+
paddingBottom: 300,
4849
},
4950
});

src/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,8 @@ export class SPConsentManager implements Spec {
9797
this.emitter.removeAllListeners
9898
);
9999
}
100+
101+
addListener(_eventName: string): void {}
102+
removeListeners(_count: number): void {}
103+
getConstants?(): {};
100104
}

src/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,7 @@ export interface Spec extends TurboModule {
120120
onError(callback: (description: string) => void): void;
121121

122122
dispose(): void;
123+
124+
addListener(eventName: string): void;
125+
removeListeners(count: number): void;
123126
}

0 commit comments

Comments
 (0)