@applicaster/quick-brick-core 13.0.0-alpha.5428512514 → 13.0.0-alpha.6095951301
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,6 +10,7 @@ import * as ReactNative from "react-native";
|
|
|
10
10
|
|
|
11
11
|
import { isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
12
12
|
import { log_debug, log_error, log_info } from "../logger";
|
|
13
|
+
import { getAppUrlScheme } from "@applicaster/zapp-react-native-utils/appDataUtils";
|
|
13
14
|
|
|
14
15
|
type Props = {
|
|
15
16
|
listenerSpy?: (...any) => void;
|
|
@@ -34,6 +35,13 @@ const initialState = { url: null, done: () => {} };
|
|
|
34
35
|
|
|
35
36
|
export const URLSchemeContext = createContext<State>(initialState);
|
|
36
37
|
|
|
38
|
+
const getWebDeepLink = (initialURL: string) => {
|
|
39
|
+
const index = initialURL.indexOf("?");
|
|
40
|
+
if (index === -1) return;
|
|
41
|
+
|
|
42
|
+
return getAppUrlScheme() + "://open" + initialURL.slice(index);
|
|
43
|
+
};
|
|
44
|
+
|
|
37
45
|
function URLSchemeContextProvider(props: Props) {
|
|
38
46
|
const [state, setState] = useState<string | null>(initialState.url);
|
|
39
47
|
|
|
@@ -51,10 +59,22 @@ function URLSchemeContextProvider(props: Props) {
|
|
|
51
59
|
props?.listenerSpy?.("getInitialURL");
|
|
52
60
|
|
|
53
61
|
try {
|
|
54
|
-
if (isWeb()) return;
|
|
55
|
-
|
|
56
62
|
const url = await Linking.getInitialURL();
|
|
57
63
|
|
|
64
|
+
if (isWeb()) {
|
|
65
|
+
const deepLink = getWebDeepLink(url);
|
|
66
|
+
|
|
67
|
+
if (deepLink) {
|
|
68
|
+
log_info(
|
|
69
|
+
`URLSchemeContextProvider: Retrieved initial deep link: ${deepLink}`
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
return setState(deepLink);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
58
78
|
log_info(
|
|
59
79
|
`URLSchemeContextProvider: Retrieved initial url: ${url || "not exist"}`
|
|
60
80
|
);
|
|
@@ -497,8 +497,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
497
497
|
({ hookPlugin, payload, callback }, dispose) => {
|
|
498
498
|
if (hookPlugin?.lastHook) {
|
|
499
499
|
dispose({ disposeAll: true });
|
|
500
|
-
|
|
501
|
-
startUpHooks.current && setStartUpHooks(false);
|
|
500
|
+
currentStartUpHooks.current && setStartUpHooks(false);
|
|
502
501
|
}
|
|
503
502
|
|
|
504
503
|
dispatch(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-core",
|
|
3
|
-
"version": "13.0.0-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.6095951301",
|
|
4
4
|
"description": "Core package for Applicaster's Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@applicaster/applicaster-types": "13.0.0-alpha.
|
|
33
|
-
"@applicaster/quick-brick-core-plugins": "13.0.0-alpha.
|
|
34
|
-
"@applicaster/zapp-pipes-v2-client": "13.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.
|
|
38
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.
|
|
32
|
+
"@applicaster/applicaster-types": "13.0.0-alpha.6095951301",
|
|
33
|
+
"@applicaster/quick-brick-core-plugins": "13.0.0-alpha.6095951301",
|
|
34
|
+
"@applicaster/zapp-pipes-v2-client": "13.0.0-alpha.6095951301",
|
|
35
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.6095951301",
|
|
36
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.6095951301",
|
|
37
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.6095951301",
|
|
38
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.6095951301",
|
|
39
39
|
"atob": "^2.1.2",
|
|
40
40
|
"axios": "^0.28.0",
|
|
41
41
|
"btoa": "^1.2.1",
|