@apps-in-toss/framework 0.0.34 → 0.0.36
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/dist/index.cjs +175 -89
- package/dist/index.d.cts +110 -1
- package/dist/index.d.ts +110 -1
- package/dist/index.js +139 -54
- package/package.json +5 -5
- package/src/event-bridges.ts +1 -0
- package/dist/bridge-meta.d.ts +0 -1
- package/dist/bridge-meta.js +0 -195
- package/dist/internal.cjs +0 -24
- package/dist/internal.d.cts +0 -1
- package/dist/internal.d.ts +0 -1
- package/dist/internal.js +0 -2
package/dist/index.cjs
CHANGED
|
@@ -42,6 +42,7 @@ __export(src_exports, {
|
|
|
42
42
|
WebView: () => WebView,
|
|
43
43
|
appLogin: () => appLogin,
|
|
44
44
|
appsInTossEvent: () => appsInTossEvent,
|
|
45
|
+
contactsViral: () => contactsViral,
|
|
45
46
|
env: () => env,
|
|
46
47
|
eventLog: () => eventLog,
|
|
47
48
|
fetchAlbumPhotos: () => fetchAlbumPhotos,
|
|
@@ -70,17 +71,34 @@ var import_analytics2 = require("@apps-in-toss/analytics");
|
|
|
70
71
|
// src/core/registerApp.tsx
|
|
71
72
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
72
73
|
var import_react_native6 = require("@toss-design-system/react-native");
|
|
73
|
-
var
|
|
74
|
+
var import_react_native_bedrock11 = require("react-native-bedrock");
|
|
74
75
|
|
|
75
76
|
// src/core/components/AppEvent.tsx
|
|
76
|
-
var
|
|
77
|
-
var
|
|
77
|
+
var import_react3 = require("react");
|
|
78
|
+
var import_react_native_bedrock4 = require("react-native-bedrock");
|
|
78
79
|
|
|
79
80
|
// src/env.ts
|
|
80
81
|
var env = {
|
|
81
82
|
getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
|
|
82
83
|
};
|
|
83
84
|
|
|
85
|
+
// src/hooks/useCaptureExitLog.ts
|
|
86
|
+
var import_react2 = require("react");
|
|
87
|
+
var import_react_native_bedrock3 = require("react-native-bedrock");
|
|
88
|
+
|
|
89
|
+
// src/core/hooks/useReferrer.ts
|
|
90
|
+
var import_react = require("react");
|
|
91
|
+
var import_react_native_bedrock = require("react-native-bedrock");
|
|
92
|
+
function useReferrer() {
|
|
93
|
+
return (0, import_react.useMemo)(() => {
|
|
94
|
+
try {
|
|
95
|
+
return new URL((0, import_react_native_bedrock.getSchemeUri)()).searchParams.get("referrer");
|
|
96
|
+
} catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}, []);
|
|
100
|
+
}
|
|
101
|
+
|
|
84
102
|
// src/native-modules/tossCore.ts
|
|
85
103
|
var import_react_native3 = require("react-native");
|
|
86
104
|
|
|
@@ -202,21 +220,8 @@ function tossCoreEventLog(params) {
|
|
|
202
220
|
});
|
|
203
221
|
}
|
|
204
222
|
|
|
205
|
-
// src/
|
|
206
|
-
var
|
|
207
|
-
var import_react_native_bedrock = require("react-native-bedrock");
|
|
208
|
-
function useReferrer() {
|
|
209
|
-
return (0, import_react.useMemo)(() => {
|
|
210
|
-
try {
|
|
211
|
-
return new URL((0, import_react_native_bedrock.getSchemeUri)()).searchParams.get("referrer");
|
|
212
|
-
} catch {
|
|
213
|
-
return null;
|
|
214
|
-
}
|
|
215
|
-
}, []);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// src/core/components/AppEvent.tsx
|
|
219
|
-
var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
|
|
223
|
+
// src/utils/isPrivateScheme.ts
|
|
224
|
+
var import_react_native_bedrock2 = require("react-native-bedrock");
|
|
220
225
|
function isPrivateScheme() {
|
|
221
226
|
try {
|
|
222
227
|
return new URL((0, import_react_native_bedrock2.getSchemeUri)()).protocol === "intoss-private:";
|
|
@@ -224,9 +229,51 @@ function isPrivateScheme() {
|
|
|
224
229
|
return false;
|
|
225
230
|
}
|
|
226
231
|
}
|
|
232
|
+
|
|
233
|
+
// src/hooks/useCaptureExitLog.ts
|
|
234
|
+
var EXIT_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__stay_time";
|
|
235
|
+
var EXIT_IMPRESSION_SCHEMA_ID = 1631628;
|
|
236
|
+
function useCaptureExitLog() {
|
|
237
|
+
const referrer = useReferrer();
|
|
238
|
+
const visible = (0, import_react_native_bedrock3.useVisibility)();
|
|
239
|
+
const enterTime = (0, import_react2.useRef)(void 0);
|
|
240
|
+
(0, import_react2.useEffect)(() => {
|
|
241
|
+
if (visible === true) {
|
|
242
|
+
enterTime.current = Date.now();
|
|
243
|
+
}
|
|
244
|
+
}, [visible]);
|
|
245
|
+
const captureExitLog = (0, import_react2.useCallback)(
|
|
246
|
+
(exitTime) => {
|
|
247
|
+
if (enterTime.current == null) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const stayTime = Math.floor(exitTime - enterTime.current);
|
|
251
|
+
tossCoreEventLog({
|
|
252
|
+
log_name: EXIT_IMPRESSION_LOG_NAME,
|
|
253
|
+
log_type: "event",
|
|
254
|
+
params: {
|
|
255
|
+
schema_id: EXIT_IMPRESSION_SCHEMA_ID,
|
|
256
|
+
event_type: "impression",
|
|
257
|
+
referrer,
|
|
258
|
+
deployment_id: env.getDeploymentId(),
|
|
259
|
+
app_name: import_react_native_bedrock3.Bedrock.appName,
|
|
260
|
+
is_private: isPrivateScheme(),
|
|
261
|
+
stay_time: stayTime.toString(),
|
|
262
|
+
exit_time: exitTime.toString()
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
enterTime.current = void 0;
|
|
266
|
+
},
|
|
267
|
+
[referrer]
|
|
268
|
+
);
|
|
269
|
+
return { captureExitLog };
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// src/core/components/AppEvent.tsx
|
|
273
|
+
var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
|
|
227
274
|
function EntryAppEvent() {
|
|
228
275
|
const referrer = useReferrer() ?? "";
|
|
229
|
-
(0,
|
|
276
|
+
(0, import_react3.useEffect)(() => {
|
|
230
277
|
tossCoreEventLog({
|
|
231
278
|
log_name: "appsintoss_app_visit::impression__enter_appsintoss",
|
|
232
279
|
log_type: "info",
|
|
@@ -235,7 +282,7 @@ function EntryAppEvent() {
|
|
|
235
282
|
schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
|
|
236
283
|
referrer,
|
|
237
284
|
deployment_id: env.getDeploymentId(),
|
|
238
|
-
app_name:
|
|
285
|
+
app_name: import_react_native_bedrock4.Bedrock.appName,
|
|
239
286
|
is_private: isPrivateScheme()
|
|
240
287
|
}
|
|
241
288
|
});
|
|
@@ -243,36 +290,47 @@ function EntryAppEvent() {
|
|
|
243
290
|
return null;
|
|
244
291
|
}
|
|
245
292
|
function SystemAppEvent({ ...initialProps }) {
|
|
246
|
-
(0,
|
|
293
|
+
(0, import_react3.useEffect)(() => {
|
|
247
294
|
tossCoreEventLog({
|
|
248
295
|
log_name: "AppsInTossInitialProps",
|
|
249
296
|
log_type: "debug",
|
|
250
297
|
params: {
|
|
251
298
|
...initialProps,
|
|
252
|
-
schemeUri: (0,
|
|
299
|
+
schemeUri: (0, import_react_native_bedrock4.getSchemeUri)(),
|
|
253
300
|
deployment_id: env.getDeploymentId(),
|
|
254
|
-
app_name:
|
|
301
|
+
app_name: import_react_native_bedrock4.Bedrock.appName,
|
|
255
302
|
is_private: isPrivateScheme()
|
|
256
303
|
}
|
|
257
304
|
});
|
|
258
305
|
}, [initialProps]);
|
|
259
306
|
return null;
|
|
260
307
|
}
|
|
308
|
+
function StayTimeAppEvent() {
|
|
309
|
+
const visible = (0, import_react_native_bedrock4.useVisibility)();
|
|
310
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
311
|
+
(0, import_react3.useEffect)(() => {
|
|
312
|
+
if (visible === false) {
|
|
313
|
+
captureExitLog(Date.now());
|
|
314
|
+
}
|
|
315
|
+
}, [visible, captureExitLog]);
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
261
318
|
var AppEvent = {
|
|
262
319
|
Entry: EntryAppEvent,
|
|
263
|
-
System: SystemAppEvent
|
|
320
|
+
System: SystemAppEvent,
|
|
321
|
+
StayTime: StayTimeAppEvent
|
|
264
322
|
};
|
|
265
323
|
|
|
266
324
|
// src/core/hooks/useAppsInTossBridge.ts
|
|
267
325
|
var import_react_native5 = require("@toss-design-system/react-native");
|
|
268
|
-
var
|
|
326
|
+
var import_react4 = require("react");
|
|
269
327
|
|
|
270
328
|
// src/native-event-emitter/appsInTossEvent.ts
|
|
271
|
-
var
|
|
329
|
+
var import_react_native_bedrock9 = require("react-native-bedrock");
|
|
272
330
|
|
|
273
331
|
// src/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
|
|
274
|
-
var
|
|
275
|
-
var EntryMessageExitedEvent = class extends
|
|
332
|
+
var import_react_native_bedrock5 = require("react-native-bedrock");
|
|
333
|
+
var EntryMessageExitedEvent = class extends import_react_native_bedrock5.BedrockEventDefinition {
|
|
276
334
|
name = "entryMessageExited";
|
|
277
335
|
remove() {
|
|
278
336
|
}
|
|
@@ -282,7 +340,7 @@ var EntryMessageExitedEvent = class extends import_react_native_bedrock3.Bedrock
|
|
|
282
340
|
};
|
|
283
341
|
|
|
284
342
|
// src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
285
|
-
var
|
|
343
|
+
var import_react_native_bedrock6 = require("react-native-bedrock");
|
|
286
344
|
|
|
287
345
|
// src/native-modules/getPermission.ts
|
|
288
346
|
function getPermission(permission) {
|
|
@@ -311,7 +369,7 @@ var import_react_native4 = require("react-native");
|
|
|
311
369
|
var nativeEventEmitter = new import_react_native4.NativeEventEmitter(AppsInTossModuleInstance);
|
|
312
370
|
|
|
313
371
|
// src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
314
|
-
var UpdateLocationEvent = class extends
|
|
372
|
+
var UpdateLocationEvent = class extends import_react_native_bedrock6.BedrockEventDefinition {
|
|
315
373
|
name = "updateLocationEvent";
|
|
316
374
|
subscriptionCount = 0;
|
|
317
375
|
ref = {
|
|
@@ -341,7 +399,7 @@ var UpdateLocationEvent = class extends import_react_native_bedrock4.BedrockEven
|
|
|
341
399
|
};
|
|
342
400
|
|
|
343
401
|
// src/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
344
|
-
var
|
|
402
|
+
var import_react_native_bedrock7 = require("react-native-bedrock");
|
|
345
403
|
|
|
346
404
|
// src/utils/generateUUID.ts
|
|
347
405
|
function generateUUID(placeholder) {
|
|
@@ -398,7 +456,7 @@ var INTERNAL__appBridgeHandler = {
|
|
|
398
456
|
|
|
399
457
|
// src/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
400
458
|
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
401
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends
|
|
459
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native_bedrock7.BedrockEventDefinition {
|
|
402
460
|
static INTERNAL__appBridgeSubscription;
|
|
403
461
|
name = "appBridgeCallbackEvent";
|
|
404
462
|
constructor() {
|
|
@@ -428,8 +486,8 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_
|
|
|
428
486
|
};
|
|
429
487
|
|
|
430
488
|
// src/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
431
|
-
var
|
|
432
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends
|
|
489
|
+
var import_react_native_bedrock8 = require("react-native-bedrock");
|
|
490
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native_bedrock8.BedrockEventDefinition {
|
|
433
491
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
434
492
|
subscription = null;
|
|
435
493
|
remove() {
|
|
@@ -454,7 +512,7 @@ var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_n
|
|
|
454
512
|
};
|
|
455
513
|
|
|
456
514
|
// src/native-event-emitter/appsInTossEvent.ts
|
|
457
|
-
var appsInTossEvent = new
|
|
515
|
+
var appsInTossEvent = new import_react_native_bedrock9.BedrockEvent([
|
|
458
516
|
new UpdateLocationEvent(),
|
|
459
517
|
new EntryMessageExitedEvent(),
|
|
460
518
|
// Internal events
|
|
@@ -479,7 +537,7 @@ function toIcon(source) {
|
|
|
479
537
|
function useAppsInTossBridge() {
|
|
480
538
|
const controller = (0, import_react_native5.useBridge)();
|
|
481
539
|
const appsInTossGlobals2 = getAppsInTossGlobals();
|
|
482
|
-
(0,
|
|
540
|
+
(0, import_react4.useEffect)(() => {
|
|
483
541
|
const commonProps = {
|
|
484
542
|
serviceName: appsInTossGlobals2.brandDisplayName,
|
|
485
543
|
icon: toIcon(appsInTossGlobals2.brandIcon),
|
|
@@ -681,7 +739,7 @@ async function getGameCenterGameProfile() {
|
|
|
681
739
|
}
|
|
682
740
|
|
|
683
741
|
// src/native-modules/openGameCenterLeaderboard.ts
|
|
684
|
-
var
|
|
742
|
+
var import_react_native_bedrock10 = require("react-native-bedrock");
|
|
685
743
|
async function openGameCenterLeaderboard() {
|
|
686
744
|
if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
|
|
687
745
|
return;
|
|
@@ -689,7 +747,7 @@ async function openGameCenterLeaderboard() {
|
|
|
689
747
|
const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
|
|
690
748
|
url.searchParams.set("appName", getAppName());
|
|
691
749
|
url.searchParams.set("referrer", `appsintoss.${getAppName()}`);
|
|
692
|
-
return (0,
|
|
750
|
+
return (0, import_react_native_bedrock10.openURL)(url.toString());
|
|
693
751
|
}
|
|
694
752
|
|
|
695
753
|
// src/native-modules/submitGameCenterLeaderBoardScore.ts
|
|
@@ -705,6 +763,7 @@ async function submitGameCenterLeaderBoardScore(params) {
|
|
|
705
763
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
706
764
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
707
765
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
766
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppEvent.StayTime, {}),
|
|
708
767
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppEvent.Entry, {}),
|
|
709
768
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppEvent.System, { ...initialProps }),
|
|
710
769
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native6.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TDSContainer, { ...initialProps, children }) }) })
|
|
@@ -719,7 +778,7 @@ function registerApp(container, { context, analytics }) {
|
|
|
719
778
|
logger: (params) => void eventLog(params),
|
|
720
779
|
debug: analytics?.debug ?? __DEV__
|
|
721
780
|
});
|
|
722
|
-
return
|
|
781
|
+
return import_react_native_bedrock11.Bedrock.registerApp(AppsInTossContainer.bind(null, container), {
|
|
723
782
|
appName: getAppName(),
|
|
724
783
|
context,
|
|
725
784
|
router: {
|
|
@@ -914,6 +973,29 @@ var Storage = {
|
|
|
914
973
|
clearItems
|
|
915
974
|
};
|
|
916
975
|
|
|
976
|
+
// src/native-modules/contactsViral.ts
|
|
977
|
+
function contactsViral(params) {
|
|
978
|
+
const isSupported = isMinVersionSupported({
|
|
979
|
+
android: "5.223.0",
|
|
980
|
+
ios: "5.223.0"
|
|
981
|
+
});
|
|
982
|
+
if (!isSupported) {
|
|
983
|
+
return () => {
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
const { onEvent, onError, options } = params;
|
|
987
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("contactsViral", options, {
|
|
988
|
+
onRewardFromContactsViral: (result) => {
|
|
989
|
+
onEvent({ type: "sendViral", data: result });
|
|
990
|
+
},
|
|
991
|
+
onSuccess: (result) => {
|
|
992
|
+
onEvent({ type: "close", data: result });
|
|
993
|
+
},
|
|
994
|
+
onError
|
|
995
|
+
});
|
|
996
|
+
return unregisterCallbacks;
|
|
997
|
+
}
|
|
998
|
+
|
|
917
999
|
// src/native-modules/index.ts
|
|
918
1000
|
var TossPay = {
|
|
919
1001
|
checkoutPayment
|
|
@@ -928,9 +1010,9 @@ var GoogleAdMob = {
|
|
|
928
1010
|
// src/components/WebView.tsx
|
|
929
1011
|
var import_react_native20 = require("@toss-design-system/react-native");
|
|
930
1012
|
var import_private3 = require("@toss-design-system/react-native/private");
|
|
931
|
-
var
|
|
1013
|
+
var import_react10 = require("react");
|
|
932
1014
|
var import_react_native21 = require("react-native");
|
|
933
|
-
var
|
|
1015
|
+
var import_react_native_bedrock18 = require("react-native-bedrock");
|
|
934
1016
|
var bedrockAsyncBridges = __toESM(require("react-native-bedrock/async-bridges"), 1);
|
|
935
1017
|
var bedrockConstantBridges = __toESM(require("react-native-bedrock/constant-bridges"), 1);
|
|
936
1018
|
|
|
@@ -938,20 +1020,20 @@ var bedrockConstantBridges = __toESM(require("react-native-bedrock/constant-brid
|
|
|
938
1020
|
var import_react_native_webview = require("@react-native-bedrock/native/react-native-webview");
|
|
939
1021
|
var import_react_native17 = require("@toss-design-system/react-native");
|
|
940
1022
|
var import_es_hangul2 = require("es-hangul");
|
|
941
|
-
var
|
|
1023
|
+
var import_react7 = require("react");
|
|
942
1024
|
var import_react_native18 = require("react-native");
|
|
943
|
-
var
|
|
1025
|
+
var import_react_native_bedrock14 = require("react-native-bedrock");
|
|
944
1026
|
|
|
945
1027
|
// src/components/GameProfile.tsx
|
|
946
1028
|
var import_react_native10 = require("@toss-design-system/react-native");
|
|
947
|
-
var
|
|
1029
|
+
var import_react6 = require("react");
|
|
948
1030
|
var import_react_native11 = require("react-native");
|
|
949
1031
|
|
|
950
1032
|
// src/hooks/useGameCenterProfile.ts
|
|
951
1033
|
var import_react_native9 = require("@toss-design-system/react-native");
|
|
952
1034
|
var import_es_hangul = require("es-hangul");
|
|
953
|
-
var
|
|
954
|
-
var
|
|
1035
|
+
var import_react5 = require("react");
|
|
1036
|
+
var import_react_native_bedrock13 = require("react-native-bedrock");
|
|
955
1037
|
|
|
956
1038
|
// src/components/GameProfileToast.tsx
|
|
957
1039
|
var import_react_native7 = require("@toss-design-system/react-native");
|
|
@@ -1004,7 +1086,7 @@ var getMarketLink = () => {
|
|
|
1004
1086
|
};
|
|
1005
1087
|
|
|
1006
1088
|
// src/utils/openTransparentWebView.ts
|
|
1007
|
-
var
|
|
1089
|
+
var import_react_native_bedrock12 = require("react-native-bedrock");
|
|
1008
1090
|
|
|
1009
1091
|
// src/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
1010
1092
|
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
@@ -1042,29 +1124,29 @@ var openTransparentWebView = ({
|
|
|
1042
1124
|
}
|
|
1043
1125
|
}
|
|
1044
1126
|
});
|
|
1045
|
-
(0,
|
|
1127
|
+
(0, import_react_native_bedrock12.openURL)(url.toString());
|
|
1046
1128
|
};
|
|
1047
1129
|
|
|
1048
1130
|
// src/hooks/useGameCenterProfile.ts
|
|
1049
1131
|
var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
1050
|
-
const [profileData, setProfileData] = (0,
|
|
1051
|
-
const [isProfileDataLoading, setIsProfileDataLoading] = (0,
|
|
1052
|
-
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0,
|
|
1132
|
+
const [profileData, setProfileData] = (0, import_react5.useState)(void 0);
|
|
1133
|
+
const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react5.useState)(true);
|
|
1134
|
+
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react5.useState)(false);
|
|
1053
1135
|
const shouldShowLoadingOverlay = isProfileDataLoading && isReadyForProfileUI;
|
|
1054
1136
|
const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && isReadyForProfileUI && !isProfileDataRefetching;
|
|
1055
1137
|
const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
|
|
1056
|
-
const [isWebviewLoading, setIsWebviewLoading] = (0,
|
|
1057
|
-
const isCompletedProfileFlow = (0,
|
|
1138
|
+
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react5.useState)(false);
|
|
1139
|
+
const isCompletedProfileFlow = (0, import_react5.useRef)(false);
|
|
1058
1140
|
const { openAlert, openConfirm } = (0, import_react_native9.useDialog)();
|
|
1059
1141
|
const { openGameProfileToast } = useGameProfileToast();
|
|
1060
|
-
const openErrorAlert = (0,
|
|
1142
|
+
const openErrorAlert = (0, import_react5.useCallback)(async () => {
|
|
1061
1143
|
await openAlert({
|
|
1062
1144
|
title: DEFAULT_ERROR.title,
|
|
1063
1145
|
description: DEFAULT_ERROR.description
|
|
1064
1146
|
});
|
|
1065
|
-
(0,
|
|
1147
|
+
(0, import_react_native_bedrock13.closeView)();
|
|
1066
1148
|
}, [openAlert]);
|
|
1067
|
-
const openProfileWebview = (0,
|
|
1149
|
+
const openProfileWebview = (0, import_react5.useCallback)(() => {
|
|
1068
1150
|
if (isWebviewLoading) {
|
|
1069
1151
|
return;
|
|
1070
1152
|
}
|
|
@@ -1093,7 +1175,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
1093
1175
|
}
|
|
1094
1176
|
});
|
|
1095
1177
|
}, [isWebviewLoading, openGameProfileToast, openErrorAlert]);
|
|
1096
|
-
const updateAppToSupportedMinVersion = (0,
|
|
1178
|
+
const updateAppToSupportedMinVersion = (0, import_react5.useCallback)(async () => {
|
|
1097
1179
|
const upddateConfirmDialogLabel = {
|
|
1098
1180
|
title: `${(0, import_es_hangul.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
1099
1181
|
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
@@ -1107,11 +1189,11 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
1107
1189
|
closeOnDimmerClick: true
|
|
1108
1190
|
});
|
|
1109
1191
|
if (!isConfirmed) {
|
|
1110
|
-
(0,
|
|
1192
|
+
(0, import_react_native_bedrock13.closeView)();
|
|
1111
1193
|
return;
|
|
1112
1194
|
}
|
|
1113
1195
|
const STORE_SCHEME = getMarketLink();
|
|
1114
|
-
(0,
|
|
1196
|
+
(0, import_react_native_bedrock13.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
1115
1197
|
}, [openConfirm]);
|
|
1116
1198
|
return {
|
|
1117
1199
|
profileData,
|
|
@@ -1156,7 +1238,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1156
1238
|
openErrorAlert,
|
|
1157
1239
|
openGameProfileToast
|
|
1158
1240
|
} = useGameCenterProfile(isReadyForProfileUI);
|
|
1159
|
-
(0,
|
|
1241
|
+
(0, import_react6.useEffect)(() => {
|
|
1160
1242
|
try {
|
|
1161
1243
|
const getProfileData = async () => {
|
|
1162
1244
|
const data = await getGameCenterGameProfile();
|
|
@@ -1169,7 +1251,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1169
1251
|
setIsProfileDataLoading(false);
|
|
1170
1252
|
}
|
|
1171
1253
|
}, []);
|
|
1172
|
-
(0,
|
|
1254
|
+
(0, import_react6.useEffect)(() => {
|
|
1173
1255
|
const handleGameProfileFlow = async () => {
|
|
1174
1256
|
if (!canShowBottomSheetOrToast) {
|
|
1175
1257
|
return;
|
|
@@ -1357,11 +1439,12 @@ function GameNavigationBar({ onClose }) {
|
|
|
1357
1439
|
|
|
1358
1440
|
// src/components/GameWebView.tsx
|
|
1359
1441
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1360
|
-
var GameWebView = (0,
|
|
1442
|
+
var GameWebView = (0, import_react7.forwardRef)(function GameWebView2(props, ref) {
|
|
1361
1443
|
const { openConfirm } = (0, import_react_native17.useDialog)();
|
|
1362
1444
|
const { brandDisplayName } = getAppsInTossGlobals();
|
|
1363
|
-
const
|
|
1364
|
-
const
|
|
1445
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
1446
|
+
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react7.useState)(false);
|
|
1447
|
+
const handleClose = (0, import_react7.useCallback)(async () => {
|
|
1365
1448
|
const isConfirmed = await openConfirm({
|
|
1366
1449
|
title: `${(0, import_es_hangul2.josa)(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
1367
1450
|
leftButton: "\uCDE8\uC18C",
|
|
@@ -1369,19 +1452,20 @@ var GameWebView = (0, import_react6.forwardRef)(function GameWebView2(props, ref
|
|
|
1369
1452
|
closeOnDimmerClick: true
|
|
1370
1453
|
});
|
|
1371
1454
|
if (isConfirmed) {
|
|
1372
|
-
(
|
|
1455
|
+
captureExitLog(Date.now());
|
|
1456
|
+
(0, import_react_native_bedrock14.closeView)();
|
|
1373
1457
|
}
|
|
1374
|
-
}, [brandDisplayName, openConfirm]);
|
|
1375
|
-
(0,
|
|
1458
|
+
}, [brandDisplayName, captureExitLog, openConfirm]);
|
|
1459
|
+
(0, import_react7.useEffect)(() => {
|
|
1376
1460
|
if (import_react_native18.Platform.OS === "ios") {
|
|
1377
|
-
(0,
|
|
1461
|
+
(0, import_react_native_bedrock14.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1378
1462
|
return () => {
|
|
1379
|
-
(0,
|
|
1463
|
+
(0, import_react_native_bedrock14.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1380
1464
|
};
|
|
1381
1465
|
}
|
|
1382
1466
|
return;
|
|
1383
1467
|
}, []);
|
|
1384
|
-
(0,
|
|
1468
|
+
(0, import_react7.useEffect)(() => {
|
|
1385
1469
|
const backHandler = () => {
|
|
1386
1470
|
handleClose();
|
|
1387
1471
|
return true;
|
|
@@ -1391,7 +1475,7 @@ var GameWebView = (0, import_react6.forwardRef)(function GameWebView2(props, ref
|
|
|
1391
1475
|
import_react_native18.BackHandler.removeEventListener("hardwareBackPress", backHandler);
|
|
1392
1476
|
};
|
|
1393
1477
|
}, [handleClose]);
|
|
1394
|
-
(0,
|
|
1478
|
+
(0, import_react7.useEffect)(() => {
|
|
1395
1479
|
appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1396
1480
|
onEvent: () => {
|
|
1397
1481
|
setIsEntryMessageExited(true);
|
|
@@ -1405,7 +1489,7 @@ var GameWebView = (0, import_react6.forwardRef)(function GameWebView2(props, ref
|
|
|
1405
1489
|
});
|
|
1406
1490
|
|
|
1407
1491
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1408
|
-
var
|
|
1492
|
+
var import_react8 = require("react");
|
|
1409
1493
|
function serializeError(error) {
|
|
1410
1494
|
return JSON.stringify(error, (_, value) => {
|
|
1411
1495
|
if (value instanceof Error) {
|
|
@@ -1454,8 +1538,8 @@ function useBridgeHandler({
|
|
|
1454
1538
|
eventListenerMap,
|
|
1455
1539
|
injectedJavaScript: originalInjectedJavaScript
|
|
1456
1540
|
}) {
|
|
1457
|
-
const ref = (0,
|
|
1458
|
-
const injectedJavaScript = (0,
|
|
1541
|
+
const ref = (0, import_react8.useRef)(null);
|
|
1542
|
+
const injectedJavaScript = (0, import_react8.useMemo)(
|
|
1459
1543
|
() => [
|
|
1460
1544
|
`window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
1461
1545
|
Object.entries(constantHandlerMap).reduce(
|
|
@@ -1481,7 +1565,7 @@ function useBridgeHandler({
|
|
|
1481
1565
|
window.__BEDROCK_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${JSON.stringify(error, null, 0)});
|
|
1482
1566
|
`);
|
|
1483
1567
|
};
|
|
1484
|
-
const $onMessage = (0,
|
|
1568
|
+
const $onMessage = (0, import_react8.useCallback)(
|
|
1485
1569
|
async (e) => {
|
|
1486
1570
|
onMessage?.(e);
|
|
1487
1571
|
const data = JSON.parse(e.nativeEvent.data);
|
|
@@ -1542,12 +1626,13 @@ __export(constant_bridges_exports, {
|
|
|
1542
1626
|
// src/event-bridges.ts
|
|
1543
1627
|
var event_bridges_exports = {};
|
|
1544
1628
|
__export(event_bridges_exports, {
|
|
1629
|
+
contactsViral: () => contactsViral,
|
|
1545
1630
|
startUpdateLocation: () => startUpdateLocation
|
|
1546
1631
|
});
|
|
1547
1632
|
|
|
1548
1633
|
// src/hooks/useCreateUserAgent.ts
|
|
1549
1634
|
var import_react_native19 = require("react-native");
|
|
1550
|
-
var
|
|
1635
|
+
var import_react_native_bedrock15 = require("react-native-bedrock");
|
|
1551
1636
|
var FontA11yCategory = {
|
|
1552
1637
|
Large: "Large",
|
|
1553
1638
|
xLarge: "xLarge",
|
|
@@ -1680,7 +1765,7 @@ function useCreateUserAgent({
|
|
|
1680
1765
|
safeArea,
|
|
1681
1766
|
safeAreaBottomTransparency
|
|
1682
1767
|
}) {
|
|
1683
|
-
const platform = (0,
|
|
1768
|
+
const platform = (0, import_react_native_bedrock15.getPlatformOS)();
|
|
1684
1769
|
const appVersion = getTossAppVersion();
|
|
1685
1770
|
const { fontScale } = (0, import_react_native19.useWindowDimensions)();
|
|
1686
1771
|
const platformString = platform === "ios" ? "iPhone" : "Android";
|
|
@@ -1702,12 +1787,12 @@ function useCreateUserAgent({
|
|
|
1702
1787
|
}
|
|
1703
1788
|
|
|
1704
1789
|
// src/hooks/useGeolocation.ts
|
|
1705
|
-
var
|
|
1706
|
-
var
|
|
1790
|
+
var import_react9 = require("react");
|
|
1791
|
+
var import_react_native_bedrock16 = require("react-native-bedrock");
|
|
1707
1792
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
1708
|
-
const isVisible = (0,
|
|
1709
|
-
const [location, setLocation] = (0,
|
|
1710
|
-
(0,
|
|
1793
|
+
const isVisible = (0, import_react_native_bedrock16.useVisibility)();
|
|
1794
|
+
const [location, setLocation] = (0, import_react9.useState)(null);
|
|
1795
|
+
(0, import_react9.useEffect)(() => {
|
|
1711
1796
|
if (!isVisible) {
|
|
1712
1797
|
return;
|
|
1713
1798
|
}
|
|
@@ -1725,7 +1810,7 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
1725
1810
|
}
|
|
1726
1811
|
|
|
1727
1812
|
// src/utils/log.ts
|
|
1728
|
-
var
|
|
1813
|
+
var import_react_native_bedrock17 = require("react-native-bedrock");
|
|
1729
1814
|
|
|
1730
1815
|
// src/utils/extractDateFromUUIDv7.ts
|
|
1731
1816
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -1751,7 +1836,7 @@ var getGroupId = (url) => {
|
|
|
1751
1836
|
};
|
|
1752
1837
|
var getReferrer = () => {
|
|
1753
1838
|
try {
|
|
1754
|
-
const referrer = new URL((0,
|
|
1839
|
+
const referrer = new URL((0, import_react_native_bedrock17.getSchemeUri)());
|
|
1755
1840
|
return referrer.searchParams.get("referrer");
|
|
1756
1841
|
} catch {
|
|
1757
1842
|
return "";
|
|
@@ -1784,7 +1869,7 @@ var WEBVIEW_TYPES = {
|
|
|
1784
1869
|
};
|
|
1785
1870
|
function mergeSchemeQueryParamsInto(url) {
|
|
1786
1871
|
const baseUrl = new URL(url);
|
|
1787
|
-
const schemeUrl = new URL((0,
|
|
1872
|
+
const schemeUrl = new URL((0, import_react_native_bedrock18.getSchemeUri)());
|
|
1788
1873
|
baseUrl.pathname = schemeUrl.pathname;
|
|
1789
1874
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
1790
1875
|
baseUrl.searchParams.set(key, value);
|
|
@@ -1808,8 +1893,8 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1808
1893
|
if (!TYPES.includes(type)) {
|
|
1809
1894
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
1810
1895
|
}
|
|
1811
|
-
const bedrockEvent = (0,
|
|
1812
|
-
const uri = (0,
|
|
1896
|
+
const bedrockEvent = (0, import_react_native_bedrock18.useBedrockEvent)();
|
|
1897
|
+
const uri = (0, import_react10.useMemo)(() => getWebViewUri(local), [local]);
|
|
1813
1898
|
const top = (0, import_private3.useSafeAreaTop)();
|
|
1814
1899
|
const bottom = (0, import_private3.useSafeAreaBottom)();
|
|
1815
1900
|
const global2 = getAppsInTossGlobals();
|
|
@@ -1865,7 +1950,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1865
1950
|
iapGetProductItemList: IAP.getProductItemList
|
|
1866
1951
|
}
|
|
1867
1952
|
});
|
|
1868
|
-
const baseProps = (0,
|
|
1953
|
+
const baseProps = (0, import_react10.useMemo)(() => {
|
|
1869
1954
|
switch (type) {
|
|
1870
1955
|
case "partner": {
|
|
1871
1956
|
const headerOnlyProp = {
|
|
@@ -1894,7 +1979,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1894
1979
|
}, [type, props]);
|
|
1895
1980
|
const BaseWebView = WEBVIEW_TYPES[type];
|
|
1896
1981
|
const webViewDebuggingEnabled = operationalEnvironment === "sandbox";
|
|
1897
|
-
const handleNavigationStateChange = (0,
|
|
1982
|
+
const handleNavigationStateChange = (0, import_react10.useCallback)((event) => {
|
|
1898
1983
|
if (event.url) {
|
|
1899
1984
|
trackScreen(event.url);
|
|
1900
1985
|
}
|
|
@@ -1966,6 +2051,7 @@ var Analytics2 = {
|
|
|
1966
2051
|
WebView,
|
|
1967
2052
|
appLogin,
|
|
1968
2053
|
appsInTossEvent,
|
|
2054
|
+
contactsViral,
|
|
1969
2055
|
env,
|
|
1970
2056
|
eventLog,
|
|
1971
2057
|
fetchAlbumPhotos,
|