@apps-in-toss/framework 0.0.39 → 1.0.0
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/bridge-meta.js +33 -14
- package/dist/index.cjs +1419 -781
- package/dist/index.d.cts +7 -2269
- package/dist/index.d.ts +7 -2269
- package/dist/index.js +1357 -736
- package/dist/internal.cjs +24 -0
- package/dist/internal.d.cts +1 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +2 -0
- package/dist/jest/index.cjs +2 -2
- package/dist/jest/index.d.cts +1 -1
- package/dist/jest/index.d.ts +1 -1
- package/dist/jest/index.js +1 -1
- package/package.json +27 -26
- package/src/bridge-entry.ts +4 -0
- package/src/async-bridges.ts +0 -15
- package/src/constant-bridges.ts +0 -3
- package/src/event-bridges.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -9,267 +9,30 @@ import { Analytics as InternalAnalytics } from "@apps-in-toss/analytics";
|
|
|
9
9
|
|
|
10
10
|
// src/core/registerApp.tsx
|
|
11
11
|
import { Analytics } from "@apps-in-toss/analytics";
|
|
12
|
-
import { TDSProvider } from "@toss-design-system/react-native";
|
|
13
|
-
import { Bedrock as Bedrock3 } from "react-native-bedrock";
|
|
14
|
-
|
|
15
|
-
// src/core/components/AppEvent.tsx
|
|
16
|
-
import { useEffect as useEffect2 } from "react";
|
|
17
|
-
import { Bedrock as Bedrock2, getSchemeUri as getSchemeUri3, useVisibility as useVisibility2 } from "react-native-bedrock";
|
|
18
|
-
|
|
19
|
-
// src/env.ts
|
|
20
|
-
var env = {
|
|
21
|
-
getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// src/hooks/useCaptureExitLog.ts
|
|
25
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
26
|
-
import { Bedrock, useVisibility } from "react-native-bedrock";
|
|
27
|
-
|
|
28
|
-
// src/core/hooks/useReferrer.ts
|
|
29
|
-
import { useMemo } from "react";
|
|
30
|
-
import { getSchemeUri } from "react-native-bedrock";
|
|
31
|
-
function useReferrer() {
|
|
32
|
-
return useMemo(() => {
|
|
33
|
-
try {
|
|
34
|
-
return new URL(getSchemeUri()).searchParams.get("referrer");
|
|
35
|
-
} catch {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
}, []);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// src/native-modules/tossCore.ts
|
|
42
|
-
import { NativeModules as NativeModules2 } from "react-native";
|
|
43
|
-
|
|
44
|
-
// src/native-modules/AppsInTossModule.ts
|
|
45
|
-
import { NativeModules } from "react-native";
|
|
46
|
-
var AppsInTossModuleInstance = NativeModules.AppsInTossModule;
|
|
47
|
-
var AppsInTossModule = AppsInTossModuleInstance;
|
|
48
|
-
|
|
49
|
-
// src/native-modules/getOperationalEnvironment.ts
|
|
50
|
-
function getOperationalEnvironment() {
|
|
51
|
-
return AppsInTossModule.operationalEnvironment;
|
|
52
|
-
}
|
|
53
12
|
|
|
54
|
-
//
|
|
13
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/dist/index.js
|
|
14
|
+
import { GraniteEvent } from "@granite-js/react-native";
|
|
15
|
+
import { GraniteEventDefinition } from "@granite-js/react-native";
|
|
16
|
+
import { GraniteEventDefinition as GraniteEventDefinition2 } from "@granite-js/react-native";
|
|
17
|
+
import { TurboModuleRegistry } from "react-native";
|
|
18
|
+
import { NativeEventEmitter } from "react-native";
|
|
19
|
+
import { GraniteEventDefinition as GraniteEventDefinition3 } from "@granite-js/react-native";
|
|
20
|
+
import { GraniteEventDefinition as GraniteEventDefinition4 } from "@granite-js/react-native";
|
|
55
21
|
import { Platform } from "react-native";
|
|
56
22
|
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
var isWildcard = (val) => ["*", "x", "X"].includes(val);
|
|
60
|
-
var tryParse = (val) => {
|
|
61
|
-
const num = parseInt(val, 10);
|
|
62
|
-
return isNaN(num) ? val : num;
|
|
63
|
-
};
|
|
64
|
-
var coerceTypes = (a, b) => {
|
|
65
|
-
return typeof a === typeof b ? [a, b] : [String(a), String(b)];
|
|
66
|
-
};
|
|
67
|
-
var compareValues = (a, b) => {
|
|
68
|
-
if (isWildcard(a) || isWildcard(b)) {
|
|
69
|
-
return 0;
|
|
70
|
-
}
|
|
71
|
-
const [aVal, bVal] = coerceTypes(tryParse(a), tryParse(b));
|
|
72
|
-
if (aVal > bVal) {
|
|
73
|
-
return 1;
|
|
74
|
-
}
|
|
75
|
-
if (aVal < bVal) {
|
|
76
|
-
return -1;
|
|
77
|
-
}
|
|
78
|
-
return 0;
|
|
79
|
-
};
|
|
80
|
-
var parseVersion = (version) => {
|
|
81
|
-
if (typeof version !== "string") {
|
|
82
|
-
throw new TypeError("Invalid argument: expected a string");
|
|
83
|
-
}
|
|
84
|
-
const match = version.match(SEMVER_REGEX);
|
|
85
|
-
if (!match) {
|
|
86
|
-
throw new Error(`Invalid semver: '${version}'`);
|
|
87
|
-
}
|
|
88
|
-
const [, major, minor, patch, build, preRelease] = match;
|
|
89
|
-
return [major, minor, patch, build, preRelease];
|
|
90
|
-
};
|
|
91
|
-
var compareSegments = (a, b) => {
|
|
92
|
-
const maxLength = Math.max(a.length, b.length);
|
|
93
|
-
for (let i = 0; i < maxLength; i++) {
|
|
94
|
-
const segA = a[i] ?? "0";
|
|
95
|
-
const segB = b[i] ?? "0";
|
|
96
|
-
const result = compareValues(segA, segB);
|
|
97
|
-
if (result !== 0) {
|
|
98
|
-
return result;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return 0;
|
|
102
|
-
};
|
|
103
|
-
var compareVersions = (v1, v2) => {
|
|
104
|
-
const seg1 = parseVersion(v1);
|
|
105
|
-
const seg2 = parseVersion(v2);
|
|
106
|
-
const preRelease1 = seg1.pop();
|
|
107
|
-
const preRelease2 = seg2.pop();
|
|
108
|
-
const mainCompare = compareSegments(seg1, seg2);
|
|
109
|
-
if (mainCompare !== 0) {
|
|
110
|
-
return mainCompare;
|
|
111
|
-
}
|
|
112
|
-
if (preRelease1 && preRelease2) {
|
|
113
|
-
return compareSegments(preRelease1.split("."), preRelease2.split("."));
|
|
114
|
-
}
|
|
115
|
-
if (preRelease1) {
|
|
116
|
-
return -1;
|
|
117
|
-
}
|
|
118
|
-
if (preRelease2) {
|
|
119
|
-
return 1;
|
|
120
|
-
}
|
|
121
|
-
return 0;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
// src/native-modules/isMinVersionSupported.ts
|
|
125
|
-
function isMinVersionSupported(minVersions) {
|
|
126
|
-
const operationalEnvironment2 = AppsInTossModule.operationalEnvironment;
|
|
127
|
-
if (operationalEnvironment2 === "sandbox") {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
const currentVersion = AppsInTossModule.tossAppVersion;
|
|
131
|
-
const isIOS = Platform.OS === "ios";
|
|
132
|
-
const minVersion = isIOS ? minVersions.ios : minVersions.android;
|
|
133
|
-
if (minVersion === void 0) {
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
if (minVersion === "always") {
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
if (minVersion === "never") {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
return compareVersions(currentVersion, minVersion) >= 0;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// src/native-modules/tossCore.ts
|
|
146
|
-
var TossCoreModule = NativeModules2.TossCoreModule;
|
|
147
|
-
function tossCoreEventLog(params) {
|
|
148
|
-
const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
|
|
149
|
-
const isSandbox = getOperationalEnvironment() === "sandbox";
|
|
150
|
-
if (!supported || isSandbox) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
TossCoreModule.eventLog({
|
|
154
|
-
params: {
|
|
155
|
-
log_name: params.log_name,
|
|
156
|
-
log_type: params.log_type,
|
|
157
|
-
params: params.params
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// src/utils/isPrivateScheme.ts
|
|
163
|
-
import { getSchemeUri as getSchemeUri2 } from "react-native-bedrock";
|
|
164
|
-
function isPrivateScheme() {
|
|
165
|
-
try {
|
|
166
|
-
return new URL(getSchemeUri2()).protocol === "intoss-private:";
|
|
167
|
-
} catch {
|
|
168
|
-
return false;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// src/hooks/useCaptureExitLog.ts
|
|
173
|
-
var EXIT_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__stay_time";
|
|
174
|
-
var EXIT_IMPRESSION_SCHEMA_ID = 1631628;
|
|
175
|
-
function useCaptureExitLog() {
|
|
176
|
-
const referrer = useReferrer();
|
|
177
|
-
const visible = useVisibility();
|
|
178
|
-
const enterTime = useRef(void 0);
|
|
179
|
-
useEffect(() => {
|
|
180
|
-
if (visible === true) {
|
|
181
|
-
enterTime.current = Date.now();
|
|
182
|
-
}
|
|
183
|
-
}, [visible]);
|
|
184
|
-
const captureExitLog = useCallback(
|
|
185
|
-
(exitTime) => {
|
|
186
|
-
if (enterTime.current == null) {
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
const stayTime = Math.floor(exitTime - enterTime.current);
|
|
190
|
-
tossCoreEventLog({
|
|
191
|
-
log_name: EXIT_IMPRESSION_LOG_NAME,
|
|
192
|
-
log_type: "event",
|
|
193
|
-
params: {
|
|
194
|
-
schema_id: EXIT_IMPRESSION_SCHEMA_ID,
|
|
195
|
-
event_type: "impression",
|
|
196
|
-
referrer,
|
|
197
|
-
deployment_id: env.getDeploymentId(),
|
|
198
|
-
app_name: Bedrock.appName,
|
|
199
|
-
is_private: isPrivateScheme(),
|
|
200
|
-
stay_time: stayTime.toString(),
|
|
201
|
-
exit_time: exitTime.toString()
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
enterTime.current = void 0;
|
|
205
|
-
},
|
|
206
|
-
[referrer]
|
|
207
|
-
);
|
|
208
|
-
return { captureExitLog };
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// src/core/components/AppEvent.tsx
|
|
212
|
-
var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
|
|
213
|
-
function EntryAppEvent() {
|
|
214
|
-
const referrer = useReferrer() ?? "";
|
|
215
|
-
useEffect2(() => {
|
|
216
|
-
tossCoreEventLog({
|
|
217
|
-
log_name: "appsintoss_app_visit::impression__enter_appsintoss",
|
|
218
|
-
log_type: "info",
|
|
219
|
-
params: {
|
|
220
|
-
is_transform: true,
|
|
221
|
-
schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
|
|
222
|
-
referrer,
|
|
223
|
-
deployment_id: env.getDeploymentId(),
|
|
224
|
-
app_name: Bedrock2.appName,
|
|
225
|
-
is_private: isPrivateScheme()
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}, [referrer]);
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
function SystemAppEvent({ ...initialProps }) {
|
|
232
|
-
useEffect2(() => {
|
|
233
|
-
tossCoreEventLog({
|
|
234
|
-
log_name: "AppsInTossInitialProps",
|
|
235
|
-
log_type: "debug",
|
|
236
|
-
params: {
|
|
237
|
-
...initialProps,
|
|
238
|
-
schemeUri: getSchemeUri3(),
|
|
239
|
-
deployment_id: env.getDeploymentId(),
|
|
240
|
-
app_name: Bedrock2.appName,
|
|
241
|
-
is_private: isPrivateScheme()
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
}, [initialProps]);
|
|
245
|
-
return null;
|
|
246
|
-
}
|
|
247
|
-
function StayTimeAppEvent() {
|
|
248
|
-
const visible = useVisibility2();
|
|
249
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
250
|
-
useEffect2(() => {
|
|
251
|
-
if (visible === false) {
|
|
252
|
-
captureExitLog(Date.now());
|
|
253
|
-
}
|
|
254
|
-
}, [visible, captureExitLog]);
|
|
255
|
-
return null;
|
|
23
|
+
// ../../.yarn/cache/es-toolkit-npm-1.39.3-b94f623c91-1c85e518b1.zip/node_modules/es-toolkit/dist/function/noop.mjs
|
|
24
|
+
function noop() {
|
|
256
25
|
}
|
|
257
|
-
var AppEvent = {
|
|
258
|
-
Entry: EntryAppEvent,
|
|
259
|
-
System: SystemAppEvent,
|
|
260
|
-
StayTime: StayTimeAppEvent
|
|
261
|
-
};
|
|
262
26
|
|
|
263
|
-
//
|
|
264
|
-
import {
|
|
265
|
-
import {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
import {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
var EntryMessageExitedEvent = class extends BedrockEventDefinition {
|
|
27
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/dist/index.js
|
|
28
|
+
import { openURL } from "@granite-js/react-native";
|
|
29
|
+
import { NativeModules } from "react-native";
|
|
30
|
+
import { Platform as Platform2 } from "react-native";
|
|
31
|
+
import { Linking } from "react-native";
|
|
32
|
+
import { Platform as Platform3 } from "react-native";
|
|
33
|
+
import { NativeModules as NativeModules2 } from "react-native";
|
|
34
|
+
import { NativeModules as NativeModules3 } from "react-native";
|
|
35
|
+
var EntryMessageExitedEvent = class extends GraniteEventDefinition {
|
|
273
36
|
name = "entryMessageExited";
|
|
274
37
|
remove() {
|
|
275
38
|
}
|
|
@@ -277,21 +40,15 @@ var EntryMessageExitedEvent = class extends BedrockEventDefinition {
|
|
|
277
40
|
listener(_) {
|
|
278
41
|
}
|
|
279
42
|
};
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
// src/native-modules/getPermission.ts
|
|
43
|
+
var Module = TurboModuleRegistry.getEnforcing("AppsInTossModule");
|
|
44
|
+
var AppsInTossModuleInstance = Module;
|
|
45
|
+
var AppsInTossModule = Module;
|
|
285
46
|
function getPermission(permission) {
|
|
286
47
|
return AppsInTossModule.getPermission(permission);
|
|
287
48
|
}
|
|
288
|
-
|
|
289
|
-
// src/native-modules/openPermissionDialog.ts
|
|
290
49
|
function openPermissionDialog(permission) {
|
|
291
50
|
return AppsInTossModule.openPermissionDialog(permission);
|
|
292
51
|
}
|
|
293
|
-
|
|
294
|
-
// src/native-modules/requestPermission.ts
|
|
295
52
|
async function requestPermission(permission) {
|
|
296
53
|
const permissionStatus = await getPermission(permission);
|
|
297
54
|
switch (permissionStatus) {
|
|
@@ -302,13 +59,8 @@ async function requestPermission(permission) {
|
|
|
302
59
|
return openPermissionDialog(permission);
|
|
303
60
|
}
|
|
304
61
|
}
|
|
305
|
-
|
|
306
|
-
// src/native-event-emitter/nativeEventEmitter.ts
|
|
307
|
-
import { NativeEventEmitter } from "react-native";
|
|
308
62
|
var nativeEventEmitter = new NativeEventEmitter(AppsInTossModuleInstance);
|
|
309
|
-
|
|
310
|
-
// src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
311
|
-
var UpdateLocationEvent = class extends BedrockEventDefinition2 {
|
|
63
|
+
var UpdateLocationEvent = class extends GraniteEventDefinition2 {
|
|
312
64
|
name = "updateLocationEvent";
|
|
313
65
|
subscriptionCount = 0;
|
|
314
66
|
ref = {
|
|
@@ -336,16 +88,9 @@ var UpdateLocationEvent = class extends BedrockEventDefinition2 {
|
|
|
336
88
|
}).catch(onError);
|
|
337
89
|
}
|
|
338
90
|
};
|
|
339
|
-
|
|
340
|
-
// src/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
341
|
-
import { BedrockEventDefinition as BedrockEventDefinition3 } from "react-native-bedrock";
|
|
342
|
-
|
|
343
|
-
// src/utils/generateUUID.ts
|
|
344
91
|
function generateUUID(placeholder) {
|
|
345
92
|
return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
|
|
346
93
|
}
|
|
347
|
-
|
|
348
|
-
// src/native-event-emitter/internal/appBridge.ts
|
|
349
94
|
var INTERNAL__callbacks = /* @__PURE__ */ new Map();
|
|
350
95
|
function invokeAppBridgeCallback(id, ...args) {
|
|
351
96
|
const callback = INTERNAL__callbacks.get(id);
|
|
@@ -392,10 +137,8 @@ var INTERNAL__appBridgeHandler = {
|
|
|
392
137
|
unregisterCallback,
|
|
393
138
|
getCallbackIds
|
|
394
139
|
};
|
|
395
|
-
|
|
396
|
-
// src/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
397
140
|
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
398
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends
|
|
141
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventDefinition3 {
|
|
399
142
|
static INTERNAL__appBridgeSubscription;
|
|
400
143
|
name = "appBridgeCallbackEvent";
|
|
401
144
|
constructor() {
|
|
@@ -423,10 +166,7 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends BedrockEventD
|
|
|
423
166
|
}
|
|
424
167
|
}
|
|
425
168
|
};
|
|
426
|
-
|
|
427
|
-
// src/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
428
|
-
import { BedrockEventDefinition as BedrockEventDefinition4 } from "react-native-bedrock";
|
|
429
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends BedrockEventDefinition4 {
|
|
169
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDefinition4 {
|
|
430
170
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
431
171
|
subscription = null;
|
|
432
172
|
remove() {
|
|
@@ -449,24 +189,663 @@ var VisibilityChangedByTransparentServiceWebEvent = class extends BedrockEventDe
|
|
|
449
189
|
return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
|
|
450
190
|
}
|
|
451
191
|
};
|
|
452
|
-
|
|
453
|
-
// src/native-event-emitter/appsInTossEvent.ts
|
|
454
|
-
var appsInTossEvent = new BedrockEvent([
|
|
192
|
+
var appsInTossEvent = new GraniteEvent([
|
|
455
193
|
new UpdateLocationEvent(),
|
|
456
194
|
new EntryMessageExitedEvent(),
|
|
457
195
|
// Internal events
|
|
458
196
|
new AppBridgeCallbackEvent(),
|
|
459
197
|
new VisibilityChangedByTransparentServiceWebEvent()
|
|
460
198
|
]);
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
function getAppsInTossGlobals() {
|
|
464
|
-
if (global.__appsInToss == null) {
|
|
465
|
-
throw new Error("invalid apps-in-toss globals");
|
|
466
|
-
}
|
|
467
|
-
return global.__appsInToss;
|
|
199
|
+
function startUpdateLocation(eventParams) {
|
|
200
|
+
return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
|
|
468
201
|
}
|
|
469
|
-
|
|
202
|
+
var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
|
|
203
|
+
var isWildcard = (val) => ["*", "x", "X"].includes(val);
|
|
204
|
+
var tryParse = (val) => {
|
|
205
|
+
const num = parseInt(val, 10);
|
|
206
|
+
return isNaN(num) ? val : num;
|
|
207
|
+
};
|
|
208
|
+
var coerceTypes = (a, b) => {
|
|
209
|
+
return typeof a === typeof b ? [a, b] : [String(a), String(b)];
|
|
210
|
+
};
|
|
211
|
+
var compareValues = (a, b) => {
|
|
212
|
+
if (isWildcard(a) || isWildcard(b)) {
|
|
213
|
+
return 0;
|
|
214
|
+
}
|
|
215
|
+
const [aVal, bVal] = coerceTypes(tryParse(a), tryParse(b));
|
|
216
|
+
if (aVal > bVal) {
|
|
217
|
+
return 1;
|
|
218
|
+
}
|
|
219
|
+
if (aVal < bVal) {
|
|
220
|
+
return -1;
|
|
221
|
+
}
|
|
222
|
+
return 0;
|
|
223
|
+
};
|
|
224
|
+
var parseVersion = (version) => {
|
|
225
|
+
if (typeof version !== "string") {
|
|
226
|
+
throw new TypeError("Invalid argument: expected a string");
|
|
227
|
+
}
|
|
228
|
+
const match = version.match(SEMVER_REGEX);
|
|
229
|
+
if (!match) {
|
|
230
|
+
throw new Error(`Invalid semver: '${version}'`);
|
|
231
|
+
}
|
|
232
|
+
const [, major, minor, patch, build, preRelease] = match;
|
|
233
|
+
return [major, minor, patch, build, preRelease];
|
|
234
|
+
};
|
|
235
|
+
var compareSegments = (a, b) => {
|
|
236
|
+
const maxLength = Math.max(a.length, b.length);
|
|
237
|
+
for (let i = 0; i < maxLength; i++) {
|
|
238
|
+
const segA = a[i] ?? "0";
|
|
239
|
+
const segB = b[i] ?? "0";
|
|
240
|
+
const result = compareValues(segA, segB);
|
|
241
|
+
if (result !== 0) {
|
|
242
|
+
return result;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return 0;
|
|
246
|
+
};
|
|
247
|
+
var compareVersions = (v1, v2) => {
|
|
248
|
+
const seg1 = parseVersion(v1);
|
|
249
|
+
const seg2 = parseVersion(v2);
|
|
250
|
+
const preRelease1 = seg1.pop();
|
|
251
|
+
const preRelease2 = seg2.pop();
|
|
252
|
+
const mainCompare = compareSegments(seg1, seg2);
|
|
253
|
+
if (mainCompare !== 0) {
|
|
254
|
+
return mainCompare;
|
|
255
|
+
}
|
|
256
|
+
if (preRelease1 && preRelease2) {
|
|
257
|
+
return compareSegments(preRelease1.split("."), preRelease2.split("."));
|
|
258
|
+
}
|
|
259
|
+
if (preRelease1) {
|
|
260
|
+
return -1;
|
|
261
|
+
}
|
|
262
|
+
if (preRelease2) {
|
|
263
|
+
return 1;
|
|
264
|
+
}
|
|
265
|
+
return 0;
|
|
266
|
+
};
|
|
267
|
+
function isMinVersionSupported(minVersions) {
|
|
268
|
+
const operationalEnvironment2 = AppsInTossModule.operationalEnvironment;
|
|
269
|
+
if (operationalEnvironment2 === "sandbox") {
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
const currentVersion = AppsInTossModule.tossAppVersion;
|
|
273
|
+
const isIOS = Platform.OS === "ios";
|
|
274
|
+
const minVersion = isIOS ? minVersions.ios : minVersions.android;
|
|
275
|
+
if (minVersion === void 0) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
if (minVersion === "always") {
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
if (minVersion === "never") {
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
return compareVersions(currentVersion, minVersion) >= 0;
|
|
285
|
+
}
|
|
286
|
+
function contactsViral(params) {
|
|
287
|
+
const isSupported = isMinVersionSupported({
|
|
288
|
+
android: "5.223.0",
|
|
289
|
+
ios: "5.223.0"
|
|
290
|
+
});
|
|
291
|
+
if (!isSupported) {
|
|
292
|
+
return () => {
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
const { onEvent, onError, options } = params;
|
|
296
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("contactsViral", options, {
|
|
297
|
+
onRewardFromContactsViral: (result) => {
|
|
298
|
+
onEvent({ type: "sendViral", data: result });
|
|
299
|
+
},
|
|
300
|
+
onSuccess: (result) => {
|
|
301
|
+
onEvent({ type: "close", data: result });
|
|
302
|
+
},
|
|
303
|
+
onError
|
|
304
|
+
});
|
|
305
|
+
return unregisterCallbacks;
|
|
306
|
+
}
|
|
307
|
+
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
308
|
+
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
309
|
+
}
|
|
310
|
+
function getOperationalEnvironment() {
|
|
311
|
+
return AppsInTossModule.operationalEnvironment;
|
|
312
|
+
}
|
|
313
|
+
function loadAdMobInterstitialAd(params) {
|
|
314
|
+
if (!loadAdMobInterstitialAd.isSupported()) {
|
|
315
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
316
|
+
return noop;
|
|
317
|
+
}
|
|
318
|
+
const { onEvent, onError, options } = params;
|
|
319
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobInterstitialAd", options, {
|
|
320
|
+
onAdClicked: () => {
|
|
321
|
+
onEvent({ type: "clicked" });
|
|
322
|
+
},
|
|
323
|
+
onAdDismissed: () => {
|
|
324
|
+
onEvent({ type: "dismissed" });
|
|
325
|
+
},
|
|
326
|
+
onAdFailedToShow: () => {
|
|
327
|
+
onEvent({ type: "failedToShow" });
|
|
328
|
+
},
|
|
329
|
+
onAdImpression: () => {
|
|
330
|
+
onEvent({ type: "impression" });
|
|
331
|
+
},
|
|
332
|
+
onAdShow: () => {
|
|
333
|
+
onEvent({ type: "show" });
|
|
334
|
+
},
|
|
335
|
+
onSuccess: (result) => onEvent({ type: "loaded", data: result }),
|
|
336
|
+
onError
|
|
337
|
+
});
|
|
338
|
+
return unregisterCallbacks;
|
|
339
|
+
}
|
|
340
|
+
function showAdMobInterstitialAd(params) {
|
|
341
|
+
if (!showAdMobInterstitialAd.isSupported()) {
|
|
342
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
343
|
+
return noop;
|
|
344
|
+
}
|
|
345
|
+
const { onEvent, onError, options } = params;
|
|
346
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobInterstitialAd", options, {
|
|
347
|
+
onSuccess: () => onEvent({ type: "requested" }),
|
|
348
|
+
onError
|
|
349
|
+
});
|
|
350
|
+
return unregisterCallbacks;
|
|
351
|
+
}
|
|
352
|
+
function loadAdMobRewardedAd(params) {
|
|
353
|
+
if (!loadAdMobRewardedAd.isSupported()) {
|
|
354
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
355
|
+
return noop;
|
|
356
|
+
}
|
|
357
|
+
const { onEvent, onError, options } = params;
|
|
358
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobRewardedAd", options, {
|
|
359
|
+
onAdClicked: () => {
|
|
360
|
+
onEvent({ type: "clicked" });
|
|
361
|
+
},
|
|
362
|
+
onAdDismissed: () => {
|
|
363
|
+
onEvent({ type: "dismissed" });
|
|
364
|
+
},
|
|
365
|
+
onAdFailedToShow: () => {
|
|
366
|
+
onEvent({ type: "failedToShow" });
|
|
367
|
+
},
|
|
368
|
+
onAdImpression: () => {
|
|
369
|
+
onEvent({ type: "impression" });
|
|
370
|
+
},
|
|
371
|
+
onAdShow: () => {
|
|
372
|
+
onEvent({ type: "show" });
|
|
373
|
+
},
|
|
374
|
+
onUserEarnedReward: () => {
|
|
375
|
+
onEvent({ type: "userEarnedReward" });
|
|
376
|
+
},
|
|
377
|
+
onSuccess: (result) => onEvent({ type: "loaded", data: result }),
|
|
378
|
+
onError
|
|
379
|
+
});
|
|
380
|
+
return unregisterCallbacks;
|
|
381
|
+
}
|
|
382
|
+
function showAdMobRewardedAd(params) {
|
|
383
|
+
if (!showAdMobRewardedAd.isSupported()) {
|
|
384
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
385
|
+
return noop;
|
|
386
|
+
}
|
|
387
|
+
const { onEvent, onError, options } = params;
|
|
388
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobRewardedAd", options, {
|
|
389
|
+
onSuccess: () => onEvent({ type: "requested" }),
|
|
390
|
+
onError
|
|
391
|
+
});
|
|
392
|
+
return unregisterCallbacks;
|
|
393
|
+
}
|
|
394
|
+
var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
|
|
395
|
+
var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
|
|
396
|
+
var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
|
|
397
|
+
var ENVIRONMENT = getOperationalEnvironment();
|
|
398
|
+
function createIsSupported() {
|
|
399
|
+
return () => {
|
|
400
|
+
if (ENVIRONMENT !== "toss") {
|
|
401
|
+
return false;
|
|
402
|
+
}
|
|
403
|
+
return isMinVersionSupported({
|
|
404
|
+
android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION,
|
|
405
|
+
ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
loadAdMobInterstitialAd.isSupported = createIsSupported();
|
|
410
|
+
loadAdMobRewardedAd.isSupported = createIsSupported();
|
|
411
|
+
showAdMobInterstitialAd.isSupported = createIsSupported();
|
|
412
|
+
showAdMobRewardedAd.isSupported = createIsSupported();
|
|
413
|
+
async function checkoutPayment(options) {
|
|
414
|
+
return AppsInTossModule.checkoutPayment({ params: options });
|
|
415
|
+
}
|
|
416
|
+
async function appLogin() {
|
|
417
|
+
return AppsInTossModule.appLogin({});
|
|
418
|
+
}
|
|
419
|
+
function normalizeParams(params) {
|
|
420
|
+
return Object.fromEntries(
|
|
421
|
+
Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
async function eventLog(params) {
|
|
425
|
+
if (AppsInTossModule.operationalEnvironment === "sandbox") {
|
|
426
|
+
console.log("[eventLogDebug]", {
|
|
427
|
+
log_name: params.log_name,
|
|
428
|
+
log_type: params.log_type,
|
|
429
|
+
params: normalizeParams(params.params)
|
|
430
|
+
});
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
const isSupported = isMinVersionSupported({
|
|
434
|
+
android: "5.208.0",
|
|
435
|
+
ios: "5.208.0"
|
|
436
|
+
});
|
|
437
|
+
if (!isSupported) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
return AppsInTossModule.eventLog({
|
|
441
|
+
log_name: params.log_name,
|
|
442
|
+
log_type: params.log_type,
|
|
443
|
+
params: normalizeParams(params.params)
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
var DEFAULT_MAX_COUNT = 10;
|
|
447
|
+
var DEFAULT_MAX_WIDTH = 1024;
|
|
448
|
+
async function fetchAlbumPhotos(options) {
|
|
449
|
+
const permissionStatus = await requestPermission({ name: "photos", access: "read" });
|
|
450
|
+
if (permissionStatus === "denied") {
|
|
451
|
+
throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
452
|
+
}
|
|
453
|
+
const albumPhotos = await AppsInTossModule.fetchAlbumPhotos({
|
|
454
|
+
...options,
|
|
455
|
+
maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
|
|
456
|
+
maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
|
|
457
|
+
});
|
|
458
|
+
return albumPhotos;
|
|
459
|
+
}
|
|
460
|
+
async function fetchContacts(options) {
|
|
461
|
+
const permissionStatus = await requestPermission({ name: "contacts", access: "read" });
|
|
462
|
+
if (permissionStatus === "denied") {
|
|
463
|
+
throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
464
|
+
}
|
|
465
|
+
const contacts = await AppsInTossModule.fetchContacts(options);
|
|
466
|
+
return {
|
|
467
|
+
result: contacts.result,
|
|
468
|
+
nextOffset: contacts.nextOffset ?? null,
|
|
469
|
+
done: contacts.done
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
async function getClipboardText() {
|
|
473
|
+
const permissionStatus = await requestPermission({ name: "clipboard", access: "read" });
|
|
474
|
+
if (permissionStatus === "denied") {
|
|
475
|
+
throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
476
|
+
}
|
|
477
|
+
return AppsInTossModule.getClipboardText({});
|
|
478
|
+
}
|
|
479
|
+
async function getCurrentLocation(options) {
|
|
480
|
+
const permissionStatus = await requestPermission({ name: "geolocation", access: "access" });
|
|
481
|
+
if (permissionStatus === "denied") {
|
|
482
|
+
throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
483
|
+
}
|
|
484
|
+
const position = await AppsInTossModule.getCurrentLocation(options);
|
|
485
|
+
return position;
|
|
486
|
+
}
|
|
487
|
+
function getDeviceId() {
|
|
488
|
+
return AppsInTossModule.deviceId;
|
|
489
|
+
}
|
|
490
|
+
function getTossAppVersion() {
|
|
491
|
+
return AppsInTossModule.tossAppVersion;
|
|
492
|
+
}
|
|
493
|
+
async function getTossShareLink(path) {
|
|
494
|
+
const { shareLink } = await AppsInTossModule.getTossShareLink({});
|
|
495
|
+
const shareUrl = new URL(shareLink);
|
|
496
|
+
shareUrl.searchParams.set("deep_link_value", path);
|
|
497
|
+
shareUrl.searchParams.set("af_dp", path);
|
|
498
|
+
return shareUrl.toString();
|
|
499
|
+
}
|
|
500
|
+
async function createOneTimePurchaseOrder(params) {
|
|
501
|
+
const isSupported = isMinVersionSupported({
|
|
502
|
+
android: "5.219.0",
|
|
503
|
+
ios: "5.219.0"
|
|
504
|
+
});
|
|
505
|
+
if (!isSupported) {
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
return AppsInTossModule.iapCreateOneTimePurchaseOrder(params);
|
|
509
|
+
}
|
|
510
|
+
async function getProductItemList() {
|
|
511
|
+
const isSupported = isMinVersionSupported({
|
|
512
|
+
android: "5.219.0",
|
|
513
|
+
ios: "5.219.0"
|
|
514
|
+
});
|
|
515
|
+
if (!isSupported) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
return AppsInTossModule.iapGetProductItemList({});
|
|
519
|
+
}
|
|
520
|
+
var IAP = {
|
|
521
|
+
createOneTimePurchaseOrder,
|
|
522
|
+
getProductItemList
|
|
523
|
+
};
|
|
524
|
+
async function openCamera(options) {
|
|
525
|
+
const permissionStatus = await requestPermission({ name: "camera", access: "access" });
|
|
526
|
+
if (permissionStatus === "denied") {
|
|
527
|
+
throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
528
|
+
}
|
|
529
|
+
const photo = await AppsInTossModule.openCamera({ base64: false, maxWidth: 1024, ...options });
|
|
530
|
+
return photo;
|
|
531
|
+
}
|
|
532
|
+
async function saveBase64Data(params) {
|
|
533
|
+
const isSupported = isMinVersionSupported({
|
|
534
|
+
android: "5.218.0",
|
|
535
|
+
ios: "5.216.0"
|
|
536
|
+
});
|
|
537
|
+
if (!isSupported) {
|
|
538
|
+
console.warn("saveBase64Data is not supported in this app version");
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
await AppsInTossModule.saveBase64Data(params);
|
|
542
|
+
}
|
|
543
|
+
async function setClipboardText(text) {
|
|
544
|
+
const permissionStatus = await requestPermission({ name: "clipboard", access: "write" });
|
|
545
|
+
if (permissionStatus === "denied") {
|
|
546
|
+
throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
547
|
+
}
|
|
548
|
+
return AppsInTossModule.setClipboardText({ text });
|
|
549
|
+
}
|
|
550
|
+
async function setDeviceOrientation(options) {
|
|
551
|
+
const isSupported = isMinVersionSupported({
|
|
552
|
+
android: "5.215.0",
|
|
553
|
+
ios: "5.215.0"
|
|
554
|
+
});
|
|
555
|
+
if (!isSupported) {
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
return AppsInTossModule.setDeviceOrientation(options);
|
|
559
|
+
}
|
|
560
|
+
function getItem(key) {
|
|
561
|
+
return AppsInTossModule.getStorageItem({ key });
|
|
562
|
+
}
|
|
563
|
+
function setItem(key, value) {
|
|
564
|
+
return AppsInTossModule.setStorageItem({
|
|
565
|
+
key,
|
|
566
|
+
value
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
function removeItem(key) {
|
|
570
|
+
return AppsInTossModule.removeStorageItem({ key });
|
|
571
|
+
}
|
|
572
|
+
function clearItems() {
|
|
573
|
+
return AppsInTossModule.clearStorage({});
|
|
574
|
+
}
|
|
575
|
+
var Storage = {
|
|
576
|
+
getItem,
|
|
577
|
+
setItem,
|
|
578
|
+
removeItem,
|
|
579
|
+
clearItems
|
|
580
|
+
};
|
|
581
|
+
var GAME_CENTER_MIN_VERSION = {
|
|
582
|
+
android: "5.221.0",
|
|
583
|
+
ios: "5.221.0"
|
|
584
|
+
};
|
|
585
|
+
async function openGameCenterLeaderboard() {
|
|
586
|
+
if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
const appName = global.__granite?.app?.name;
|
|
590
|
+
if (appName == null) {
|
|
591
|
+
throw new Error("Cannot get app name");
|
|
592
|
+
}
|
|
593
|
+
const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
|
|
594
|
+
url.searchParams.set("appName", appName);
|
|
595
|
+
url.searchParams.set("referrer", `appsintoss.${appName}`);
|
|
596
|
+
return openURL(url.toString());
|
|
597
|
+
}
|
|
598
|
+
async function getGameCenterGameProfile() {
|
|
599
|
+
const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
|
|
600
|
+
if (!isSupported) {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
return AppsInTossModule.getGameCenterGameProfile({});
|
|
604
|
+
}
|
|
605
|
+
async function submitGameCenterLeaderBoardScore(params) {
|
|
606
|
+
const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
|
|
607
|
+
if (!isSupported) {
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
return AppsInTossModule.submitGameCenterLeaderBoardScore(params);
|
|
611
|
+
}
|
|
612
|
+
var TossPay = {
|
|
613
|
+
checkoutPayment
|
|
614
|
+
};
|
|
615
|
+
var GoogleAdMob = {
|
|
616
|
+
loadAdMobInterstitialAd,
|
|
617
|
+
showAdMobInterstitialAd,
|
|
618
|
+
loadAdMobRewardedAd,
|
|
619
|
+
showAdMobRewardedAd
|
|
620
|
+
};
|
|
621
|
+
var BedrockModule = NativeModules.BedrockModule;
|
|
622
|
+
async function closeView() {
|
|
623
|
+
return BedrockModule.closeView();
|
|
624
|
+
}
|
|
625
|
+
function getLocale() {
|
|
626
|
+
const locale = BedrockModule?.DeviceInfo?.locale ?? "ko-KR";
|
|
627
|
+
if (Platform2.OS === "android") {
|
|
628
|
+
return replaceUnderbarToHypen(locale);
|
|
629
|
+
}
|
|
630
|
+
return locale;
|
|
631
|
+
}
|
|
632
|
+
function replaceUnderbarToHypen(locale) {
|
|
633
|
+
return locale.replace(/_/g, "-");
|
|
634
|
+
}
|
|
635
|
+
function getSchemeUri() {
|
|
636
|
+
return BedrockModule.schemeUri;
|
|
637
|
+
}
|
|
638
|
+
function generateHapticFeedback(options) {
|
|
639
|
+
return BedrockModule.generateHapticFeedback(options);
|
|
640
|
+
}
|
|
641
|
+
async function share(message) {
|
|
642
|
+
BedrockModule.share(message);
|
|
643
|
+
}
|
|
644
|
+
function setSecureScreen(options) {
|
|
645
|
+
return BedrockModule.setSecureScreen(options);
|
|
646
|
+
}
|
|
647
|
+
async function setScreenAwakeMode(options) {
|
|
648
|
+
return BedrockModule.setScreenAwakeMode(options);
|
|
649
|
+
}
|
|
650
|
+
function getNetworkStatus() {
|
|
651
|
+
return BedrockModule.getNetworkStatus();
|
|
652
|
+
}
|
|
653
|
+
async function setIosSwipeGestureEnabled(options) {
|
|
654
|
+
if (BedrockModule.setIosSwipeGestureEnabled == null) {
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
return BedrockModule.setIosSwipeGestureEnabled(options);
|
|
658
|
+
}
|
|
659
|
+
function openURL2(url) {
|
|
660
|
+
return Linking.openURL(url);
|
|
661
|
+
}
|
|
662
|
+
function getPlatformOS() {
|
|
663
|
+
return Platform3.OS;
|
|
664
|
+
}
|
|
665
|
+
var BedrockCoreModule = NativeModules2.BedrockCoreModule;
|
|
666
|
+
var Accuracy = /* @__PURE__ */ ((Accuracy2) => {
|
|
667
|
+
Accuracy2[Accuracy2["Lowest"] = 1] = "Lowest";
|
|
668
|
+
Accuracy2[Accuracy2["Low"] = 2] = "Low";
|
|
669
|
+
Accuracy2[Accuracy2["Balanced"] = 3] = "Balanced";
|
|
670
|
+
Accuracy2[Accuracy2["High"] = 4] = "High";
|
|
671
|
+
Accuracy2[Accuracy2["Highest"] = 5] = "Highest";
|
|
672
|
+
Accuracy2[Accuracy2["BestForNavigation"] = 6] = "BestForNavigation";
|
|
673
|
+
return Accuracy2;
|
|
674
|
+
})(Accuracy || {});
|
|
675
|
+
var TossCoreModule = NativeModules3.TossCoreModule;
|
|
676
|
+
function tossCoreEventLog(params) {
|
|
677
|
+
const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
|
|
678
|
+
const isSandbox = getOperationalEnvironment() === "sandbox";
|
|
679
|
+
if (!supported || isSandbox) {
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
TossCoreModule.eventLog({
|
|
683
|
+
params: {
|
|
684
|
+
log_name: params.log_name,
|
|
685
|
+
log_type: params.log_type,
|
|
686
|
+
params: params.params
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
var INTERNAL__module = {
|
|
691
|
+
tossCoreEventLog
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
// src/core/registerApp.tsx
|
|
695
|
+
import { Granite as Granite3 } from "@granite-js/react-native";
|
|
696
|
+
import { TDSProvider } from "@toss-design-system/react-native";
|
|
697
|
+
|
|
698
|
+
// src/core/components/AppEvent.tsx
|
|
699
|
+
import { Granite as Granite2, getSchemeUri as getSchemeUri4, useVisibility as useVisibility2 } from "@granite-js/react-native";
|
|
700
|
+
import { useEffect as useEffect2 } from "react";
|
|
701
|
+
|
|
702
|
+
// src/env.ts
|
|
703
|
+
var env = {
|
|
704
|
+
getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
// src/hooks/useCaptureExitLog.ts
|
|
708
|
+
import { Granite, useVisibility } from "@granite-js/react-native";
|
|
709
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
710
|
+
|
|
711
|
+
// src/core/hooks/useReferrer.ts
|
|
712
|
+
import { getSchemeUri as getSchemeUri2 } from "@granite-js/react-native";
|
|
713
|
+
import { useMemo } from "react";
|
|
714
|
+
function useReferrer() {
|
|
715
|
+
return useMemo(() => {
|
|
716
|
+
try {
|
|
717
|
+
return new URL(getSchemeUri2()).searchParams.get("referrer");
|
|
718
|
+
} catch {
|
|
719
|
+
return null;
|
|
720
|
+
}
|
|
721
|
+
}, []);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// src/utils/isPrivateScheme.ts
|
|
725
|
+
import { getSchemeUri as getSchemeUri3 } from "@granite-js/react-native";
|
|
726
|
+
function isPrivateScheme() {
|
|
727
|
+
try {
|
|
728
|
+
return new URL(getSchemeUri3()).protocol === "intoss-private:";
|
|
729
|
+
} catch {
|
|
730
|
+
return false;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
// src/hooks/useCaptureExitLog.ts
|
|
735
|
+
var EXIT_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__stay_time";
|
|
736
|
+
var EXIT_IMPRESSION_SCHEMA_ID = 1631628;
|
|
737
|
+
function useCaptureExitLog() {
|
|
738
|
+
const referrer = useReferrer();
|
|
739
|
+
const visible = useVisibility();
|
|
740
|
+
const enterTime = useRef(void 0);
|
|
741
|
+
useEffect(() => {
|
|
742
|
+
if (visible === true) {
|
|
743
|
+
enterTime.current = Date.now();
|
|
744
|
+
}
|
|
745
|
+
}, [visible]);
|
|
746
|
+
const captureExitLog = useCallback(
|
|
747
|
+
(exitTime) => {
|
|
748
|
+
if (enterTime.current == null) {
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
const stayTime = Math.floor(exitTime - enterTime.current);
|
|
752
|
+
INTERNAL__module.tossCoreEventLog({
|
|
753
|
+
log_name: EXIT_IMPRESSION_LOG_NAME,
|
|
754
|
+
log_type: "event",
|
|
755
|
+
params: {
|
|
756
|
+
schema_id: EXIT_IMPRESSION_SCHEMA_ID,
|
|
757
|
+
event_type: "impression",
|
|
758
|
+
referrer,
|
|
759
|
+
deployment_id: env.getDeploymentId(),
|
|
760
|
+
app_name: Granite.appName,
|
|
761
|
+
is_private: isPrivateScheme(),
|
|
762
|
+
stay_time: stayTime.toString(),
|
|
763
|
+
exit_time: exitTime.toString()
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
enterTime.current = void 0;
|
|
767
|
+
},
|
|
768
|
+
[referrer]
|
|
769
|
+
);
|
|
770
|
+
return { captureExitLog };
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// src/core/components/AppEvent.tsx
|
|
774
|
+
var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
|
|
775
|
+
function EntryAppEvent() {
|
|
776
|
+
const referrer = useReferrer() ?? "";
|
|
777
|
+
useEffect2(() => {
|
|
778
|
+
INTERNAL__module.tossCoreEventLog({
|
|
779
|
+
log_name: "appsintoss_app_visit::impression__enter_appsintoss",
|
|
780
|
+
log_type: "info",
|
|
781
|
+
params: {
|
|
782
|
+
is_transform: true,
|
|
783
|
+
schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
|
|
784
|
+
referrer,
|
|
785
|
+
deployment_id: env.getDeploymentId(),
|
|
786
|
+
app_name: Granite2.appName,
|
|
787
|
+
is_private: isPrivateScheme()
|
|
788
|
+
}
|
|
789
|
+
});
|
|
790
|
+
}, [referrer]);
|
|
791
|
+
return null;
|
|
792
|
+
}
|
|
793
|
+
function SystemAppEvent({ ...initialProps }) {
|
|
794
|
+
useEffect2(() => {
|
|
795
|
+
INTERNAL__module.tossCoreEventLog({
|
|
796
|
+
log_name: "AppsInTossInitialProps",
|
|
797
|
+
log_type: "debug",
|
|
798
|
+
params: {
|
|
799
|
+
...initialProps,
|
|
800
|
+
schemeUri: getSchemeUri4(),
|
|
801
|
+
deployment_id: env.getDeploymentId(),
|
|
802
|
+
app_name: Granite2.appName,
|
|
803
|
+
is_private: isPrivateScheme()
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
}, [initialProps]);
|
|
807
|
+
return null;
|
|
808
|
+
}
|
|
809
|
+
function StayTimeAppEvent() {
|
|
810
|
+
const visible = useVisibility2();
|
|
811
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
812
|
+
useEffect2(() => {
|
|
813
|
+
if (visible === false) {
|
|
814
|
+
captureExitLog(Date.now());
|
|
815
|
+
}
|
|
816
|
+
}, [visible, captureExitLog]);
|
|
817
|
+
return null;
|
|
818
|
+
}
|
|
819
|
+
var AppEvent = {
|
|
820
|
+
Entry: EntryAppEvent,
|
|
821
|
+
System: SystemAppEvent,
|
|
822
|
+
StayTime: StayTimeAppEvent
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
// src/core/components/AppUpdate.tsx
|
|
826
|
+
import { openURL as openURL3 } from "@granite-js/react-native";
|
|
827
|
+
import { useEffect as useEffect3 } from "react";
|
|
828
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
829
|
+
var UPDATE_SCHEME = "servicetoss://update/forced/j?updateType=required";
|
|
830
|
+
function AppUpdate() {
|
|
831
|
+
useEffect3(() => {
|
|
832
|
+
openURL3(`supertoss://closePage?url=${UPDATE_SCHEME}`);
|
|
833
|
+
}, []);
|
|
834
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
// src/core/hooks/useAppsInTossBridge.ts
|
|
838
|
+
import { useBridge } from "@toss-design-system/react-native";
|
|
839
|
+
import { useEffect as useEffect4 } from "react";
|
|
840
|
+
|
|
841
|
+
// src/core/utils/getAppsInTossGlobals.ts
|
|
842
|
+
function getAppsInTossGlobals() {
|
|
843
|
+
if (global.__appsInToss == null) {
|
|
844
|
+
throw new Error("invalid apps-in-toss globals");
|
|
845
|
+
}
|
|
846
|
+
return global.__appsInToss;
|
|
847
|
+
}
|
|
848
|
+
|
|
470
849
|
// src/core/utils/toIcon.ts
|
|
471
850
|
function toIcon(source) {
|
|
472
851
|
return source.startsWith("http") ? { source: { uri: source } } : { name: source };
|
|
@@ -476,7 +855,7 @@ function toIcon(source) {
|
|
|
476
855
|
function useAppsInTossBridge() {
|
|
477
856
|
const controller = useBridge();
|
|
478
857
|
const appsInTossGlobals2 = getAppsInTossGlobals();
|
|
479
|
-
|
|
858
|
+
useEffect4(() => {
|
|
480
859
|
const commonProps = {
|
|
481
860
|
serviceName: appsInTossGlobals2.brandDisplayName,
|
|
482
861
|
icon: toIcon(appsInTossGlobals2.brandIcon),
|
|
@@ -492,59 +871,135 @@ function useAppsInTossBridge() {
|
|
|
492
871
|
}, []);
|
|
493
872
|
}
|
|
494
873
|
|
|
495
|
-
// src/async-bridges.ts
|
|
874
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/async-bridges.ts
|
|
496
875
|
var async_bridges_exports = {};
|
|
497
876
|
__export(async_bridges_exports, {
|
|
498
|
-
appLogin: () =>
|
|
499
|
-
checkoutPayment: () =>
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
877
|
+
appLogin: () => appLogin2,
|
|
878
|
+
checkoutPayment: () => checkoutPayment2,
|
|
879
|
+
closeView: () => closeView2,
|
|
880
|
+
eventLog: () => eventLog2,
|
|
881
|
+
fetchAlbumPhotos: () => fetchAlbumPhotos2,
|
|
882
|
+
fetchContacts: () => fetchContacts2,
|
|
883
|
+
generateHapticFeedback: () => generateHapticFeedback2,
|
|
884
|
+
getClipboardText: () => getClipboardText2,
|
|
885
|
+
getCurrentLocation: () => getCurrentLocation2,
|
|
886
|
+
getGameCenterGameProfile: () => getGameCenterGameProfile2,
|
|
887
|
+
getNetworkStatus: () => getNetworkStatus2,
|
|
888
|
+
getTossShareLink: () => getTossShareLink2,
|
|
889
|
+
openCamera: () => openCamera2,
|
|
890
|
+
openGameCenterLeaderboard: () => openGameCenterLeaderboard2,
|
|
891
|
+
openURL: () => openURL4,
|
|
892
|
+
saveBase64Data: () => saveBase64Data2,
|
|
893
|
+
setClipboardText: () => setClipboardText2,
|
|
894
|
+
setDeviceOrientation: () => setDeviceOrientation2,
|
|
895
|
+
setIosSwipeGestureEnabled: () => setIosSwipeGestureEnabled2,
|
|
896
|
+
setScreenAwakeMode: () => setScreenAwakeMode2,
|
|
897
|
+
setSecureScreen: () => setSecureScreen2,
|
|
898
|
+
share: () => share2,
|
|
899
|
+
submitGameCenterLeaderBoardScore: () => submitGameCenterLeaderBoardScore2
|
|
513
900
|
});
|
|
514
901
|
|
|
515
|
-
// src/native-modules/
|
|
516
|
-
|
|
517
|
-
|
|
902
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/BedrockModule.ts
|
|
903
|
+
import { NativeModules as NativeModules4 } from "react-native";
|
|
904
|
+
var BedrockModule2 = NativeModules4.BedrockModule;
|
|
905
|
+
|
|
906
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/closeView.ts
|
|
907
|
+
async function closeView2() {
|
|
908
|
+
return BedrockModule2.closeView();
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts
|
|
912
|
+
function generateHapticFeedback2(options) {
|
|
913
|
+
return BedrockModule2.generateHapticFeedback(options);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/share.ts
|
|
917
|
+
async function share2(message) {
|
|
918
|
+
BedrockModule2.share(message);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setSecureScreen.ts
|
|
922
|
+
function setSecureScreen2(options) {
|
|
923
|
+
return BedrockModule2.setSecureScreen(options);
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts
|
|
927
|
+
async function setScreenAwakeMode2(options) {
|
|
928
|
+
return BedrockModule2.setScreenAwakeMode(options);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts
|
|
932
|
+
function getNetworkStatus2() {
|
|
933
|
+
return BedrockModule2.getNetworkStatus();
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts
|
|
937
|
+
async function setIosSwipeGestureEnabled2(options) {
|
|
938
|
+
if (BedrockModule2.setIosSwipeGestureEnabled == null) {
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
return BedrockModule2.setIosSwipeGestureEnabled(options);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/openURL.ts
|
|
945
|
+
import { Linking as Linking2 } from "react-native";
|
|
946
|
+
function openURL4(url) {
|
|
947
|
+
return Linking2.openURL(url);
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
951
|
+
import { TurboModuleRegistry as TurboModuleRegistry2 } from "react-native";
|
|
952
|
+
var Module2 = TurboModuleRegistry2.getEnforcing("AppsInTossModule");
|
|
953
|
+
var AppsInTossModuleInstance2 = Module2;
|
|
954
|
+
var AppsInTossModule2 = Module2;
|
|
955
|
+
|
|
956
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getPermission.ts
|
|
957
|
+
function getPermission2(permission) {
|
|
958
|
+
return AppsInTossModule2.getPermission(permission);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openPermissionDialog.ts
|
|
962
|
+
function openPermissionDialog2(permission) {
|
|
963
|
+
return AppsInTossModule2.openPermissionDialog(permission);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/requestPermission.ts
|
|
967
|
+
async function requestPermission2(permission) {
|
|
968
|
+
const permissionStatus = await getPermission2(permission);
|
|
969
|
+
switch (permissionStatus) {
|
|
970
|
+
case "allowed":
|
|
971
|
+
case "denied":
|
|
972
|
+
return permissionStatus;
|
|
973
|
+
default:
|
|
974
|
+
return openPermissionDialog2(permission);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/setClipboardText.ts
|
|
979
|
+
async function setClipboardText2(text) {
|
|
980
|
+
const permissionStatus = await requestPermission2({ name: "clipboard", access: "write" });
|
|
518
981
|
if (permissionStatus === "denied") {
|
|
519
982
|
throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
520
983
|
}
|
|
521
|
-
return
|
|
984
|
+
return AppsInTossModule2.setClipboardText({ text });
|
|
522
985
|
}
|
|
523
986
|
|
|
524
|
-
// src/native-modules/getClipboardText.ts
|
|
525
|
-
async function
|
|
526
|
-
const permissionStatus = await
|
|
987
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getClipboardText.ts
|
|
988
|
+
async function getClipboardText2() {
|
|
989
|
+
const permissionStatus = await requestPermission2({ name: "clipboard", access: "read" });
|
|
527
990
|
if (permissionStatus === "denied") {
|
|
528
991
|
throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
529
992
|
}
|
|
530
|
-
return
|
|
993
|
+
return AppsInTossModule2.getClipboardText({});
|
|
531
994
|
}
|
|
532
995
|
|
|
533
|
-
// src/native-modules/fetchContacts.ts
|
|
534
|
-
async function
|
|
535
|
-
|
|
536
|
-
offset,
|
|
537
|
-
query
|
|
538
|
-
}) {
|
|
539
|
-
const permissionStatus = await requestPermission({ name: "contacts", access: "read" });
|
|
996
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/fetchContacts.ts
|
|
997
|
+
async function fetchContacts2(options) {
|
|
998
|
+
const permissionStatus = await requestPermission2({ name: "contacts", access: "read" });
|
|
540
999
|
if (permissionStatus === "denied") {
|
|
541
1000
|
throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
542
1001
|
}
|
|
543
|
-
const contacts = await
|
|
544
|
-
size,
|
|
545
|
-
offset,
|
|
546
|
-
query
|
|
547
|
-
});
|
|
1002
|
+
const contacts = await AppsInTossModule2.fetchContacts(options);
|
|
548
1003
|
return {
|
|
549
1004
|
result: contacts.result,
|
|
550
1005
|
nextOffset: contacts.nextOffset ?? null,
|
|
@@ -552,105 +1007,196 @@ async function fetchContacts({
|
|
|
552
1007
|
};
|
|
553
1008
|
}
|
|
554
1009
|
|
|
555
|
-
// src/native-modules/fetchAlbumPhotos.ts
|
|
556
|
-
var
|
|
557
|
-
var
|
|
558
|
-
async function
|
|
559
|
-
const permissionStatus = await
|
|
1010
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts
|
|
1011
|
+
var DEFAULT_MAX_COUNT2 = 10;
|
|
1012
|
+
var DEFAULT_MAX_WIDTH2 = 1024;
|
|
1013
|
+
async function fetchAlbumPhotos2(options) {
|
|
1014
|
+
const permissionStatus = await requestPermission2({ name: "photos", access: "read" });
|
|
560
1015
|
if (permissionStatus === "denied") {
|
|
561
1016
|
throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
562
1017
|
}
|
|
563
|
-
const albumPhotos = await
|
|
1018
|
+
const albumPhotos = await AppsInTossModule2.fetchAlbumPhotos({
|
|
564
1019
|
...options,
|
|
565
|
-
maxCount: options.maxCount ??
|
|
566
|
-
maxWidth: options.maxWidth ??
|
|
1020
|
+
maxCount: options.maxCount ?? DEFAULT_MAX_COUNT2,
|
|
1021
|
+
maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH2
|
|
567
1022
|
});
|
|
568
1023
|
return albumPhotos;
|
|
569
1024
|
}
|
|
570
1025
|
|
|
571
|
-
// src/native-modules/getCurrentLocation.ts
|
|
572
|
-
async function
|
|
573
|
-
const permissionStatus = await
|
|
1026
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getCurrentLocation.ts
|
|
1027
|
+
async function getCurrentLocation2(options) {
|
|
1028
|
+
const permissionStatus = await requestPermission2({ name: "geolocation", access: "access" });
|
|
574
1029
|
if (permissionStatus === "denied") {
|
|
575
1030
|
throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
576
1031
|
}
|
|
577
|
-
const position = await
|
|
1032
|
+
const position = await AppsInTossModule2.getCurrentLocation(options);
|
|
578
1033
|
return position;
|
|
579
1034
|
}
|
|
580
1035
|
|
|
581
|
-
// src/native-modules/openCamera.ts
|
|
582
|
-
async function
|
|
583
|
-
const permissionStatus = await
|
|
1036
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openCamera.ts
|
|
1037
|
+
async function openCamera2(options) {
|
|
1038
|
+
const permissionStatus = await requestPermission2({ name: "camera", access: "access" });
|
|
584
1039
|
if (permissionStatus === "denied") {
|
|
585
1040
|
throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
586
1041
|
}
|
|
587
|
-
const photo = await
|
|
1042
|
+
const photo = await AppsInTossModule2.openCamera({ base64: false, maxWidth: 1024, ...options });
|
|
588
1043
|
return photo;
|
|
589
1044
|
}
|
|
590
1045
|
|
|
591
|
-
// src/native-modules/appLogin.ts
|
|
592
|
-
async function
|
|
593
|
-
return
|
|
1046
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/appLogin.ts
|
|
1047
|
+
async function appLogin2() {
|
|
1048
|
+
return AppsInTossModule2.appLogin({});
|
|
594
1049
|
}
|
|
595
1050
|
|
|
596
|
-
// src/native-modules/
|
|
597
|
-
|
|
598
|
-
|
|
1051
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/isMinVersionSupported.ts
|
|
1052
|
+
import { Platform as Platform4 } from "react-native";
|
|
1053
|
+
|
|
1054
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/utils/compareVersion.ts
|
|
1055
|
+
var SEMVER_REGEX2 = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
|
|
1056
|
+
var isWildcard2 = (val) => ["*", "x", "X"].includes(val);
|
|
1057
|
+
var tryParse2 = (val) => {
|
|
1058
|
+
const num = parseInt(val, 10);
|
|
1059
|
+
return isNaN(num) ? val : num;
|
|
1060
|
+
};
|
|
1061
|
+
var coerceTypes2 = (a, b) => {
|
|
1062
|
+
return typeof a === typeof b ? [a, b] : [String(a), String(b)];
|
|
1063
|
+
};
|
|
1064
|
+
var compareValues2 = (a, b) => {
|
|
1065
|
+
if (isWildcard2(a) || isWildcard2(b)) {
|
|
1066
|
+
return 0;
|
|
1067
|
+
}
|
|
1068
|
+
const [aVal, bVal] = coerceTypes2(tryParse2(a), tryParse2(b));
|
|
1069
|
+
if (aVal > bVal) {
|
|
1070
|
+
return 1;
|
|
1071
|
+
}
|
|
1072
|
+
if (aVal < bVal) {
|
|
1073
|
+
return -1;
|
|
1074
|
+
}
|
|
1075
|
+
return 0;
|
|
1076
|
+
};
|
|
1077
|
+
var parseVersion2 = (version) => {
|
|
1078
|
+
if (typeof version !== "string") {
|
|
1079
|
+
throw new TypeError("Invalid argument: expected a string");
|
|
1080
|
+
}
|
|
1081
|
+
const match = version.match(SEMVER_REGEX2);
|
|
1082
|
+
if (!match) {
|
|
1083
|
+
throw new Error(`Invalid semver: '${version}'`);
|
|
1084
|
+
}
|
|
1085
|
+
const [, major, minor, patch, build, preRelease] = match;
|
|
1086
|
+
return [major, minor, patch, build, preRelease];
|
|
1087
|
+
};
|
|
1088
|
+
var compareSegments2 = (a, b) => {
|
|
1089
|
+
const maxLength = Math.max(a.length, b.length);
|
|
1090
|
+
for (let i = 0; i < maxLength; i++) {
|
|
1091
|
+
const segA = a[i] ?? "0";
|
|
1092
|
+
const segB = b[i] ?? "0";
|
|
1093
|
+
const result = compareValues2(segA, segB);
|
|
1094
|
+
if (result !== 0) {
|
|
1095
|
+
return result;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
return 0;
|
|
1099
|
+
};
|
|
1100
|
+
var compareVersions2 = (v1, v2) => {
|
|
1101
|
+
const seg1 = parseVersion2(v1);
|
|
1102
|
+
const seg2 = parseVersion2(v2);
|
|
1103
|
+
const preRelease1 = seg1.pop();
|
|
1104
|
+
const preRelease2 = seg2.pop();
|
|
1105
|
+
const mainCompare = compareSegments2(seg1, seg2);
|
|
1106
|
+
if (mainCompare !== 0) {
|
|
1107
|
+
return mainCompare;
|
|
1108
|
+
}
|
|
1109
|
+
if (preRelease1 && preRelease2) {
|
|
1110
|
+
return compareSegments2(preRelease1.split("."), preRelease2.split("."));
|
|
1111
|
+
}
|
|
1112
|
+
if (preRelease1) {
|
|
1113
|
+
return -1;
|
|
1114
|
+
}
|
|
1115
|
+
if (preRelease2) {
|
|
1116
|
+
return 1;
|
|
1117
|
+
}
|
|
1118
|
+
return 0;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/isMinVersionSupported.ts
|
|
1122
|
+
function isMinVersionSupported2(minVersions) {
|
|
1123
|
+
const operationalEnvironment2 = AppsInTossModule2.operationalEnvironment;
|
|
1124
|
+
if (operationalEnvironment2 === "sandbox") {
|
|
1125
|
+
return true;
|
|
1126
|
+
}
|
|
1127
|
+
const currentVersion = AppsInTossModule2.tossAppVersion;
|
|
1128
|
+
const isIOS = Platform4.OS === "ios";
|
|
1129
|
+
const minVersion = isIOS ? minVersions.ios : minVersions.android;
|
|
1130
|
+
if (minVersion === void 0) {
|
|
1131
|
+
return false;
|
|
1132
|
+
}
|
|
1133
|
+
if (minVersion === "always") {
|
|
1134
|
+
return true;
|
|
1135
|
+
}
|
|
1136
|
+
if (minVersion === "never") {
|
|
1137
|
+
return false;
|
|
1138
|
+
}
|
|
1139
|
+
return compareVersions2(currentVersion, minVersion) >= 0;
|
|
599
1140
|
}
|
|
600
1141
|
|
|
601
|
-
// src/native-modules/eventLog.ts
|
|
602
|
-
function
|
|
1142
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/eventLog.ts
|
|
1143
|
+
function normalizeParams2(params) {
|
|
603
1144
|
return Object.fromEntries(
|
|
604
1145
|
Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
|
|
605
1146
|
);
|
|
606
1147
|
}
|
|
607
|
-
async function
|
|
608
|
-
if (
|
|
1148
|
+
async function eventLog2(params) {
|
|
1149
|
+
if (AppsInTossModule2.operationalEnvironment === "sandbox") {
|
|
609
1150
|
console.log("[eventLogDebug]", {
|
|
610
1151
|
log_name: params.log_name,
|
|
611
1152
|
log_type: params.log_type,
|
|
612
|
-
params:
|
|
1153
|
+
params: normalizeParams2(params.params)
|
|
613
1154
|
});
|
|
614
1155
|
return;
|
|
615
1156
|
}
|
|
616
|
-
const isSupported =
|
|
1157
|
+
const isSupported = isMinVersionSupported2({
|
|
617
1158
|
android: "5.208.0",
|
|
618
1159
|
ios: "5.208.0"
|
|
619
1160
|
});
|
|
620
1161
|
if (!isSupported) {
|
|
621
1162
|
return;
|
|
622
1163
|
}
|
|
623
|
-
return
|
|
1164
|
+
return AppsInTossModule2.eventLog({
|
|
624
1165
|
log_name: params.log_name,
|
|
625
1166
|
log_type: params.log_type,
|
|
626
|
-
params:
|
|
1167
|
+
params: normalizeParams2(params.params)
|
|
627
1168
|
});
|
|
628
1169
|
}
|
|
629
1170
|
|
|
630
|
-
// src/native-modules/getTossShareLink.ts
|
|
631
|
-
async function
|
|
632
|
-
const { shareLink } = await
|
|
1171
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getTossShareLink.ts
|
|
1172
|
+
async function getTossShareLink2(path) {
|
|
1173
|
+
const { shareLink } = await AppsInTossModule2.getTossShareLink({});
|
|
633
1174
|
const shareUrl = new URL(shareLink);
|
|
634
1175
|
shareUrl.searchParams.set("deep_link_value", path);
|
|
635
1176
|
shareUrl.searchParams.set("af_dp", path);
|
|
636
1177
|
return shareUrl.toString();
|
|
637
1178
|
}
|
|
638
1179
|
|
|
639
|
-
// src/native-modules/setDeviceOrientation.ts
|
|
640
|
-
async function
|
|
641
|
-
const isSupported =
|
|
1180
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/setDeviceOrientation.ts
|
|
1181
|
+
async function setDeviceOrientation2(options) {
|
|
1182
|
+
const isSupported = isMinVersionSupported2({
|
|
642
1183
|
android: "5.215.0",
|
|
643
1184
|
ios: "5.215.0"
|
|
644
1185
|
});
|
|
645
1186
|
if (!isSupported) {
|
|
646
1187
|
return;
|
|
647
1188
|
}
|
|
648
|
-
return
|
|
1189
|
+
return AppsInTossModule2.setDeviceOrientation(options);
|
|
649
1190
|
}
|
|
650
1191
|
|
|
651
|
-
// src/native-modules/
|
|
652
|
-
async function
|
|
653
|
-
|
|
1192
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/checkoutPayment.ts
|
|
1193
|
+
async function checkoutPayment2(options) {
|
|
1194
|
+
return AppsInTossModule2.checkoutPayment({ params: options });
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/saveBase64Data.ts
|
|
1198
|
+
async function saveBase64Data2(params) {
|
|
1199
|
+
const isSupported = isMinVersionSupported2({
|
|
654
1200
|
android: "5.218.0",
|
|
655
1201
|
ios: "5.216.0"
|
|
656
1202
|
});
|
|
@@ -658,263 +1204,293 @@ async function saveBase64Data(params) {
|
|
|
658
1204
|
console.warn("saveBase64Data is not supported in this app version");
|
|
659
1205
|
return;
|
|
660
1206
|
}
|
|
661
|
-
await
|
|
1207
|
+
await AppsInTossModule2.saveBase64Data(params);
|
|
662
1208
|
}
|
|
663
1209
|
|
|
664
|
-
// src/
|
|
665
|
-
var
|
|
666
|
-
var GAME_CENTER_MIN_VERSION = {
|
|
1210
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/constants.ts
|
|
1211
|
+
var GAME_CENTER_MIN_VERSION2 = {
|
|
667
1212
|
android: "5.221.0",
|
|
668
1213
|
ios: "5.221.0"
|
|
669
1214
|
};
|
|
670
1215
|
|
|
671
|
-
// src/native-modules/getGameCenterGameProfile.ts
|
|
672
|
-
async function
|
|
673
|
-
const isSupported =
|
|
674
|
-
if (!isSupported) {
|
|
675
|
-
return;
|
|
676
|
-
}
|
|
677
|
-
return
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
// src/native-modules/openGameCenterLeaderboard.ts
|
|
681
|
-
import { openURL } from "react-native-bedrock";
|
|
682
|
-
async function openGameCenterLeaderboard() {
|
|
683
|
-
if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
|
|
687
|
-
url.searchParams.set("appName", getAppName());
|
|
688
|
-
url.searchParams.set("referrer", `appsintoss.${getAppName()}`);
|
|
689
|
-
return openURL(url.toString());
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
// src/native-modules/submitGameCenterLeaderBoardScore.ts
|
|
693
|
-
async function submitGameCenterLeaderBoardScore(params) {
|
|
694
|
-
const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
|
|
695
|
-
if (!isSupported) {
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
return AppsInTossModule.submitGameCenterLeaderBoardScore(params);
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
// src/core/registerApp.tsx
|
|
702
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
703
|
-
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
704
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
705
|
-
/* @__PURE__ */ jsx(AppEvent.StayTime, {}),
|
|
706
|
-
/* @__PURE__ */ jsx(AppEvent.Entry, {}),
|
|
707
|
-
/* @__PURE__ */ jsx(AppEvent.System, { ...initialProps }),
|
|
708
|
-
/* @__PURE__ */ jsx(Container, { ...initialProps, children: /* @__PURE__ */ jsx(TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ jsx(TDSContainer, { ...initialProps, children }) }) })
|
|
709
|
-
] });
|
|
710
|
-
}
|
|
711
|
-
function TDSContainer({ children }) {
|
|
712
|
-
useAppsInTossBridge();
|
|
713
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
714
|
-
}
|
|
715
|
-
function registerApp(container, { context, analytics }) {
|
|
716
|
-
Analytics.init({
|
|
717
|
-
logger: (params) => void eventLog(params),
|
|
718
|
-
debug: analytics?.debug ?? __DEV__
|
|
719
|
-
});
|
|
720
|
-
return Bedrock3.registerApp(AppsInTossContainer.bind(null, container), {
|
|
721
|
-
appName: getAppName(),
|
|
722
|
-
context,
|
|
723
|
-
router: {
|
|
724
|
-
screenContainer: Analytics.Screen,
|
|
725
|
-
defaultScreenOption: {
|
|
726
|
-
statusBarStyle: "dark"
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
function getAppName() {
|
|
732
|
-
try {
|
|
733
|
-
return global.__bedrock.app.name;
|
|
734
|
-
} catch (error) {
|
|
735
|
-
console.error("unexpected error occurred while getting app name");
|
|
736
|
-
throw error;
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
// src/core/index.ts
|
|
741
|
-
var AppsInToss = {
|
|
742
|
-
registerApp
|
|
743
|
-
};
|
|
744
|
-
|
|
745
|
-
// src/native-event-emitter/startUpdateLocation.ts
|
|
746
|
-
function startUpdateLocation(eventParams) {
|
|
747
|
-
return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
// ../../.yarn/cache/es-toolkit-npm-1.34.1-4cd6371dcb-aab6d07be3.zip/node_modules/es-toolkit/dist/function/noop.mjs
|
|
751
|
-
function noop() {
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
// src/native-modules/ads/googleAdMob.ts
|
|
755
|
-
function loadAdMobInterstitialAd(params) {
|
|
756
|
-
if (!loadAdMobInterstitialAd.isSupported()) {
|
|
757
|
-
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
758
|
-
return noop;
|
|
759
|
-
}
|
|
760
|
-
const { onEvent, onError, options } = params;
|
|
761
|
-
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobInterstitialAd", options, {
|
|
762
|
-
onAdClicked: () => {
|
|
763
|
-
onEvent({ type: "clicked" });
|
|
764
|
-
},
|
|
765
|
-
onAdDismissed: () => {
|
|
766
|
-
onEvent({ type: "dismissed" });
|
|
767
|
-
},
|
|
768
|
-
onAdFailedToShow: () => {
|
|
769
|
-
onEvent({ type: "failedToShow" });
|
|
770
|
-
},
|
|
771
|
-
onAdImpression: () => {
|
|
772
|
-
onEvent({ type: "impression" });
|
|
773
|
-
},
|
|
774
|
-
onAdShow: () => {
|
|
775
|
-
onEvent({ type: "show" });
|
|
776
|
-
},
|
|
777
|
-
onSuccess: (result) => onEvent({ type: "loaded", data: result }),
|
|
778
|
-
onError
|
|
779
|
-
});
|
|
780
|
-
return unregisterCallbacks;
|
|
781
|
-
}
|
|
782
|
-
function showAdMobInterstitialAd(params) {
|
|
783
|
-
if (!showAdMobInterstitialAd.isSupported()) {
|
|
784
|
-
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
785
|
-
return noop;
|
|
786
|
-
}
|
|
787
|
-
const { onEvent, onError, options } = params;
|
|
788
|
-
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobInterstitialAd", options, {
|
|
789
|
-
onSuccess: () => onEvent({ type: "requested" }),
|
|
790
|
-
onError
|
|
791
|
-
});
|
|
792
|
-
return unregisterCallbacks;
|
|
793
|
-
}
|
|
794
|
-
function loadAdMobRewardedAd(params) {
|
|
795
|
-
if (!loadAdMobRewardedAd.isSupported()) {
|
|
796
|
-
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
797
|
-
return noop;
|
|
798
|
-
}
|
|
799
|
-
const { onEvent, onError, options } = params;
|
|
800
|
-
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobRewardedAd", options, {
|
|
801
|
-
onAdClicked: () => {
|
|
802
|
-
onEvent({ type: "clicked" });
|
|
803
|
-
},
|
|
804
|
-
onAdDismissed: () => {
|
|
805
|
-
onEvent({ type: "dismissed" });
|
|
806
|
-
},
|
|
807
|
-
onAdFailedToShow: () => {
|
|
808
|
-
onEvent({ type: "failedToShow" });
|
|
809
|
-
},
|
|
810
|
-
onAdImpression: () => {
|
|
811
|
-
onEvent({ type: "impression" });
|
|
812
|
-
},
|
|
813
|
-
onAdShow: () => {
|
|
814
|
-
onEvent({ type: "show" });
|
|
815
|
-
},
|
|
816
|
-
onUserEarnedReward: () => {
|
|
817
|
-
onEvent({ type: "userEarnedReward" });
|
|
818
|
-
},
|
|
819
|
-
onSuccess: (result) => onEvent({ type: "loaded", data: result }),
|
|
820
|
-
onError
|
|
821
|
-
});
|
|
822
|
-
return unregisterCallbacks;
|
|
823
|
-
}
|
|
824
|
-
function showAdMobRewardedAd(params) {
|
|
825
|
-
if (!showAdMobRewardedAd.isSupported()) {
|
|
826
|
-
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
827
|
-
return noop;
|
|
828
|
-
}
|
|
829
|
-
const { onEvent, onError, options } = params;
|
|
830
|
-
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobRewardedAd", options, {
|
|
831
|
-
onSuccess: () => onEvent({ type: "requested" }),
|
|
832
|
-
onError
|
|
833
|
-
});
|
|
834
|
-
return unregisterCallbacks;
|
|
835
|
-
}
|
|
836
|
-
var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
|
|
837
|
-
var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
|
|
838
|
-
var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
|
|
839
|
-
var ENVIRONMENT = getOperationalEnvironment();
|
|
840
|
-
function createIsSupported() {
|
|
841
|
-
return () => {
|
|
842
|
-
if (ENVIRONMENT !== "toss") {
|
|
843
|
-
return false;
|
|
844
|
-
}
|
|
845
|
-
return isMinVersionSupported({
|
|
846
|
-
android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION,
|
|
847
|
-
ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION
|
|
848
|
-
});
|
|
849
|
-
};
|
|
850
|
-
}
|
|
851
|
-
loadAdMobInterstitialAd.isSupported = createIsSupported();
|
|
852
|
-
loadAdMobRewardedAd.isSupported = createIsSupported();
|
|
853
|
-
showAdMobInterstitialAd.isSupported = createIsSupported();
|
|
854
|
-
showAdMobRewardedAd.isSupported = createIsSupported();
|
|
855
|
-
|
|
856
|
-
// src/native-modules/getDeviceId.ts
|
|
857
|
-
function getDeviceId() {
|
|
858
|
-
return AppsInTossModule.deviceId;
|
|
1216
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getGameCenterGameProfile.ts
|
|
1217
|
+
async function getGameCenterGameProfile2() {
|
|
1218
|
+
const isSupported = isMinVersionSupported2(GAME_CENTER_MIN_VERSION2);
|
|
1219
|
+
if (!isSupported) {
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
return AppsInTossModule2.getGameCenterGameProfile({});
|
|
859
1223
|
}
|
|
860
1224
|
|
|
861
|
-
// src/native-modules/
|
|
862
|
-
|
|
863
|
-
|
|
1225
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts
|
|
1226
|
+
import { openURL as openURL5 } from "@granite-js/react-native";
|
|
1227
|
+
async function openGameCenterLeaderboard2() {
|
|
1228
|
+
if (!isMinVersionSupported2(GAME_CENTER_MIN_VERSION2)) {
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
const appName = global.__granite?.app?.name;
|
|
1232
|
+
if (appName == null) {
|
|
1233
|
+
throw new Error("Cannot get app name");
|
|
1234
|
+
}
|
|
1235
|
+
const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
|
|
1236
|
+
url.searchParams.set("appName", appName);
|
|
1237
|
+
url.searchParams.set("referrer", `appsintoss.${appName}`);
|
|
1238
|
+
return openURL5(url.toString());
|
|
864
1239
|
}
|
|
865
1240
|
|
|
866
|
-
// src/native-modules/
|
|
867
|
-
async function
|
|
868
|
-
const isSupported =
|
|
869
|
-
android: "5.219.0",
|
|
870
|
-
ios: "5.219.0"
|
|
871
|
-
});
|
|
1241
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/submitGameCenterLeaderBoardScore.ts
|
|
1242
|
+
async function submitGameCenterLeaderBoardScore2(params) {
|
|
1243
|
+
const isSupported = isMinVersionSupported2(GAME_CENTER_MIN_VERSION2);
|
|
872
1244
|
if (!isSupported) {
|
|
873
1245
|
return;
|
|
874
1246
|
}
|
|
875
|
-
return
|
|
1247
|
+
return AppsInTossModule2.submitGameCenterLeaderBoardScore(params);
|
|
876
1248
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
1249
|
+
|
|
1250
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/constant-bridges.ts
|
|
1251
|
+
var constant_bridges_exports = {};
|
|
1252
|
+
__export(constant_bridges_exports, {
|
|
1253
|
+
getDeviceId: () => getDeviceId2,
|
|
1254
|
+
getLocale: () => getLocale2,
|
|
1255
|
+
getOperationalEnvironment: () => getOperationalEnvironment2,
|
|
1256
|
+
getPlatformOS: () => getPlatformOS2,
|
|
1257
|
+
getSchemeUri: () => getSchemeUri5,
|
|
1258
|
+
getTossAppVersion: () => getTossAppVersion2
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getLocale.ts
|
|
1262
|
+
import { Platform as Platform5 } from "react-native";
|
|
1263
|
+
function getLocale2() {
|
|
1264
|
+
const locale = BedrockModule2?.DeviceInfo?.locale ?? "ko-KR";
|
|
1265
|
+
if (Platform5.OS === "android") {
|
|
1266
|
+
return replaceUnderbarToHypen2(locale);
|
|
884
1267
|
}
|
|
885
|
-
return
|
|
1268
|
+
return locale;
|
|
886
1269
|
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
1270
|
+
function replaceUnderbarToHypen2(locale) {
|
|
1271
|
+
return locale.replace(/_/g, "-");
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getSchemeUri.ts
|
|
1275
|
+
function getSchemeUri5() {
|
|
1276
|
+
return BedrockModule2.schemeUri;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getPlatformOS.ts
|
|
1280
|
+
import { Platform as Platform6 } from "react-native";
|
|
1281
|
+
function getPlatformOS2() {
|
|
1282
|
+
return Platform6.OS;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getOperationalEnvironment.ts
|
|
1286
|
+
function getOperationalEnvironment2() {
|
|
1287
|
+
return AppsInTossModule2.operationalEnvironment;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getTossAppVersion.ts
|
|
1291
|
+
function getTossAppVersion2() {
|
|
1292
|
+
return AppsInTossModule2.tossAppVersion;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getDeviceId.ts
|
|
1296
|
+
function getDeviceId2() {
|
|
1297
|
+
return AppsInTossModule2.deviceId;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/event-bridges.ts
|
|
1301
|
+
var event_bridges_exports = {};
|
|
1302
|
+
__export(event_bridges_exports, {
|
|
1303
|
+
contactsViral: () => contactsViral2,
|
|
1304
|
+
onVisibilityChangedByTransparentServiceWeb: () => onVisibilityChangedByTransparentServiceWeb2,
|
|
1305
|
+
startUpdateLocation: () => startUpdateLocation2
|
|
1306
|
+
});
|
|
1307
|
+
|
|
1308
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
1309
|
+
import { GraniteEvent as GraniteEvent2 } from "@granite-js/react-native";
|
|
1310
|
+
|
|
1311
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
|
|
1312
|
+
import { GraniteEventDefinition as GraniteEventDefinition5 } from "@granite-js/react-native";
|
|
1313
|
+
var EntryMessageExitedEvent2 = class extends GraniteEventDefinition5 {
|
|
1314
|
+
name = "entryMessageExited";
|
|
1315
|
+
remove() {
|
|
1316
|
+
}
|
|
1317
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1318
|
+
listener(_) {
|
|
1319
|
+
}
|
|
890
1320
|
};
|
|
891
1321
|
|
|
892
|
-
//
|
|
893
|
-
|
|
894
|
-
|
|
1322
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
1323
|
+
import { GraniteEventDefinition as GraniteEventDefinition6 } from "@granite-js/react-native";
|
|
1324
|
+
|
|
1325
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
|
|
1326
|
+
import { NativeEventEmitter as NativeEventEmitter2 } from "react-native";
|
|
1327
|
+
var nativeEventEmitter2 = new NativeEventEmitter2(AppsInTossModuleInstance2);
|
|
1328
|
+
|
|
1329
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
1330
|
+
var UpdateLocationEvent2 = class extends GraniteEventDefinition6 {
|
|
1331
|
+
name = "updateLocationEvent";
|
|
1332
|
+
subscriptionCount = 0;
|
|
1333
|
+
ref = {
|
|
1334
|
+
remove: () => {
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
remove() {
|
|
1338
|
+
if (--this.subscriptionCount === 0) {
|
|
1339
|
+
AppsInTossModuleInstance2.stopUpdateLocation({});
|
|
1340
|
+
}
|
|
1341
|
+
this.ref.remove();
|
|
1342
|
+
}
|
|
1343
|
+
listener(options, onEvent, onError) {
|
|
1344
|
+
requestPermission2({ name: "geolocation", access: "access" }).then((permissionStatus) => {
|
|
1345
|
+
if (permissionStatus === "denied") {
|
|
1346
|
+
onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
|
|
1347
|
+
return;
|
|
1348
|
+
}
|
|
1349
|
+
void AppsInTossModuleInstance2.startUpdateLocation(options).catch(onError);
|
|
1350
|
+
const subscription = nativeEventEmitter2.addListener("updateLocation", onEvent);
|
|
1351
|
+
this.ref = {
|
|
1352
|
+
remove: () => subscription?.remove()
|
|
1353
|
+
};
|
|
1354
|
+
this.subscriptionCount++;
|
|
1355
|
+
}).catch(onError);
|
|
1356
|
+
}
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1359
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
1360
|
+
import { GraniteEventDefinition as GraniteEventDefinition7 } from "@granite-js/react-native";
|
|
1361
|
+
|
|
1362
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/utils/generateUUID.ts
|
|
1363
|
+
function generateUUID2(placeholder) {
|
|
1364
|
+
return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID2);
|
|
895
1365
|
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
1366
|
+
|
|
1367
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/appBridge.ts
|
|
1368
|
+
var INTERNAL__callbacks2 = /* @__PURE__ */ new Map();
|
|
1369
|
+
function invokeAppBridgeCallback2(id, ...args) {
|
|
1370
|
+
const callback = INTERNAL__callbacks2.get(id);
|
|
1371
|
+
callback?.call(null, ...args);
|
|
1372
|
+
return Boolean(callback);
|
|
1373
|
+
}
|
|
1374
|
+
function invokeAppBridgeMethod2(methodName, params, callbacks) {
|
|
1375
|
+
const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
|
|
1376
|
+
const { callbackMap, unregisterAll } = registerCallbacks2(appBridgeCallbacks);
|
|
1377
|
+
const promise = AppsInTossModuleInstance2[methodName]({
|
|
1378
|
+
params,
|
|
1379
|
+
callbacks: callbackMap
|
|
900
1380
|
});
|
|
1381
|
+
void promise.then(onSuccess).catch(onError);
|
|
1382
|
+
return unregisterAll;
|
|
901
1383
|
}
|
|
902
|
-
function
|
|
903
|
-
|
|
1384
|
+
function registerCallbacks2(callbacks) {
|
|
1385
|
+
const callbackMap = {};
|
|
1386
|
+
for (const [callbackName, callback] of Object.entries(callbacks)) {
|
|
1387
|
+
const id = registerCallback2(callback, callbackName);
|
|
1388
|
+
callbackMap[callbackName] = id;
|
|
1389
|
+
}
|
|
1390
|
+
const unregisterAll = () => {
|
|
1391
|
+
Object.values(callbackMap).forEach(unregisterCallback2);
|
|
1392
|
+
};
|
|
1393
|
+
return { callbackMap, unregisterAll };
|
|
904
1394
|
}
|
|
905
|
-
function
|
|
906
|
-
|
|
1395
|
+
function registerCallback2(callback, name = "unnamed") {
|
|
1396
|
+
const uniqueId = generateUUID2();
|
|
1397
|
+
const callbackId = `${uniqueId}__${name}`;
|
|
1398
|
+
INTERNAL__callbacks2.set(callbackId, callback);
|
|
1399
|
+
return callbackId;
|
|
907
1400
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1401
|
+
function unregisterCallback2(id) {
|
|
1402
|
+
INTERNAL__callbacks2.delete(id);
|
|
1403
|
+
}
|
|
1404
|
+
function getCallbackIds2() {
|
|
1405
|
+
return Array.from(INTERNAL__callbacks2.keys());
|
|
1406
|
+
}
|
|
1407
|
+
var INTERNAL__appBridgeHandler2 = {
|
|
1408
|
+
invokeAppBridgeCallback: invokeAppBridgeCallback2,
|
|
1409
|
+
invokeAppBridgeMethod: invokeAppBridgeMethod2,
|
|
1410
|
+
registerCallback: registerCallback2,
|
|
1411
|
+
unregisterCallback: unregisterCallback2,
|
|
1412
|
+
getCallbackIds: getCallbackIds2
|
|
913
1413
|
};
|
|
914
1414
|
|
|
915
|
-
//
|
|
916
|
-
|
|
917
|
-
|
|
1415
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
1416
|
+
var UNSAFE__nativeEventEmitter2 = nativeEventEmitter2;
|
|
1417
|
+
var AppBridgeCallbackEvent2 = class _AppBridgeCallbackEvent2 extends GraniteEventDefinition7 {
|
|
1418
|
+
static INTERNAL__appBridgeSubscription;
|
|
1419
|
+
name = "appBridgeCallbackEvent";
|
|
1420
|
+
constructor() {
|
|
1421
|
+
super();
|
|
1422
|
+
this.registerAppBridgeCallbackEventListener();
|
|
1423
|
+
}
|
|
1424
|
+
remove() {
|
|
1425
|
+
}
|
|
1426
|
+
listener() {
|
|
1427
|
+
}
|
|
1428
|
+
registerAppBridgeCallbackEventListener() {
|
|
1429
|
+
if (_AppBridgeCallbackEvent2.INTERNAL__appBridgeSubscription != null) {
|
|
1430
|
+
return;
|
|
1431
|
+
}
|
|
1432
|
+
_AppBridgeCallbackEvent2.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter2.addListener(
|
|
1433
|
+
"appBridgeCallback",
|
|
1434
|
+
this.ensureInvokeAppBridgeCallback
|
|
1435
|
+
);
|
|
1436
|
+
}
|
|
1437
|
+
ensureInvokeAppBridgeCallback(result) {
|
|
1438
|
+
if (typeof result === "object" && typeof result.name === "string") {
|
|
1439
|
+
INTERNAL__appBridgeHandler2.invokeAppBridgeCallback(result.name, result.params);
|
|
1440
|
+
} else {
|
|
1441
|
+
console.warn("Invalid app bridge callback result:", result);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
1447
|
+
import { GraniteEventDefinition as GraniteEventDefinition8 } from "@granite-js/react-native";
|
|
1448
|
+
var VisibilityChangedByTransparentServiceWebEvent2 = class extends GraniteEventDefinition8 {
|
|
1449
|
+
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
1450
|
+
subscription = null;
|
|
1451
|
+
remove() {
|
|
1452
|
+
this.subscription?.remove();
|
|
1453
|
+
this.subscription = null;
|
|
1454
|
+
}
|
|
1455
|
+
listener(options, onEvent, onError) {
|
|
1456
|
+
const subscription = nativeEventEmitter2.addListener("visibilityChangedByTransparentServiceWeb", (params) => {
|
|
1457
|
+
if (this.isVisibilityChangedByTransparentServiceWebResult(params)) {
|
|
1458
|
+
if (params.callbackId === options.callbackId) {
|
|
1459
|
+
onEvent(params.isVisible);
|
|
1460
|
+
}
|
|
1461
|
+
} else {
|
|
1462
|
+
onError(new Error("Invalid visibility changed by transparent service web result"));
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
this.subscription = subscription;
|
|
1466
|
+
}
|
|
1467
|
+
isVisibilityChangedByTransparentServiceWebResult(params) {
|
|
1468
|
+
return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
|
|
1469
|
+
}
|
|
1470
|
+
};
|
|
1471
|
+
|
|
1472
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
1473
|
+
var appsInTossEvent2 = new GraniteEvent2([
|
|
1474
|
+
new UpdateLocationEvent2(),
|
|
1475
|
+
new EntryMessageExitedEvent2(),
|
|
1476
|
+
// Internal events
|
|
1477
|
+
new AppBridgeCallbackEvent2(),
|
|
1478
|
+
new VisibilityChangedByTransparentServiceWebEvent2()
|
|
1479
|
+
]);
|
|
1480
|
+
|
|
1481
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts
|
|
1482
|
+
function startUpdateLocation2(eventParams) {
|
|
1483
|
+
return appsInTossEvent2.addEventListener("updateLocationEvent", eventParams);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
1487
|
+
function onVisibilityChangedByTransparentServiceWeb2(eventParams) {
|
|
1488
|
+
return appsInTossEvent2.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/contactsViral.ts
|
|
1492
|
+
function contactsViral2(params) {
|
|
1493
|
+
const isSupported = isMinVersionSupported2({
|
|
918
1494
|
android: "5.223.0",
|
|
919
1495
|
ios: "5.223.0"
|
|
920
1496
|
});
|
|
@@ -923,7 +1499,7 @@ function contactsViral(params) {
|
|
|
923
1499
|
};
|
|
924
1500
|
}
|
|
925
1501
|
const { onEvent, onError, options } = params;
|
|
926
|
-
const unregisterCallbacks =
|
|
1502
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler2.invokeAppBridgeMethod("contactsViral", options, {
|
|
927
1503
|
onRewardFromContactsViral: (result) => {
|
|
928
1504
|
onEvent({ type: "sendViral", data: result });
|
|
929
1505
|
},
|
|
@@ -935,18 +1511,66 @@ function contactsViral(params) {
|
|
|
935
1511
|
return unregisterCallbacks;
|
|
936
1512
|
}
|
|
937
1513
|
|
|
938
|
-
// src/
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
1514
|
+
// src/core/registerApp.tsx
|
|
1515
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
1516
|
+
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1517
|
+
if (!isMinVersionSupported({
|
|
1518
|
+
android: "5.220.0",
|
|
1519
|
+
ios: "5.221.0"
|
|
1520
|
+
})) {
|
|
1521
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
1522
|
+
/* @__PURE__ */ jsx2(AppEvent.Entry, {}),
|
|
1523
|
+
/* @__PURE__ */ jsx2(AppEvent.System, { ...initialProps }),
|
|
1524
|
+
/* @__PURE__ */ jsx2(AppUpdate, {})
|
|
1525
|
+
] });
|
|
1526
|
+
}
|
|
1527
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
1528
|
+
/* @__PURE__ */ jsx2(AppEvent.StayTime, {}),
|
|
1529
|
+
/* @__PURE__ */ jsx2(AppEvent.Entry, {}),
|
|
1530
|
+
/* @__PURE__ */ jsx2(AppEvent.System, { ...initialProps }),
|
|
1531
|
+
/* @__PURE__ */ jsx2(Container, { ...initialProps, children: /* @__PURE__ */ jsx2(TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ jsx2(TDSContainer, { ...initialProps, children }) }) })
|
|
1532
|
+
] });
|
|
1533
|
+
}
|
|
1534
|
+
function TDSContainer({ children }) {
|
|
1535
|
+
useAppsInTossBridge();
|
|
1536
|
+
return /* @__PURE__ */ jsx2(Fragment2, { children });
|
|
1537
|
+
}
|
|
1538
|
+
function registerApp(container, { context, analytics }) {
|
|
1539
|
+
Analytics.init({
|
|
1540
|
+
logger: (params) => void eventLog2(params),
|
|
1541
|
+
debug: analytics?.debug ?? __DEV__
|
|
1542
|
+
});
|
|
1543
|
+
const App = Granite3.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1544
|
+
appName: getAppName(),
|
|
1545
|
+
context,
|
|
1546
|
+
router: {
|
|
1547
|
+
screenContainer: Analytics.Screen,
|
|
1548
|
+
defaultScreenOption: {
|
|
1549
|
+
statusBarStyle: "dark"
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
});
|
|
1553
|
+
global.Page = App;
|
|
1554
|
+
return App;
|
|
1555
|
+
}
|
|
1556
|
+
function getAppName() {
|
|
1557
|
+
try {
|
|
1558
|
+
return global.__granite.app.name;
|
|
1559
|
+
} catch (error) {
|
|
1560
|
+
console.error("unexpected error occurred while getting app name");
|
|
1561
|
+
throw error;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
// src/core/index.ts
|
|
1566
|
+
var AppsInToss = {
|
|
1567
|
+
registerApp
|
|
947
1568
|
};
|
|
948
1569
|
|
|
949
1570
|
// src/components/WebView.tsx
|
|
1571
|
+
import { getSchemeUri as getSchemeUri7, useGraniteEvent } from "@granite-js/react-native";
|
|
1572
|
+
import * as graniteAsyncBridges from "@granite-js/react-native/async-bridges";
|
|
1573
|
+
import * as graniteConstantBridges from "@granite-js/react-native/constant-bridges";
|
|
950
1574
|
import {
|
|
951
1575
|
ExternalWebViewScreen,
|
|
952
1576
|
PartnerWebViewScreen,
|
|
@@ -954,43 +1578,47 @@ import {
|
|
|
954
1578
|
usePartnerNavigation
|
|
955
1579
|
} from "@toss-design-system/react-native";
|
|
956
1580
|
import { useSafeAreaBottom, useSafeAreaTop as useSafeAreaTop2 } from "@toss-design-system/react-native/private";
|
|
957
|
-
import { useCallback as useCallback5, useEffect as
|
|
958
|
-
import { BackHandler as BackHandler2, Platform as
|
|
959
|
-
import { getSchemeUri as getSchemeUri5, useBedrockEvent } from "react-native-bedrock";
|
|
960
|
-
import * as bedrockAsyncBridges from "react-native-bedrock/async-bridges";
|
|
961
|
-
import * as bedrockConstantBridges from "react-native-bedrock/constant-bridges";
|
|
1581
|
+
import { useCallback as useCallback5, useEffect as useEffect8, useMemo as useMemo3, useState as useState4 } from "react";
|
|
1582
|
+
import { BackHandler as BackHandler2, Platform as Platform12 } from "react-native";
|
|
962
1583
|
|
|
963
1584
|
// src/components/GameWebView.tsx
|
|
964
1585
|
import {
|
|
965
1586
|
WebView as PlainWebView
|
|
966
|
-
} from "@
|
|
1587
|
+
} from "@granite-js/native/react-native-webview";
|
|
1588
|
+
import { closeView as closeView4 } from "@granite-js/react-native";
|
|
967
1589
|
import { useDialog as useDialog2 } from "@toss-design-system/react-native";
|
|
968
1590
|
import { josa as josa2 } from "es-hangul";
|
|
969
|
-
import { forwardRef, useCallback as useCallback3, useEffect as
|
|
970
|
-
import { BackHandler, Platform as
|
|
971
|
-
import { closeView as closeView2, setIosSwipeGestureEnabled } from "react-native-bedrock";
|
|
1591
|
+
import { forwardRef, useCallback as useCallback3, useEffect as useEffect6, useState as useState2 } from "react";
|
|
1592
|
+
import { BackHandler, Platform as Platform11 } from "react-native";
|
|
972
1593
|
|
|
973
1594
|
// src/components/GameProfile.tsx
|
|
974
1595
|
import { Loader } from "@toss-design-system/react-native";
|
|
975
|
-
import { useEffect as
|
|
1596
|
+
import { useEffect as useEffect5 } from "react";
|
|
976
1597
|
import { Pressable, View } from "react-native";
|
|
977
1598
|
|
|
1599
|
+
// src/constant/game-center.ts
|
|
1600
|
+
var GAME_PROFILE_WEBVIEW_URL = "https://service.toss.im/game-center/profile";
|
|
1601
|
+
var GAME_CENTER_MIN_VERSION3 = {
|
|
1602
|
+
android: "5.221.0",
|
|
1603
|
+
ios: "5.221.0"
|
|
1604
|
+
};
|
|
1605
|
+
|
|
978
1606
|
// src/hooks/useGameCenterProfile.ts
|
|
1607
|
+
import { closeView as closeView3, openURL as openURL7 } from "@granite-js/react-native";
|
|
979
1608
|
import { useDialog } from "@toss-design-system/react-native";
|
|
980
1609
|
import { josa } from "es-hangul";
|
|
981
1610
|
import { useCallback as useCallback2, useRef as useRef2, useState } from "react";
|
|
982
|
-
import { closeView, openURL as openURL3 } from "react-native-bedrock";
|
|
983
1611
|
|
|
984
1612
|
// src/components/GameProfileToast.tsx
|
|
985
1613
|
import { Asset, Toast } from "@toss-design-system/react-native";
|
|
986
1614
|
import { AdaptiveColorProvider, ColorPreferenceProvider, useOverlay } from "@toss-design-system/react-native/private";
|
|
987
|
-
import { jsx as
|
|
1615
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
988
1616
|
var useGameProfileToast = () => {
|
|
989
1617
|
const overlay = useOverlay();
|
|
990
1618
|
const openGameProfileToast = (nickname, profileImageUri) => {
|
|
991
1619
|
return new Promise((resolve) => {
|
|
992
1620
|
overlay.open(({ isOpen, close, exit }) => {
|
|
993
|
-
return /* @__PURE__ */
|
|
1621
|
+
return /* @__PURE__ */ jsx3(ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ jsx3(AdaptiveColorProvider, { children: /* @__PURE__ */ jsx3(
|
|
994
1622
|
Toast,
|
|
995
1623
|
{
|
|
996
1624
|
open: isOpen,
|
|
@@ -1001,7 +1629,7 @@ var useGameProfileToast = () => {
|
|
|
1001
1629
|
onExited: exit,
|
|
1002
1630
|
position: "top",
|
|
1003
1631
|
text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
|
|
1004
|
-
icon: /* @__PURE__ */
|
|
1632
|
+
icon: /* @__PURE__ */ jsx3(
|
|
1005
1633
|
Asset.Image,
|
|
1006
1634
|
{
|
|
1007
1635
|
style: { borderRadius: 64, overflow: "hidden" },
|
|
@@ -1024,20 +1652,15 @@ var DEFAULT_ERROR = {
|
|
|
1024
1652
|
};
|
|
1025
1653
|
|
|
1026
1654
|
// src/utils/market.ts
|
|
1027
|
-
import { Platform as
|
|
1655
|
+
import { Platform as Platform7 } from "react-native";
|
|
1028
1656
|
var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
|
|
1029
1657
|
var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
|
|
1030
1658
|
var getMarketLink = () => {
|
|
1031
|
-
return
|
|
1659
|
+
return Platform7.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
|
|
1032
1660
|
};
|
|
1033
1661
|
|
|
1034
1662
|
// src/utils/openTransparentWebView.ts
|
|
1035
|
-
import { openURL as
|
|
1036
|
-
|
|
1037
|
-
// src/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
1038
|
-
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
1039
|
-
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
1040
|
-
}
|
|
1663
|
+
import { openURL as openURL6 } from "@granite-js/react-native";
|
|
1041
1664
|
|
|
1042
1665
|
// src/private.ts
|
|
1043
1666
|
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = onVisibilityChangedByTransparentServiceWeb;
|
|
@@ -1070,7 +1693,7 @@ var openTransparentWebView = ({
|
|
|
1070
1693
|
}
|
|
1071
1694
|
}
|
|
1072
1695
|
});
|
|
1073
|
-
|
|
1696
|
+
openURL6(url.toString());
|
|
1074
1697
|
};
|
|
1075
1698
|
|
|
1076
1699
|
// src/hooks/useGameCenterProfile.ts
|
|
@@ -1090,7 +1713,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
1090
1713
|
title: DEFAULT_ERROR.title,
|
|
1091
1714
|
description: DEFAULT_ERROR.description
|
|
1092
1715
|
});
|
|
1093
|
-
|
|
1716
|
+
closeView3();
|
|
1094
1717
|
}, [openAlert]);
|
|
1095
1718
|
const openProfileWebview = useCallback2(() => {
|
|
1096
1719
|
if (isWebviewLoading) {
|
|
@@ -1135,11 +1758,11 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
1135
1758
|
closeOnDimmerClick: true
|
|
1136
1759
|
});
|
|
1137
1760
|
if (!isConfirmed) {
|
|
1138
|
-
|
|
1761
|
+
closeView3();
|
|
1139
1762
|
return;
|
|
1140
1763
|
}
|
|
1141
1764
|
const STORE_SCHEME = getMarketLink();
|
|
1142
|
-
|
|
1765
|
+
openURL7(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
1143
1766
|
}, [openConfirm]);
|
|
1144
1767
|
return {
|
|
1145
1768
|
profileData,
|
|
@@ -1168,7 +1791,7 @@ var Z_INDEX = {
|
|
|
1168
1791
|
};
|
|
1169
1792
|
|
|
1170
1793
|
// src/components/GameProfile.tsx
|
|
1171
|
-
import { Fragment as
|
|
1794
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1172
1795
|
var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
1173
1796
|
const {
|
|
1174
1797
|
profileData,
|
|
@@ -1184,7 +1807,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1184
1807
|
openErrorAlert,
|
|
1185
1808
|
openGameProfileToast
|
|
1186
1809
|
} = useGameCenterProfile(isReadyForProfileUI);
|
|
1187
|
-
|
|
1810
|
+
useEffect5(() => {
|
|
1188
1811
|
try {
|
|
1189
1812
|
const getProfileData = async () => {
|
|
1190
1813
|
const data = await getGameCenterGameProfile();
|
|
@@ -1197,7 +1820,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1197
1820
|
setIsProfileDataLoading(false);
|
|
1198
1821
|
}
|
|
1199
1822
|
}, []);
|
|
1200
|
-
|
|
1823
|
+
useEffect5(() => {
|
|
1201
1824
|
const handleGameProfileFlow = async () => {
|
|
1202
1825
|
if (!canShowBottomSheetOrToast) {
|
|
1203
1826
|
return;
|
|
@@ -1206,7 +1829,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1206
1829
|
return;
|
|
1207
1830
|
}
|
|
1208
1831
|
isCompletedProfileFlow.current = true;
|
|
1209
|
-
if (!isMinVersionSupported(
|
|
1832
|
+
if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION3)) {
|
|
1210
1833
|
updateAppToSupportedMinVersion();
|
|
1211
1834
|
return;
|
|
1212
1835
|
}
|
|
@@ -1227,10 +1850,10 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1227
1850
|
profileData,
|
|
1228
1851
|
updateAppToSupportedMinVersion
|
|
1229
1852
|
]);
|
|
1230
|
-
if (!isMinVersionSupported(
|
|
1231
|
-
return /* @__PURE__ */ jsxs2(
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1853
|
+
if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION3)) {
|
|
1854
|
+
return /* @__PURE__ */ jsxs2(Fragment3, { children: [
|
|
1855
|
+
/* @__PURE__ */ jsx4(View, { style: { flex: 1, position: "relative" }, children }),
|
|
1856
|
+
/* @__PURE__ */ jsx4(
|
|
1234
1857
|
Pressable,
|
|
1235
1858
|
{
|
|
1236
1859
|
style: {
|
|
@@ -1244,9 +1867,9 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1244
1867
|
] });
|
|
1245
1868
|
}
|
|
1246
1869
|
if (shouldShowLoadingOverlay || isProfileDataRefetching) {
|
|
1247
|
-
return /* @__PURE__ */ jsxs2(
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1870
|
+
return /* @__PURE__ */ jsxs2(Fragment3, { children: [
|
|
1871
|
+
/* @__PURE__ */ jsx4(View, { style: { flex: 1, position: "relative" }, children }),
|
|
1872
|
+
/* @__PURE__ */ jsx4(
|
|
1250
1873
|
View,
|
|
1251
1874
|
{
|
|
1252
1875
|
style: {
|
|
@@ -1255,15 +1878,15 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1255
1878
|
alignItems: "center",
|
|
1256
1879
|
backgroundColor: "rgba(0, 0, 0, 0.2)"
|
|
1257
1880
|
},
|
|
1258
|
-
children: /* @__PURE__ */
|
|
1881
|
+
children: /* @__PURE__ */ jsx4(Loader, { size: "large", type: "light" })
|
|
1259
1882
|
}
|
|
1260
1883
|
)
|
|
1261
1884
|
] });
|
|
1262
1885
|
}
|
|
1263
1886
|
if (shouldShowProfileNotFoundOverlay) {
|
|
1264
|
-
return /* @__PURE__ */ jsxs2(
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
shouldShowProfileNotFoundOverlay && /* @__PURE__ */
|
|
1887
|
+
return /* @__PURE__ */ jsxs2(Fragment3, { children: [
|
|
1888
|
+
/* @__PURE__ */ jsx4(View, { style: { flex: 1, position: "relative" }, children }),
|
|
1889
|
+
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ jsx4(
|
|
1267
1890
|
Pressable,
|
|
1268
1891
|
{
|
|
1269
1892
|
style: {
|
|
@@ -1276,7 +1899,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1276
1899
|
)
|
|
1277
1900
|
] });
|
|
1278
1901
|
}
|
|
1279
|
-
return /* @__PURE__ */
|
|
1902
|
+
return /* @__PURE__ */ jsx4(Fragment3, { children: /* @__PURE__ */ jsx4(View, { style: { flex: 1, position: "relative" }, children }) });
|
|
1280
1903
|
};
|
|
1281
1904
|
var overlayStyle = {
|
|
1282
1905
|
position: "absolute",
|
|
@@ -1288,19 +1911,19 @@ var overlayStyle = {
|
|
|
1288
1911
|
};
|
|
1289
1912
|
|
|
1290
1913
|
// src/components/GameWebViewNavigationBar/GameNavigationBar.tsx
|
|
1291
|
-
import { SvgXml } from "@
|
|
1914
|
+
import { SvgXml } from "@granite-js/native/react-native-svg";
|
|
1292
1915
|
import { PageNavbar } from "@toss-design-system/react-native";
|
|
1293
|
-
import { Platform as
|
|
1916
|
+
import { Platform as Platform10, TouchableOpacity, View as View3 } from "react-native";
|
|
1294
1917
|
|
|
1295
1918
|
// src/components/GameWebViewNavigationBar/HeaderRight.tsx
|
|
1296
1919
|
import { StyleSheet, View as View2 } from "react-native";
|
|
1297
1920
|
|
|
1298
1921
|
// src/components/GameWebViewNavigationBar/byPlatform.ts
|
|
1299
|
-
import { Platform as
|
|
1922
|
+
import { Platform as Platform8 } from "react-native";
|
|
1300
1923
|
function byPlatform({
|
|
1301
1924
|
...props
|
|
1302
1925
|
}) {
|
|
1303
|
-
return (props[
|
|
1926
|
+
return (props[Platform8.OS] ?? props.fallback)();
|
|
1304
1927
|
}
|
|
1305
1928
|
|
|
1306
1929
|
// src/components/GameWebViewNavigationBar/constants.ts
|
|
@@ -1308,18 +1931,18 @@ var RIGHT_MARGIN = 24;
|
|
|
1308
1931
|
var IOS_DEFAULT_MARGIN = 20;
|
|
1309
1932
|
|
|
1310
1933
|
// src/components/GameWebViewNavigationBar/HeaderRight.tsx
|
|
1311
|
-
import { jsx as
|
|
1934
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1312
1935
|
function IOSHeaderRight(props) {
|
|
1313
|
-
return /* @__PURE__ */
|
|
1936
|
+
return /* @__PURE__ */ jsx5(View2, { style: styles.ios, ...props });
|
|
1314
1937
|
}
|
|
1315
1938
|
function AndroidHeaderRight(props) {
|
|
1316
|
-
return /* @__PURE__ */
|
|
1939
|
+
return /* @__PURE__ */ jsx5(View2, { style: styles.android, ...props });
|
|
1317
1940
|
}
|
|
1318
1941
|
function HeaderRight(props) {
|
|
1319
1942
|
return byPlatform({
|
|
1320
|
-
ios: () => /* @__PURE__ */
|
|
1321
|
-
android: () => /* @__PURE__ */
|
|
1322
|
-
fallback: () => /* @__PURE__ */
|
|
1943
|
+
ios: () => /* @__PURE__ */ jsx5(IOSHeaderRight, { ...props }),
|
|
1944
|
+
android: () => /* @__PURE__ */ jsx5(AndroidHeaderRight, { ...props }),
|
|
1945
|
+
fallback: () => /* @__PURE__ */ jsx5(IOSHeaderRight, { ...props })
|
|
1323
1946
|
});
|
|
1324
1947
|
}
|
|
1325
1948
|
var styles = StyleSheet.create({
|
|
@@ -1333,38 +1956,38 @@ var styles = StyleSheet.create({
|
|
|
1333
1956
|
});
|
|
1334
1957
|
|
|
1335
1958
|
// src/components/GameWebViewNavigationBar/useSafeAreaTop.ts
|
|
1336
|
-
import { useSafeAreaInsets } from "@
|
|
1337
|
-
import { Platform as
|
|
1959
|
+
import { useSafeAreaInsets } from "@granite-js/native/react-native-safe-area-context";
|
|
1960
|
+
import { Platform as Platform9 } from "react-native";
|
|
1338
1961
|
function useSafeAreaTop() {
|
|
1339
1962
|
const safeAreaInsets = useSafeAreaInsets();
|
|
1340
|
-
const hasDynamicIsland =
|
|
1963
|
+
const hasDynamicIsland = Platform9.OS === "ios" && safeAreaInsets.top > 50;
|
|
1341
1964
|
const safeAreaTop = hasDynamicIsland ? safeAreaInsets.top - 5 : safeAreaInsets.top;
|
|
1342
1965
|
return safeAreaTop;
|
|
1343
1966
|
}
|
|
1344
1967
|
|
|
1345
1968
|
// src/components/GameWebViewNavigationBar/GameNavigationBar.tsx
|
|
1346
|
-
import { Fragment as
|
|
1969
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1347
1970
|
var originXML = '<svg fill="none" height="30" viewBox="0 0 30 30" width="30" xmlns="https://www.w3.org/2000/svg"><rect fill="#031832" fill-opacity=".46" height="30" rx="15" width="30"/><rect height="29.5" rx="14.75" stroke="#d9d9ff" stroke-opacity=".11" stroke-width=".5" width="29.5" x=".25" y=".25"/><path clip-rule="evenodd" d="m16.5119 15.0014 4.7092-4.7092c.0929-.0928.1666-.2031.2169-.32441.0503-.12134.0762-.25141.0762-.38276.0001-.13136-.0258-.26144-.076-.38281s-.1239-.23166-.2167-.32457c-.0929-.09291-.2031-.16662-.3245-.21692-.1213-.05031-.2514-.07622-.3827-.07626-.1314-.00004-.2615.0258-.3828.07603-.1214.05023-.2317.12388-.3246.21673l-4.7092 4.70997-4.71-4.70997c-.1897-.17718-.4408-.27373-.70034-.26927s-.5072.10959-.69069.2932c-.1835.1836-.28848.43132-.29279.69087-.00432.25954.09238.51057.26968.70017l4.71004 4.7092-4.71004 4.7092c-.1392.1401-.23385.3183-.27204.5121-.0382.1939-.01823.3946.05739.5771s.20351.3386.36759.4486.35702.169.55456.1697c.25583 0 .51164-.0975.70664-.2925l4.71-4.71 4.7092 4.71c.0927.093.2029.1668.3243.2172.1213.0504.2514.0763.3828.0763s.2614-.0259.3828-.0763c.1213-.0504.2315-.1242.3243-.2172.0929-.0929.1667-.2032.217-.3246s.0762-.2515.0762-.3829-.0259-.2616-.0762-.383-.1241-.2317-.217-.3245z" fill="#fdfdfe" fill-opacity=".89" fill-rule="evenodd"/></svg>';
|
|
1348
1971
|
function GameNavigationBar({ onClose }) {
|
|
1349
1972
|
const safeAreaTop = useSafeAreaTop();
|
|
1350
|
-
return /* @__PURE__ */ jsxs3(
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
/* @__PURE__ */
|
|
1973
|
+
return /* @__PURE__ */ jsxs3(Fragment4, { children: [
|
|
1974
|
+
/* @__PURE__ */ jsx6(PageNavbar, { preference: { type: "none" } }),
|
|
1975
|
+
/* @__PURE__ */ jsx6(
|
|
1353
1976
|
View3,
|
|
1354
1977
|
{
|
|
1355
1978
|
style: {
|
|
1356
1979
|
width: "100%",
|
|
1357
|
-
height:
|
|
1980
|
+
height: Platform10.OS === "ios" ? 44 : 54,
|
|
1358
1981
|
flexDirection: "row",
|
|
1359
1982
|
alignItems: "center",
|
|
1360
1983
|
justifyContent: "flex-end",
|
|
1361
1984
|
position: "absolute",
|
|
1362
1985
|
zIndex: Z_INDEX.CLOSE_BUTTON,
|
|
1363
1986
|
marginTop: safeAreaTop,
|
|
1364
|
-
paddingRight:
|
|
1987
|
+
paddingRight: Platform10.OS === "ios" ? 10 : 8
|
|
1365
1988
|
},
|
|
1366
1989
|
pointerEvents: "box-none",
|
|
1367
|
-
children: /* @__PURE__ */
|
|
1990
|
+
children: /* @__PURE__ */ jsx6(HeaderRight, { children: /* @__PURE__ */ jsx6(
|
|
1368
1991
|
TouchableOpacity,
|
|
1369
1992
|
{
|
|
1370
1993
|
hitSlop: { left: 8, right: 8 },
|
|
@@ -1372,10 +1995,10 @@ function GameNavigationBar({ onClose }) {
|
|
|
1372
1995
|
accessible: true,
|
|
1373
1996
|
accessibilityLabel: "\uAC8C\uC784\uC885\uB8CC",
|
|
1374
1997
|
style: {
|
|
1375
|
-
padding:
|
|
1998
|
+
padding: Platform10.OS === "ios" ? 7 : 9
|
|
1376
1999
|
},
|
|
1377
2000
|
onPress: onClose,
|
|
1378
|
-
children: /* @__PURE__ */
|
|
2001
|
+
children: /* @__PURE__ */ jsx6(SvgXml, { xml: originXML, width: 30, height: 30 })
|
|
1379
2002
|
}
|
|
1380
2003
|
) })
|
|
1381
2004
|
}
|
|
@@ -1384,7 +2007,7 @@ function GameNavigationBar({ onClose }) {
|
|
|
1384
2007
|
}
|
|
1385
2008
|
|
|
1386
2009
|
// src/components/GameWebView.tsx
|
|
1387
|
-
import { Fragment as
|
|
2010
|
+
import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1388
2011
|
var GameWebView = forwardRef(function GameWebView2(props, ref) {
|
|
1389
2012
|
const { openConfirm } = useDialog2();
|
|
1390
2013
|
const { brandDisplayName } = getAppsInTossGlobals();
|
|
@@ -1399,11 +2022,11 @@ var GameWebView = forwardRef(function GameWebView2(props, ref) {
|
|
|
1399
2022
|
});
|
|
1400
2023
|
if (isConfirmed) {
|
|
1401
2024
|
captureExitLog(Date.now());
|
|
1402
|
-
|
|
2025
|
+
closeView4();
|
|
1403
2026
|
}
|
|
1404
2027
|
}, [brandDisplayName, captureExitLog, openConfirm]);
|
|
1405
|
-
|
|
1406
|
-
if (
|
|
2028
|
+
useEffect6(() => {
|
|
2029
|
+
if (Platform11.OS === "ios") {
|
|
1407
2030
|
setIosSwipeGestureEnabled({ isEnabled: false });
|
|
1408
2031
|
return () => {
|
|
1409
2032
|
setIosSwipeGestureEnabled({ isEnabled: true });
|
|
@@ -1411,7 +2034,7 @@ var GameWebView = forwardRef(function GameWebView2(props, ref) {
|
|
|
1411
2034
|
}
|
|
1412
2035
|
return;
|
|
1413
2036
|
}, []);
|
|
1414
|
-
|
|
2037
|
+
useEffect6(() => {
|
|
1415
2038
|
const backHandler = () => {
|
|
1416
2039
|
handleClose();
|
|
1417
2040
|
return true;
|
|
@@ -1421,16 +2044,16 @@ var GameWebView = forwardRef(function GameWebView2(props, ref) {
|
|
|
1421
2044
|
BackHandler.removeEventListener("hardwareBackPress", backHandler);
|
|
1422
2045
|
};
|
|
1423
2046
|
}, [handleClose]);
|
|
1424
|
-
|
|
2047
|
+
useEffect6(() => {
|
|
1425
2048
|
appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1426
2049
|
onEvent: () => {
|
|
1427
2050
|
setIsEntryMessageExited(true);
|
|
1428
2051
|
}
|
|
1429
2052
|
});
|
|
1430
2053
|
}, []);
|
|
1431
|
-
return /* @__PURE__ */ jsxs4(
|
|
1432
|
-
/* @__PURE__ */
|
|
1433
|
-
getOperationalEnvironment() === "toss" ? /* @__PURE__ */
|
|
2054
|
+
return /* @__PURE__ */ jsxs4(Fragment5, { children: [
|
|
2055
|
+
/* @__PURE__ */ jsx7(GameNavigationBar, { onClose: handleClose }),
|
|
2056
|
+
getOperationalEnvironment() === "toss" ? /* @__PURE__ */ jsx7(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ jsx7(PlainWebView, { ref, ...props }) }) : /* @__PURE__ */ jsx7(PlainWebView, { ref, ...props })
|
|
1434
2057
|
] });
|
|
1435
2058
|
});
|
|
1436
2059
|
|
|
@@ -1467,12 +2090,12 @@ function methodHandler({
|
|
|
1467
2090
|
};
|
|
1468
2091
|
wrappedFunc(...args).then((result) => {
|
|
1469
2092
|
injectJavaScript?.(`
|
|
1470
|
-
window.
|
|
2093
|
+
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/resolve/${eventId}', ${JSON.stringify(result, null, 0)});
|
|
1471
2094
|
`);
|
|
1472
2095
|
}).catch((error) => {
|
|
1473
2096
|
const serializedError = serializeError(error);
|
|
1474
2097
|
injectJavaScript?.(`
|
|
1475
|
-
window.
|
|
2098
|
+
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/reject/${eventId}', ${serializedError});
|
|
1476
2099
|
`);
|
|
1477
2100
|
});
|
|
1478
2101
|
}
|
|
@@ -1503,12 +2126,12 @@ function useBridgeHandler({
|
|
|
1503
2126
|
);
|
|
1504
2127
|
const createHandleOnEvent = (functionName, eventId) => (response) => {
|
|
1505
2128
|
ref.current?.injectJavaScript(`
|
|
1506
|
-
window.
|
|
2129
|
+
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onEvent/${eventId}', ${JSON.stringify(response, null, 0)});
|
|
1507
2130
|
`);
|
|
1508
2131
|
};
|
|
1509
2132
|
const createHandleOnError = (functionName, eventId) => (error) => {
|
|
1510
2133
|
ref.current?.injectJavaScript(`
|
|
1511
|
-
window.
|
|
2134
|
+
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${JSON.stringify(error, null, 0)});
|
|
1512
2135
|
`);
|
|
1513
2136
|
};
|
|
1514
2137
|
const $onMessage = useCallback4(
|
|
@@ -1561,24 +2184,8 @@ function useBridgeHandler({
|
|
|
1561
2184
|
};
|
|
1562
2185
|
}
|
|
1563
2186
|
|
|
1564
|
-
// src/constant-bridges.ts
|
|
1565
|
-
var constant_bridges_exports = {};
|
|
1566
|
-
__export(constant_bridges_exports, {
|
|
1567
|
-
getDeviceId: () => getDeviceId,
|
|
1568
|
-
getOperationalEnvironment: () => getOperationalEnvironment,
|
|
1569
|
-
getTossAppVersion: () => getTossAppVersion
|
|
1570
|
-
});
|
|
1571
|
-
|
|
1572
|
-
// src/event-bridges.ts
|
|
1573
|
-
var event_bridges_exports = {};
|
|
1574
|
-
__export(event_bridges_exports, {
|
|
1575
|
-
contactsViral: () => contactsViral,
|
|
1576
|
-
startUpdateLocation: () => startUpdateLocation
|
|
1577
|
-
});
|
|
1578
|
-
|
|
1579
2187
|
// src/hooks/useCreateUserAgent.ts
|
|
1580
2188
|
import { useWindowDimensions } from "react-native";
|
|
1581
|
-
import { getPlatformOS } from "react-native-bedrock";
|
|
1582
2189
|
var FontA11yCategory = {
|
|
1583
2190
|
Large: "Large",
|
|
1584
2191
|
xLarge: "xLarge",
|
|
@@ -1733,12 +2340,12 @@ function useCreateUserAgent({
|
|
|
1733
2340
|
}
|
|
1734
2341
|
|
|
1735
2342
|
// src/hooks/useGeolocation.ts
|
|
1736
|
-
import {
|
|
1737
|
-
import {
|
|
2343
|
+
import { useVisibility as useVisibility3 } from "@granite-js/react-native";
|
|
2344
|
+
import { useState as useState3, useEffect as useEffect7 } from "react";
|
|
1738
2345
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
1739
2346
|
const isVisible = useVisibility3();
|
|
1740
2347
|
const [location, setLocation] = useState3(null);
|
|
1741
|
-
|
|
2348
|
+
useEffect7(() => {
|
|
1742
2349
|
if (!isVisible) {
|
|
1743
2350
|
return;
|
|
1744
2351
|
}
|
|
@@ -1756,7 +2363,7 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
1756
2363
|
}
|
|
1757
2364
|
|
|
1758
2365
|
// src/utils/log.ts
|
|
1759
|
-
import { getSchemeUri as
|
|
2366
|
+
import { getSchemeUri as getSchemeUri6 } from "@granite-js/react-native";
|
|
1760
2367
|
|
|
1761
2368
|
// src/utils/extractDateFromUUIDv7.ts
|
|
1762
2369
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -1782,7 +2389,7 @@ var getGroupId = (url) => {
|
|
|
1782
2389
|
};
|
|
1783
2390
|
var getReferrer = () => {
|
|
1784
2391
|
try {
|
|
1785
|
-
const referrer = new URL(
|
|
2392
|
+
const referrer = new URL(getSchemeUri6());
|
|
1786
2393
|
return referrer.searchParams.get("referrer");
|
|
1787
2394
|
} catch {
|
|
1788
2395
|
return "";
|
|
@@ -1804,9 +2411,9 @@ var trackScreen = (url) => {
|
|
|
1804
2411
|
};
|
|
1805
2412
|
|
|
1806
2413
|
// src/components/WebView.tsx
|
|
1807
|
-
import { jsx as
|
|
2414
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1808
2415
|
var appsInTossGlobals = getAppsInTossGlobals();
|
|
1809
|
-
var operationalEnvironment =
|
|
2416
|
+
var operationalEnvironment = getOperationalEnvironment2();
|
|
1810
2417
|
var TYPES = ["partner", "external", "game"];
|
|
1811
2418
|
var WEBVIEW_TYPES = {
|
|
1812
2419
|
partner: PartnerWebViewScreen,
|
|
@@ -1815,7 +2422,7 @@ var WEBVIEW_TYPES = {
|
|
|
1815
2422
|
};
|
|
1816
2423
|
function mergeSchemeQueryParamsInto(url) {
|
|
1817
2424
|
const baseUrl = new URL(url);
|
|
1818
|
-
const schemeUrl = new URL(
|
|
2425
|
+
const schemeUrl = new URL(getSchemeUri7());
|
|
1819
2426
|
baseUrl.pathname = schemeUrl.pathname;
|
|
1820
2427
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
1821
2428
|
baseUrl.searchParams.set(key, value);
|
|
@@ -1839,7 +2446,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1839
2446
|
if (!TYPES.includes(type)) {
|
|
1840
2447
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
1841
2448
|
}
|
|
1842
|
-
const
|
|
2449
|
+
const graniteEvent = useGraniteEvent();
|
|
1843
2450
|
const uri = useMemo3(() => getWebViewUri(local), [local]);
|
|
1844
2451
|
const top = useSafeAreaTop2();
|
|
1845
2452
|
const bottom = useSafeAreaBottom();
|
|
@@ -1852,6 +2459,9 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1852
2459
|
document.head.appendChild(style);
|
|
1853
2460
|
})();
|
|
1854
2461
|
`;
|
|
2462
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = useState4(
|
|
2463
|
+
props.allowsBackForwardNavigationGestures
|
|
2464
|
+
);
|
|
1855
2465
|
const handler = useBridgeHandler({
|
|
1856
2466
|
onMessage,
|
|
1857
2467
|
injectedJavaScript: [disableTextSelectionCSS].join("\n"),
|
|
@@ -1862,7 +2472,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1862
2472
|
onEvent,
|
|
1863
2473
|
onError
|
|
1864
2474
|
}),
|
|
1865
|
-
backEvent: ({ onEvent, onError, options }) =>
|
|
2475
|
+
backEvent: ({ onEvent, onError, options }) => graniteEvent.addEventListener("backEvent", { onEvent, onError, options }),
|
|
1866
2476
|
entryMessageExited: ({ onEvent, onError }) => appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
1867
2477
|
updateLocationEvent: ({ onEvent, onError, options }) => appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
1868
2478
|
/** @internal */
|
|
@@ -1874,7 +2484,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1874
2484
|
showAdMobRewardedAd: GoogleAdMob.showAdMobRewardedAd
|
|
1875
2485
|
},
|
|
1876
2486
|
constantHandlerMap: {
|
|
1877
|
-
...
|
|
2487
|
+
...graniteConstantBridges,
|
|
1878
2488
|
...constant_bridges_exports,
|
|
1879
2489
|
getSafeAreaTop: () => top,
|
|
1880
2490
|
getSafeAreaBottom: () => bottom,
|
|
@@ -1888,8 +2498,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1888
2498
|
getDeploymentId: env.getDeploymentId
|
|
1889
2499
|
},
|
|
1890
2500
|
asyncHandlerMap: {
|
|
1891
|
-
...
|
|
2501
|
+
...graniteAsyncBridges,
|
|
1892
2502
|
...async_bridges_exports,
|
|
2503
|
+
setIosSwipeGestureEnabled: (options) => {
|
|
2504
|
+
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
2505
|
+
return setIosSwipeGestureEnabled2(options);
|
|
2506
|
+
},
|
|
1893
2507
|
addAccessoryButton: async (params) => partner.addAccessoryButton(params),
|
|
1894
2508
|
removeAccessoryButton: async () => partner.removeAccessoryButton(),
|
|
1895
2509
|
/** internal */
|
|
@@ -1954,11 +2568,11 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1954
2568
|
return false;
|
|
1955
2569
|
}
|
|
1956
2570
|
}, [canHistoryGoBack, handler]);
|
|
1957
|
-
|
|
2571
|
+
useEffect8(() => {
|
|
1958
2572
|
BackHandler2.addEventListener("hardwareBackPress", handleBackEvent);
|
|
1959
2573
|
return () => BackHandler2.removeEventListener("hardwareBackPress", handleBackEvent);
|
|
1960
2574
|
}, [handleBackEvent]);
|
|
1961
|
-
return /* @__PURE__ */
|
|
2575
|
+
return /* @__PURE__ */ jsx8(
|
|
1962
2576
|
BaseWebView,
|
|
1963
2577
|
{
|
|
1964
2578
|
ref: handler.ref,
|
|
@@ -1971,7 +2585,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1971
2585
|
"User-Agent": userAgent
|
|
1972
2586
|
}
|
|
1973
2587
|
},
|
|
1974
|
-
userAgent:
|
|
2588
|
+
userAgent: Platform12.OS === "ios" ? userAgent : void 0,
|
|
1975
2589
|
sharedCookiesEnabled: true,
|
|
1976
2590
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
1977
2591
|
thirdPartyCookiesEnabled: true,
|
|
@@ -1979,7 +2593,8 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1979
2593
|
onNavigationStateChange: handleNavigationStateChange,
|
|
1980
2594
|
injectedJavaScript: handler.injectedJavaScript,
|
|
1981
2595
|
injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
|
|
1982
|
-
decelerationRate:
|
|
2596
|
+
decelerationRate: Platform12.OS === "ios" ? 1 : void 0,
|
|
2597
|
+
allowsBackForwardNavigationGestures
|
|
1983
2598
|
}
|
|
1984
2599
|
);
|
|
1985
2600
|
}
|
|
@@ -1990,17 +2605,6 @@ function ensureValue(value, name) {
|
|
|
1990
2605
|
return value;
|
|
1991
2606
|
}
|
|
1992
2607
|
|
|
1993
|
-
// src/types.ts
|
|
1994
|
-
var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
|
|
1995
|
-
Accuracy3[Accuracy3["Lowest"] = 1] = "Lowest";
|
|
1996
|
-
Accuracy3[Accuracy3["Low"] = 2] = "Low";
|
|
1997
|
-
Accuracy3[Accuracy3["Balanced"] = 3] = "Balanced";
|
|
1998
|
-
Accuracy3[Accuracy3["High"] = 4] = "High";
|
|
1999
|
-
Accuracy3[Accuracy3["Highest"] = 5] = "Highest";
|
|
2000
|
-
Accuracy3[Accuracy3["BestForNavigation"] = 6] = "BestForNavigation";
|
|
2001
|
-
return Accuracy3;
|
|
2002
|
-
})(Accuracy2 || {});
|
|
2003
|
-
|
|
2004
2608
|
// src/index.ts
|
|
2005
2609
|
export * from "@apps-in-toss/analytics";
|
|
2006
2610
|
var Analytics2 = {
|
|
@@ -2010,35 +2614,52 @@ var Analytics2 = {
|
|
|
2010
2614
|
Area: InternalAnalytics.Area
|
|
2011
2615
|
};
|
|
2012
2616
|
export {
|
|
2013
|
-
|
|
2617
|
+
Accuracy,
|
|
2014
2618
|
Analytics2 as Analytics,
|
|
2015
2619
|
AppsInToss,
|
|
2620
|
+
AppsInTossModule,
|
|
2621
|
+
BedrockCoreModule,
|
|
2622
|
+
BedrockModule,
|
|
2016
2623
|
GoogleAdMob,
|
|
2017
2624
|
IAP,
|
|
2625
|
+
AppsInTossModuleInstance as INTERNAL__AppsInTossModule,
|
|
2626
|
+
INTERNAL__module,
|
|
2018
2627
|
INTERNAL__onVisibilityChangedByTransparentServiceWeb,
|
|
2019
2628
|
Storage,
|
|
2020
2629
|
TossPay,
|
|
2021
2630
|
WebView,
|
|
2022
2631
|
appLogin,
|
|
2023
2632
|
appsInTossEvent,
|
|
2633
|
+
closeView,
|
|
2024
2634
|
contactsViral,
|
|
2025
2635
|
env,
|
|
2026
2636
|
eventLog,
|
|
2027
2637
|
fetchAlbumPhotos,
|
|
2028
2638
|
fetchContacts,
|
|
2639
|
+
generateHapticFeedback,
|
|
2029
2640
|
getClipboardText,
|
|
2030
2641
|
getCurrentLocation,
|
|
2031
2642
|
getDeviceId,
|
|
2032
2643
|
getGameCenterGameProfile,
|
|
2644
|
+
getLocale,
|
|
2645
|
+
getNetworkStatus,
|
|
2033
2646
|
getOperationalEnvironment,
|
|
2647
|
+
getPlatformOS,
|
|
2648
|
+
getSchemeUri,
|
|
2034
2649
|
getTossAppVersion,
|
|
2035
2650
|
getTossShareLink,
|
|
2036
2651
|
isMinVersionSupported,
|
|
2652
|
+
onVisibilityChangedByTransparentServiceWeb,
|
|
2037
2653
|
openCamera,
|
|
2038
2654
|
openGameCenterLeaderboard,
|
|
2655
|
+
openURL2 as openURL,
|
|
2039
2656
|
saveBase64Data,
|
|
2040
2657
|
setClipboardText,
|
|
2041
2658
|
setDeviceOrientation,
|
|
2659
|
+
setIosSwipeGestureEnabled,
|
|
2660
|
+
setScreenAwakeMode,
|
|
2661
|
+
setSecureScreen,
|
|
2662
|
+
share,
|
|
2042
2663
|
startUpdateLocation,
|
|
2043
2664
|
submitGameCenterLeaderBoardScore,
|
|
2044
2665
|
useCreateUserAgent,
|