@applicaster/zapp-react-native-app 14.0.0-alpha.4055325032 → 14.0.0-alpha.4104749434

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.
@@ -10,9 +10,51 @@ import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/n
10
10
  import { useAnalytics } from "@applicaster/zapp-react-native-utils/analyticsUtils";
11
11
  import { useRivers } from "@applicaster/zapp-react-native-utils/reactHooks/state";
12
12
  import { useErrorStore } from "@applicaster/quick-brick-core/App/ErrorBoundary/store";
13
+ import { isApplePlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
13
14
 
14
15
  const getHome = R.compose(R.find(R.propEq("home", true)), R.values);
15
16
 
17
+ const isIOS = isApplePlatform();
18
+ /* Set to `false` in production, do not commit this change */
19
+ const IS_DEBUGGER_ENABLED = false;
20
+
21
+ /**
22
+ * This is a workaround to fix an error on start when debugger is connected.
23
+ * node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js :167
24
+ * callNativeSyncHook(
25
+ moduleID: number,
26
+ methodID: number,
27
+ params: mixed[],
28
+ onFail: ?Function,
29
+ onSucc: ?Function,
30
+ ): any {
31
+ this.processCallbacks(moduleID, methodID, params, onFail, onSucc);
32
+ if(global.nativeCallSyncHook)
33
+ {
34
+ return global.nativeCallSyncHook(moduleID, methodID, params);
35
+ }
36
+ }
37
+ */
38
+
39
+ // Assign this to a dev-only button or useEffect call
40
+ const connectToRemoteDebugger = () => {
41
+ if (!__DEV__ || !isIOS) return;
42
+
43
+ try {
44
+ const { DevSettings, NativeModules } = require("react-native");
45
+
46
+ if (DevSettings?.setIsDebuggingRemotely) {
47
+ DevSettings.setIsDebuggingRemotely(IS_DEBUGGER_ENABLED);
48
+
49
+ return;
50
+ }
51
+
52
+ NativeModules?.DevSettings?.setIsDebuggingRemotely?.(IS_DEBUGGER_ENABLED);
53
+ } catch (error) {
54
+ console.error(`connectToRemoteDebugger message: ${error.message}`);
55
+ }
56
+ };
57
+
16
58
  const InteractionManagerComponent = () => {
17
59
  const { sendHardwareBackButtonClickEvent } = useAnalytics();
18
60
  const rivers = useRivers();
@@ -66,10 +108,17 @@ const InteractionManagerComponent = () => {
66
108
  }, [navigator.currentRoute]);
67
109
 
68
110
  React.useEffect(() => {
69
- BackHandler.addEventListener("hardwareBackPress", onHardwareBackPress);
111
+ connectToRemoteDebugger();
112
+ }, []);
113
+
114
+ React.useEffect(() => {
115
+ const unsubscribe = BackHandler.addEventListener(
116
+ "hardwareBackPress",
117
+ onHardwareBackPress
118
+ );
70
119
 
71
120
  return () => {
72
- BackHandler.removeEventListener("hardwareBackPress", onHardwareBackPress);
121
+ unsubscribe.remove();
73
122
  };
74
123
  }, [onHardwareBackPress]);
75
124
 
@@ -138,6 +138,9 @@ jest.mock(
138
138
  );
139
139
 
140
140
  jest.mock("@applicaster/zapp-react-native-utils/navigationUtils", () => ({
141
+ ...(jest.requireActual(
142
+ "@applicaster/zapp-react-native-utils/navigationUtils"
143
+ ) as jest.Mock<any>),
141
144
  getNavigationProps: () => ({}),
142
145
  resolveNavigationPlugin: () => ({
143
146
  identifier: "quick-brick-bottom-tabs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-app",
3
- "version": "14.0.0-alpha.4055325032",
3
+ "version": "14.0.0-alpha.4104749434",
4
4
  "description": "Zapp App Component for Applicaster's Quick Brick React Native App",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/quick-brick-core": "14.0.0-alpha.4055325032",
31
- "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.4055325032",
32
- "@applicaster/zapp-react-native-redux": "14.0.0-alpha.4055325032",
33
- "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.4055325032",
34
- "@applicaster/zapp-react-native-utils": "14.0.0-alpha.4055325032",
30
+ "@applicaster/quick-brick-core": "14.0.0-alpha.4104749434",
31
+ "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.4104749434",
32
+ "@applicaster/zapp-react-native-redux": "14.0.0-alpha.4104749434",
33
+ "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.4104749434",
34
+ "@applicaster/zapp-react-native-utils": "14.0.0-alpha.4104749434",
35
35
  "axios": "^0.28.0",
36
36
  "camelize": "^1.0.0",
37
37
  "query-string": "7.1.3",
@@ -51,7 +51,6 @@
51
51
  "react-native": "*",
52
52
  "react-native-fs": "*",
53
53
  "react-native-linear-gradient": "*",
54
- "react-native-safe-area-context": "*",
55
54
  "react-native-svg": "*",
56
55
  "react-native-webview": "*",
57
56
  "uglify-js": "*",