@sentiance-react-native/core 6.4.0-rc.2 → 6.4.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -565,16 +565,20 @@ public class SentianceModule extends AbstractSentianceModule {
565
565
 
566
566
  @Override
567
567
  @ReactMethod
568
- protected void addListener(String eventName, int subscriptionId, Promise promise) {
568
+ protected void addNativeListener(String eventName, int subscriptionId, Promise promise) {
569
569
 
570
570
  }
571
571
 
572
572
  @Override
573
573
  @ReactMethod
574
- protected void removeListener(String eventName, int subscriptionId, Promise promise) {
574
+ protected void removeNativeListener(String eventName, int subscriptionId, Promise promise) {
575
575
 
576
576
  }
577
577
 
578
+ @Override
579
+ @ReactMethod
580
+ protected void addListener(String eventName) {}
581
+
578
582
  @Override
579
583
  @ReactMethod
580
584
  public void removeListeners(Integer count) {}
@@ -54,9 +54,11 @@ public abstract class AbstractSentianceModule extends ReactContextBaseJavaModule
54
54
  subscriptionsManager.removeSubscription(subscriptionId, eventType);
55
55
  }
56
56
 
57
- protected abstract void removeListener(String eventName, int subscriptionId, Promise promise);
57
+ protected abstract void removeNativeListener(String eventName, int subscriptionId, Promise promise);
58
58
 
59
- protected abstract void addListener(String eventName, int subscriptionId, Promise promise);
59
+ protected abstract void addNativeListener(String eventName, int subscriptionId, Promise promise);
60
+
61
+ protected abstract void addListener(String eventName);
60
62
 
61
63
  protected abstract void removeListeners(Integer count);
62
64
  }
@@ -4,7 +4,7 @@ sentiance_sdk_version = package['sdkVersions']['ios']['sentiance']
4
4
 
5
5
  Pod::Spec.new do |s|
6
6
  s.name = "RNSentianceCore"
7
- s.version = "6.4.0-rc.2"
7
+ s.version = "6.4.0-rc.3"
8
8
  s.summary = "RNSentianceCore"
9
9
  s.description = <<-DESC
10
10
  RNSentianceCore
@@ -14,39 +14,15 @@ class SentianceEventEmitter extends NativeEventEmitter {
14
14
  if (!nativeModule) {
15
15
  throw new Error('Native module cannot have a null value.');
16
16
  }
17
- if (Platform.OS === 'android') {
18
- return this.requireAndroidBindings(nativeModule);
19
- } else {
20
- return this.requireIosBindings(nativeModule);
21
- }
22
- }
23
-
24
- requireAndroidBindings(nativeModule) {
25
- const hasAddListener = typeof nativeModule.addListener === 'function';
26
- const hasRemoveListener = typeof nativeModule.removeListener === 'function';
27
-
28
- if (!hasAddListener) {
29
- throw new Error('Native Android module does not expose an addListener function');
30
- }
31
- if (!hasRemoveListener) {
32
- throw new Error('Native Android module does not expose a removeListener function');
33
- }
34
-
35
- return {
36
- addNativeListener: nativeModule.addListener,
37
- removeNativeListener: nativeModule.removeListener
38
- };
39
- }
40
17
 
41
- requireIosBindings(nativeModule) {
42
18
  const hasAddListener = typeof nativeModule.addNativeListener === 'function';
43
19
  const hasRemoveListener = typeof nativeModule.removeNativeListener === 'function';
44
20
 
45
21
  if (!hasAddListener) {
46
- throw new Error('Native iOS module does not expose an addNativeListener function');
22
+ throw new Error('Native module does not expose an addNativeListener function');
47
23
  }
48
24
  if (!hasRemoveListener) {
49
- throw new Error('Native iOS module does not expose a removeNativeListener function');
25
+ throw new Error('Native module does not expose a removeNativeListener function');
50
26
  }
51
27
 
52
28
  return {
@@ -72,4 +48,4 @@ class SentianceEventEmitter extends NativeEventEmitter {
72
48
  }
73
49
  }
74
50
 
75
- module.exports = SentianceEventEmitter;
51
+ module.exports = SentianceEventEmitter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentiance-react-native/core",
3
- "version": "6.4.0-rc.2",
3
+ "version": "6.4.0-rc.3",
4
4
  "description": "React Native Sentiance core library",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",