@applicaster/zapp-react-native-utils 12.0.0-alpha.9453522405 → 12.0.0-rc.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "12.0.0-alpha.9453522405",
3
+ "version": "12.0.0-rc.2",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "12.0.0-alpha.9453522405",
31
+ "@applicaster/applicaster-types": "12.0.0-rc.2",
32
32
  "buffer": "^5.2.1",
33
33
  "camelize": "^1.0.0",
34
34
  "create-react-context": "^0.2.3",
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { DeviceEventEmitter, NativeModules, Platform } from "react-native";
3
+ import { PushTopicManager } from "@applicaster/zapp-react-native-bridge/PushNotifications/PushTopicManager";
3
4
 
4
5
  const { ReactNativeEventBusBridge } = NativeModules;
5
6
 
@@ -10,20 +11,26 @@ export const useListenEventBusEvent = (
10
11
  handler: (event) => void
11
12
  ) => {
12
13
  React.useEffect(() => {
14
+ let sub;
15
+
16
+ // TODO: remove after implementing ReactNativeEventBusBridge on iOS
13
17
  if (Platform.OS === "android") {
14
18
  // subscribe to DeviceEventEmitter using subsciption ID
15
- const sub = DeviceEventEmitter.addListener(
19
+ sub = DeviceEventEmitter.addListener(
16
20
  subscriptionID,
17
21
  handler
18
22
  );
19
23
 
20
24
  // ask native to start routing these events to RN
21
25
  ReactNativeEventBusBridge.subscribe(subscriptionID, { [source]: events });
22
-
23
- return () => {
24
- ReactNativeEventBusBridge.unsubscribe(subscriptionID); // ask EventBus to stop routing these events to RN
25
- sub.remove(); // stop listening to DeviceEventEmitter
26
- };
27
26
  }
28
- }, [subscriptionID, source, events, handler]);
27
+
28
+ // getting tags right after subscription
29
+ PushTopicManager.getInstance().prepareTags();
30
+
31
+ return () => {
32
+ ReactNativeEventBusBridge?.unsubscribe?.(subscriptionID); // ask EventBus to stop routing these events to RN
33
+ sub?.remove?.(); // stop listening to DeviceEventEmitter
34
+ };
35
+ }, []);
29
36
  };