@apps-in-toss/framework 1.0.0 → 1.0.1
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 +3 -200
- package/dist/index.cjs +149 -1540
- package/dist/index.js +71 -1426
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1,702 +1,15 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
1
|
// src/index.ts
|
|
8
2
|
import { Analytics as InternalAnalytics } from "@apps-in-toss/analytics";
|
|
9
3
|
|
|
10
4
|
// src/core/registerApp.tsx
|
|
11
5
|
import { Analytics } from "@apps-in-toss/analytics";
|
|
12
|
-
|
|
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";
|
|
21
|
-
import { Platform } from "react-native";
|
|
22
|
-
|
|
23
|
-
// ../../.yarn/cache/es-toolkit-npm-1.39.3-b94f623c91-1c85e518b1.zip/node_modules/es-toolkit/dist/function/noop.mjs
|
|
24
|
-
function noop() {
|
|
25
|
-
}
|
|
26
|
-
|
|
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 {
|
|
36
|
-
name = "entryMessageExited";
|
|
37
|
-
remove() {
|
|
38
|
-
}
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
40
|
-
listener(_) {
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
var Module = TurboModuleRegistry.getEnforcing("AppsInTossModule");
|
|
44
|
-
var AppsInTossModuleInstance = Module;
|
|
45
|
-
var AppsInTossModule = Module;
|
|
46
|
-
function getPermission(permission) {
|
|
47
|
-
return AppsInTossModule.getPermission(permission);
|
|
48
|
-
}
|
|
49
|
-
function openPermissionDialog(permission) {
|
|
50
|
-
return AppsInTossModule.openPermissionDialog(permission);
|
|
51
|
-
}
|
|
52
|
-
async function requestPermission(permission) {
|
|
53
|
-
const permissionStatus = await getPermission(permission);
|
|
54
|
-
switch (permissionStatus) {
|
|
55
|
-
case "allowed":
|
|
56
|
-
case "denied":
|
|
57
|
-
return permissionStatus;
|
|
58
|
-
default:
|
|
59
|
-
return openPermissionDialog(permission);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
var nativeEventEmitter = new NativeEventEmitter(AppsInTossModuleInstance);
|
|
63
|
-
var UpdateLocationEvent = class extends GraniteEventDefinition2 {
|
|
64
|
-
name = "updateLocationEvent";
|
|
65
|
-
subscriptionCount = 0;
|
|
66
|
-
ref = {
|
|
67
|
-
remove: () => {
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
remove() {
|
|
71
|
-
if (--this.subscriptionCount === 0) {
|
|
72
|
-
AppsInTossModuleInstance.stopUpdateLocation({});
|
|
73
|
-
}
|
|
74
|
-
this.ref.remove();
|
|
75
|
-
}
|
|
76
|
-
listener(options, onEvent, onError) {
|
|
77
|
-
requestPermission({ name: "geolocation", access: "access" }).then((permissionStatus) => {
|
|
78
|
-
if (permissionStatus === "denied") {
|
|
79
|
-
onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
void AppsInTossModuleInstance.startUpdateLocation(options).catch(onError);
|
|
83
|
-
const subscription = nativeEventEmitter.addListener("updateLocation", onEvent);
|
|
84
|
-
this.ref = {
|
|
85
|
-
remove: () => subscription?.remove()
|
|
86
|
-
};
|
|
87
|
-
this.subscriptionCount++;
|
|
88
|
-
}).catch(onError);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
function generateUUID(placeholder) {
|
|
92
|
-
return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
|
|
93
|
-
}
|
|
94
|
-
var INTERNAL__callbacks = /* @__PURE__ */ new Map();
|
|
95
|
-
function invokeAppBridgeCallback(id, ...args) {
|
|
96
|
-
const callback = INTERNAL__callbacks.get(id);
|
|
97
|
-
callback?.call(null, ...args);
|
|
98
|
-
return Boolean(callback);
|
|
99
|
-
}
|
|
100
|
-
function invokeAppBridgeMethod(methodName, params, callbacks) {
|
|
101
|
-
const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
|
|
102
|
-
const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
|
|
103
|
-
const promise = AppsInTossModuleInstance[methodName]({
|
|
104
|
-
params,
|
|
105
|
-
callbacks: callbackMap
|
|
106
|
-
});
|
|
107
|
-
void promise.then(onSuccess).catch(onError);
|
|
108
|
-
return unregisterAll;
|
|
109
|
-
}
|
|
110
|
-
function registerCallbacks(callbacks) {
|
|
111
|
-
const callbackMap = {};
|
|
112
|
-
for (const [callbackName, callback] of Object.entries(callbacks)) {
|
|
113
|
-
const id = registerCallback(callback, callbackName);
|
|
114
|
-
callbackMap[callbackName] = id;
|
|
115
|
-
}
|
|
116
|
-
const unregisterAll = () => {
|
|
117
|
-
Object.values(callbackMap).forEach(unregisterCallback);
|
|
118
|
-
};
|
|
119
|
-
return { callbackMap, unregisterAll };
|
|
120
|
-
}
|
|
121
|
-
function registerCallback(callback, name = "unnamed") {
|
|
122
|
-
const uniqueId = generateUUID();
|
|
123
|
-
const callbackId = `${uniqueId}__${name}`;
|
|
124
|
-
INTERNAL__callbacks.set(callbackId, callback);
|
|
125
|
-
return callbackId;
|
|
126
|
-
}
|
|
127
|
-
function unregisterCallback(id) {
|
|
128
|
-
INTERNAL__callbacks.delete(id);
|
|
129
|
-
}
|
|
130
|
-
function getCallbackIds() {
|
|
131
|
-
return Array.from(INTERNAL__callbacks.keys());
|
|
132
|
-
}
|
|
133
|
-
var INTERNAL__appBridgeHandler = {
|
|
134
|
-
invokeAppBridgeCallback,
|
|
135
|
-
invokeAppBridgeMethod,
|
|
136
|
-
registerCallback,
|
|
137
|
-
unregisterCallback,
|
|
138
|
-
getCallbackIds
|
|
139
|
-
};
|
|
140
|
-
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
141
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventDefinition3 {
|
|
142
|
-
static INTERNAL__appBridgeSubscription;
|
|
143
|
-
name = "appBridgeCallbackEvent";
|
|
144
|
-
constructor() {
|
|
145
|
-
super();
|
|
146
|
-
this.registerAppBridgeCallbackEventListener();
|
|
147
|
-
}
|
|
148
|
-
remove() {
|
|
149
|
-
}
|
|
150
|
-
listener() {
|
|
151
|
-
}
|
|
152
|
-
registerAppBridgeCallbackEventListener() {
|
|
153
|
-
if (_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription != null) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter.addListener(
|
|
157
|
-
"appBridgeCallback",
|
|
158
|
-
this.ensureInvokeAppBridgeCallback
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
ensureInvokeAppBridgeCallback(result) {
|
|
162
|
-
if (typeof result === "object" && typeof result.name === "string") {
|
|
163
|
-
INTERNAL__appBridgeHandler.invokeAppBridgeCallback(result.name, result.params);
|
|
164
|
-
} else {
|
|
165
|
-
console.warn("Invalid app bridge callback result:", result);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDefinition4 {
|
|
170
|
-
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
171
|
-
subscription = null;
|
|
172
|
-
remove() {
|
|
173
|
-
this.subscription?.remove();
|
|
174
|
-
this.subscription = null;
|
|
175
|
-
}
|
|
176
|
-
listener(options, onEvent, onError) {
|
|
177
|
-
const subscription = nativeEventEmitter.addListener("visibilityChangedByTransparentServiceWeb", (params) => {
|
|
178
|
-
if (this.isVisibilityChangedByTransparentServiceWebResult(params)) {
|
|
179
|
-
if (params.callbackId === options.callbackId) {
|
|
180
|
-
onEvent(params.isVisible);
|
|
181
|
-
}
|
|
182
|
-
} else {
|
|
183
|
-
onError(new Error("Invalid visibility changed by transparent service web result"));
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
this.subscription = subscription;
|
|
187
|
-
}
|
|
188
|
-
isVisibilityChangedByTransparentServiceWebResult(params) {
|
|
189
|
-
return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
var appsInTossEvent = new GraniteEvent([
|
|
193
|
-
new UpdateLocationEvent(),
|
|
194
|
-
new EntryMessageExitedEvent(),
|
|
195
|
-
// Internal events
|
|
196
|
-
new AppBridgeCallbackEvent(),
|
|
197
|
-
new VisibilityChangedByTransparentServiceWebEvent()
|
|
198
|
-
]);
|
|
199
|
-
function startUpdateLocation(eventParams) {
|
|
200
|
-
return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
|
|
201
|
-
}
|
|
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
|
|
6
|
+
import { isMinVersionSupported, setIosSwipeGestureEnabled, eventLog } from "@apps-in-toss/native-modules";
|
|
695
7
|
import { Granite as Granite3 } from "@granite-js/react-native";
|
|
696
8
|
import { TDSProvider } from "@toss-design-system/react-native";
|
|
697
9
|
|
|
698
10
|
// src/core/components/AppEvent.tsx
|
|
699
|
-
import {
|
|
11
|
+
import { INTERNAL__module as INTERNAL__module2 } from "@apps-in-toss/native-modules";
|
|
12
|
+
import { Granite as Granite2, getSchemeUri as getSchemeUri3, useVisibility as useVisibility2 } from "@granite-js/react-native";
|
|
700
13
|
import { useEffect as useEffect2 } from "react";
|
|
701
14
|
|
|
702
15
|
// src/env.ts
|
|
@@ -705,16 +18,17 @@ var env = {
|
|
|
705
18
|
};
|
|
706
19
|
|
|
707
20
|
// src/hooks/useCaptureExitLog.ts
|
|
21
|
+
import { INTERNAL__module } from "@apps-in-toss/native-modules";
|
|
708
22
|
import { Granite, useVisibility } from "@granite-js/react-native";
|
|
709
23
|
import { useCallback, useEffect, useRef } from "react";
|
|
710
24
|
|
|
711
25
|
// src/core/hooks/useReferrer.ts
|
|
712
|
-
import { getSchemeUri
|
|
26
|
+
import { getSchemeUri } from "@granite-js/react-native";
|
|
713
27
|
import { useMemo } from "react";
|
|
714
28
|
function useReferrer() {
|
|
715
29
|
return useMemo(() => {
|
|
716
30
|
try {
|
|
717
|
-
return new URL(
|
|
31
|
+
return new URL(getSchemeUri()).searchParams.get("referrer");
|
|
718
32
|
} catch {
|
|
719
33
|
return null;
|
|
720
34
|
}
|
|
@@ -722,10 +36,10 @@ function useReferrer() {
|
|
|
722
36
|
}
|
|
723
37
|
|
|
724
38
|
// src/utils/isPrivateScheme.ts
|
|
725
|
-
import { getSchemeUri as
|
|
39
|
+
import { getSchemeUri as getSchemeUri2 } from "@granite-js/react-native";
|
|
726
40
|
function isPrivateScheme() {
|
|
727
41
|
try {
|
|
728
|
-
return new URL(
|
|
42
|
+
return new URL(getSchemeUri2()).protocol === "intoss-private:";
|
|
729
43
|
} catch {
|
|
730
44
|
return false;
|
|
731
45
|
}
|
|
@@ -775,7 +89,7 @@ var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
|
|
|
775
89
|
function EntryAppEvent() {
|
|
776
90
|
const referrer = useReferrer() ?? "";
|
|
777
91
|
useEffect2(() => {
|
|
778
|
-
|
|
92
|
+
INTERNAL__module2.tossCoreEventLog({
|
|
779
93
|
log_name: "appsintoss_app_visit::impression__enter_appsintoss",
|
|
780
94
|
log_type: "info",
|
|
781
95
|
params: {
|
|
@@ -792,12 +106,12 @@ function EntryAppEvent() {
|
|
|
792
106
|
}
|
|
793
107
|
function SystemAppEvent({ ...initialProps }) {
|
|
794
108
|
useEffect2(() => {
|
|
795
|
-
|
|
109
|
+
INTERNAL__module2.tossCoreEventLog({
|
|
796
110
|
log_name: "AppsInTossInitialProps",
|
|
797
111
|
log_type: "debug",
|
|
798
112
|
params: {
|
|
799
113
|
...initialProps,
|
|
800
|
-
schemeUri:
|
|
114
|
+
schemeUri: getSchemeUri3(),
|
|
801
115
|
deployment_id: env.getDeploymentId(),
|
|
802
116
|
app_name: Granite2.appName,
|
|
803
117
|
is_private: isPrivateScheme()
|
|
@@ -823,18 +137,19 @@ var AppEvent = {
|
|
|
823
137
|
};
|
|
824
138
|
|
|
825
139
|
// src/core/components/AppUpdate.tsx
|
|
826
|
-
import { openURL
|
|
140
|
+
import { openURL } from "@granite-js/react-native";
|
|
827
141
|
import { useEffect as useEffect3 } from "react";
|
|
828
142
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
829
143
|
var UPDATE_SCHEME = "servicetoss://update/forced/j?updateType=required";
|
|
830
144
|
function AppUpdate() {
|
|
831
145
|
useEffect3(() => {
|
|
832
|
-
|
|
146
|
+
openURL(`supertoss://closePage?url=${UPDATE_SCHEME}`);
|
|
833
147
|
}, []);
|
|
834
148
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
835
149
|
}
|
|
836
150
|
|
|
837
151
|
// src/core/hooks/useAppsInTossBridge.ts
|
|
152
|
+
import { appsInTossEvent } from "@apps-in-toss/native-modules";
|
|
838
153
|
import { useBridge } from "@toss-design-system/react-native";
|
|
839
154
|
import { useEffect as useEffect4 } from "react";
|
|
840
155
|
|
|
@@ -871,646 +186,6 @@ function useAppsInTossBridge() {
|
|
|
871
186
|
}, []);
|
|
872
187
|
}
|
|
873
188
|
|
|
874
|
-
// ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/async-bridges.ts
|
|
875
|
-
var async_bridges_exports = {};
|
|
876
|
-
__export(async_bridges_exports, {
|
|
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
|
|
900
|
-
});
|
|
901
|
-
|
|
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" });
|
|
981
|
-
if (permissionStatus === "denied") {
|
|
982
|
-
throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
983
|
-
}
|
|
984
|
-
return AppsInTossModule2.setClipboardText({ text });
|
|
985
|
-
}
|
|
986
|
-
|
|
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" });
|
|
990
|
-
if (permissionStatus === "denied") {
|
|
991
|
-
throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
992
|
-
}
|
|
993
|
-
return AppsInTossModule2.getClipboardText({});
|
|
994
|
-
}
|
|
995
|
-
|
|
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" });
|
|
999
|
-
if (permissionStatus === "denied") {
|
|
1000
|
-
throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
1001
|
-
}
|
|
1002
|
-
const contacts = await AppsInTossModule2.fetchContacts(options);
|
|
1003
|
-
return {
|
|
1004
|
-
result: contacts.result,
|
|
1005
|
-
nextOffset: contacts.nextOffset ?? null,
|
|
1006
|
-
done: contacts.done
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
|
|
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" });
|
|
1015
|
-
if (permissionStatus === "denied") {
|
|
1016
|
-
throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
1017
|
-
}
|
|
1018
|
-
const albumPhotos = await AppsInTossModule2.fetchAlbumPhotos({
|
|
1019
|
-
...options,
|
|
1020
|
-
maxCount: options.maxCount ?? DEFAULT_MAX_COUNT2,
|
|
1021
|
-
maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH2
|
|
1022
|
-
});
|
|
1023
|
-
return albumPhotos;
|
|
1024
|
-
}
|
|
1025
|
-
|
|
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" });
|
|
1029
|
-
if (permissionStatus === "denied") {
|
|
1030
|
-
throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
1031
|
-
}
|
|
1032
|
-
const position = await AppsInTossModule2.getCurrentLocation(options);
|
|
1033
|
-
return position;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
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" });
|
|
1039
|
-
if (permissionStatus === "denied") {
|
|
1040
|
-
throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
1041
|
-
}
|
|
1042
|
-
const photo = await AppsInTossModule2.openCamera({ base64: false, maxWidth: 1024, ...options });
|
|
1043
|
-
return photo;
|
|
1044
|
-
}
|
|
1045
|
-
|
|
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({});
|
|
1049
|
-
}
|
|
1050
|
-
|
|
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;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
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) {
|
|
1144
|
-
return Object.fromEntries(
|
|
1145
|
-
Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
|
|
1146
|
-
);
|
|
1147
|
-
}
|
|
1148
|
-
async function eventLog2(params) {
|
|
1149
|
-
if (AppsInTossModule2.operationalEnvironment === "sandbox") {
|
|
1150
|
-
console.log("[eventLogDebug]", {
|
|
1151
|
-
log_name: params.log_name,
|
|
1152
|
-
log_type: params.log_type,
|
|
1153
|
-
params: normalizeParams2(params.params)
|
|
1154
|
-
});
|
|
1155
|
-
return;
|
|
1156
|
-
}
|
|
1157
|
-
const isSupported = isMinVersionSupported2({
|
|
1158
|
-
android: "5.208.0",
|
|
1159
|
-
ios: "5.208.0"
|
|
1160
|
-
});
|
|
1161
|
-
if (!isSupported) {
|
|
1162
|
-
return;
|
|
1163
|
-
}
|
|
1164
|
-
return AppsInTossModule2.eventLog({
|
|
1165
|
-
log_name: params.log_name,
|
|
1166
|
-
log_type: params.log_type,
|
|
1167
|
-
params: normalizeParams2(params.params)
|
|
1168
|
-
});
|
|
1169
|
-
}
|
|
1170
|
-
|
|
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({});
|
|
1174
|
-
const shareUrl = new URL(shareLink);
|
|
1175
|
-
shareUrl.searchParams.set("deep_link_value", path);
|
|
1176
|
-
shareUrl.searchParams.set("af_dp", path);
|
|
1177
|
-
return shareUrl.toString();
|
|
1178
|
-
}
|
|
1179
|
-
|
|
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({
|
|
1183
|
-
android: "5.215.0",
|
|
1184
|
-
ios: "5.215.0"
|
|
1185
|
-
});
|
|
1186
|
-
if (!isSupported) {
|
|
1187
|
-
return;
|
|
1188
|
-
}
|
|
1189
|
-
return AppsInTossModule2.setDeviceOrientation(options);
|
|
1190
|
-
}
|
|
1191
|
-
|
|
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({
|
|
1200
|
-
android: "5.218.0",
|
|
1201
|
-
ios: "5.216.0"
|
|
1202
|
-
});
|
|
1203
|
-
if (!isSupported) {
|
|
1204
|
-
console.warn("saveBase64Data is not supported in this app version");
|
|
1205
|
-
return;
|
|
1206
|
-
}
|
|
1207
|
-
await AppsInTossModule2.saveBase64Data(params);
|
|
1208
|
-
}
|
|
1209
|
-
|
|
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 = {
|
|
1212
|
-
android: "5.221.0",
|
|
1213
|
-
ios: "5.221.0"
|
|
1214
|
-
};
|
|
1215
|
-
|
|
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({});
|
|
1223
|
-
}
|
|
1224
|
-
|
|
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());
|
|
1239
|
-
}
|
|
1240
|
-
|
|
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);
|
|
1244
|
-
if (!isSupported) {
|
|
1245
|
-
return;
|
|
1246
|
-
}
|
|
1247
|
-
return AppsInTossModule2.submitGameCenterLeaderBoardScore(params);
|
|
1248
|
-
}
|
|
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);
|
|
1267
|
-
}
|
|
1268
|
-
return locale;
|
|
1269
|
-
}
|
|
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
|
-
}
|
|
1320
|
-
};
|
|
1321
|
-
|
|
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);
|
|
1365
|
-
}
|
|
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
|
|
1380
|
-
});
|
|
1381
|
-
void promise.then(onSuccess).catch(onError);
|
|
1382
|
-
return unregisterAll;
|
|
1383
|
-
}
|
|
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 };
|
|
1394
|
-
}
|
|
1395
|
-
function registerCallback2(callback, name = "unnamed") {
|
|
1396
|
-
const uniqueId = generateUUID2();
|
|
1397
|
-
const callbackId = `${uniqueId}__${name}`;
|
|
1398
|
-
INTERNAL__callbacks2.set(callbackId, callback);
|
|
1399
|
-
return callbackId;
|
|
1400
|
-
}
|
|
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
|
|
1413
|
-
};
|
|
1414
|
-
|
|
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({
|
|
1494
|
-
android: "5.223.0",
|
|
1495
|
-
ios: "5.223.0"
|
|
1496
|
-
});
|
|
1497
|
-
if (!isSupported) {
|
|
1498
|
-
return () => {
|
|
1499
|
-
};
|
|
1500
|
-
}
|
|
1501
|
-
const { onEvent, onError, options } = params;
|
|
1502
|
-
const unregisterCallbacks = INTERNAL__appBridgeHandler2.invokeAppBridgeMethod("contactsViral", options, {
|
|
1503
|
-
onRewardFromContactsViral: (result) => {
|
|
1504
|
-
onEvent({ type: "sendViral", data: result });
|
|
1505
|
-
},
|
|
1506
|
-
onSuccess: (result) => {
|
|
1507
|
-
onEvent({ type: "close", data: result });
|
|
1508
|
-
},
|
|
1509
|
-
onError
|
|
1510
|
-
});
|
|
1511
|
-
return unregisterCallbacks;
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
189
|
// src/core/registerApp.tsx
|
|
1515
190
|
import { Fragment as Fragment2, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
1516
191
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
@@ -1537,12 +212,13 @@ function TDSContainer({ children }) {
|
|
|
1537
212
|
}
|
|
1538
213
|
function registerApp(container, { context, analytics }) {
|
|
1539
214
|
Analytics.init({
|
|
1540
|
-
logger: (params) => void
|
|
215
|
+
logger: (params) => void eventLog(params),
|
|
1541
216
|
debug: analytics?.debug ?? __DEV__
|
|
1542
217
|
});
|
|
1543
218
|
const App = Granite3.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1544
219
|
appName: getAppName(),
|
|
1545
220
|
context,
|
|
221
|
+
setIosSwipeGestureEnabled,
|
|
1546
222
|
router: {
|
|
1547
223
|
screenContainer: Analytics.Screen,
|
|
1548
224
|
defaultScreenOption: {
|
|
@@ -1568,7 +244,11 @@ var AppsInToss = {
|
|
|
1568
244
|
};
|
|
1569
245
|
|
|
1570
246
|
// src/components/WebView.tsx
|
|
1571
|
-
import {
|
|
247
|
+
import { GoogleAdMob, IAP, Storage, AppsInTossModule, appsInTossEvent as appsInTossEvent3 } from "@apps-in-toss/native-modules";
|
|
248
|
+
import * as appsInTossAsyncBridges from "@apps-in-toss/native-modules/async-bridges";
|
|
249
|
+
import * as appsInTossConstantBridges from "@apps-in-toss/native-modules/constant-bridges";
|
|
250
|
+
import * as appsInTossEventBridges from "@apps-in-toss/native-modules/event-bridges";
|
|
251
|
+
import { getSchemeUri as getSchemeUri5, useGraniteEvent } from "@granite-js/react-native";
|
|
1572
252
|
import * as graniteAsyncBridges from "@granite-js/react-native/async-bridges";
|
|
1573
253
|
import * as graniteConstantBridges from "@granite-js/react-native/constant-bridges";
|
|
1574
254
|
import {
|
|
@@ -1579,32 +259,35 @@ import {
|
|
|
1579
259
|
} from "@toss-design-system/react-native";
|
|
1580
260
|
import { useSafeAreaBottom, useSafeAreaTop as useSafeAreaTop2 } from "@toss-design-system/react-native/private";
|
|
1581
261
|
import { useCallback as useCallback5, useEffect as useEffect8, useMemo as useMemo3, useState as useState4 } from "react";
|
|
1582
|
-
import { BackHandler as BackHandler2, Platform as
|
|
262
|
+
import { BackHandler as BackHandler2, Platform as Platform6 } from "react-native";
|
|
1583
263
|
|
|
1584
264
|
// src/components/GameWebView.tsx
|
|
265
|
+
import { setIosSwipeGestureEnabled as setIosSwipeGestureEnabled2, appsInTossEvent as appsInTossEvent2, getOperationalEnvironment } from "@apps-in-toss/native-modules";
|
|
1585
266
|
import {
|
|
1586
267
|
WebView as PlainWebView
|
|
1587
268
|
} from "@granite-js/native/react-native-webview";
|
|
1588
|
-
import { closeView as
|
|
269
|
+
import { closeView as closeView2 } from "@granite-js/react-native";
|
|
1589
270
|
import { useDialog as useDialog2 } from "@toss-design-system/react-native";
|
|
1590
271
|
import { josa as josa2 } from "es-hangul";
|
|
1591
272
|
import { forwardRef, useCallback as useCallback3, useEffect as useEffect6, useState as useState2 } from "react";
|
|
1592
|
-
import { BackHandler, Platform as
|
|
273
|
+
import { BackHandler, Platform as Platform5 } from "react-native";
|
|
1593
274
|
|
|
1594
275
|
// src/components/GameProfile.tsx
|
|
276
|
+
import { getGameCenterGameProfile as getGameCenterGameProfile2, isMinVersionSupported as isMinVersionSupported2 } from "@apps-in-toss/native-modules";
|
|
1595
277
|
import { Loader } from "@toss-design-system/react-native";
|
|
1596
278
|
import { useEffect as useEffect5 } from "react";
|
|
1597
279
|
import { Pressable, View } from "react-native";
|
|
1598
280
|
|
|
1599
281
|
// src/constant/game-center.ts
|
|
1600
282
|
var GAME_PROFILE_WEBVIEW_URL = "https://service.toss.im/game-center/profile";
|
|
1601
|
-
var
|
|
283
|
+
var GAME_CENTER_MIN_VERSION = {
|
|
1602
284
|
android: "5.221.0",
|
|
1603
285
|
ios: "5.221.0"
|
|
1604
286
|
};
|
|
1605
287
|
|
|
1606
288
|
// src/hooks/useGameCenterProfile.ts
|
|
1607
|
-
import {
|
|
289
|
+
import { getGameCenterGameProfile } from "@apps-in-toss/native-modules";
|
|
290
|
+
import { closeView, openURL as openURL3 } from "@granite-js/react-native";
|
|
1608
291
|
import { useDialog } from "@toss-design-system/react-native";
|
|
1609
292
|
import { josa } from "es-hangul";
|
|
1610
293
|
import { useCallback as useCallback2, useRef as useRef2, useState } from "react";
|
|
@@ -1652,17 +335,18 @@ var DEFAULT_ERROR = {
|
|
|
1652
335
|
};
|
|
1653
336
|
|
|
1654
337
|
// src/utils/market.ts
|
|
1655
|
-
import { Platform
|
|
338
|
+
import { Platform } from "react-native";
|
|
1656
339
|
var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
|
|
1657
340
|
var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
|
|
1658
341
|
var getMarketLink = () => {
|
|
1659
|
-
return
|
|
342
|
+
return Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
|
|
1660
343
|
};
|
|
1661
344
|
|
|
1662
345
|
// src/utils/openTransparentWebView.ts
|
|
1663
|
-
import { openURL as
|
|
346
|
+
import { openURL as openURL2 } from "@granite-js/react-native";
|
|
1664
347
|
|
|
1665
348
|
// src/private.ts
|
|
349
|
+
import { onVisibilityChangedByTransparentServiceWeb } from "@apps-in-toss/native-modules";
|
|
1666
350
|
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = onVisibilityChangedByTransparentServiceWeb;
|
|
1667
351
|
|
|
1668
352
|
// src/utils/openTransparentWebView.ts
|
|
@@ -1693,7 +377,7 @@ var openTransparentWebView = ({
|
|
|
1693
377
|
}
|
|
1694
378
|
}
|
|
1695
379
|
});
|
|
1696
|
-
|
|
380
|
+
openURL2(url.toString());
|
|
1697
381
|
};
|
|
1698
382
|
|
|
1699
383
|
// src/hooks/useGameCenterProfile.ts
|
|
@@ -1713,7 +397,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
1713
397
|
title: DEFAULT_ERROR.title,
|
|
1714
398
|
description: DEFAULT_ERROR.description
|
|
1715
399
|
});
|
|
1716
|
-
|
|
400
|
+
closeView();
|
|
1717
401
|
}, [openAlert]);
|
|
1718
402
|
const openProfileWebview = useCallback2(() => {
|
|
1719
403
|
if (isWebviewLoading) {
|
|
@@ -1758,11 +442,11 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
1758
442
|
closeOnDimmerClick: true
|
|
1759
443
|
});
|
|
1760
444
|
if (!isConfirmed) {
|
|
1761
|
-
|
|
445
|
+
closeView();
|
|
1762
446
|
return;
|
|
1763
447
|
}
|
|
1764
448
|
const STORE_SCHEME = getMarketLink();
|
|
1765
|
-
|
|
449
|
+
openURL3(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
1766
450
|
}, [openConfirm]);
|
|
1767
451
|
return {
|
|
1768
452
|
profileData,
|
|
@@ -1810,7 +494,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1810
494
|
useEffect5(() => {
|
|
1811
495
|
try {
|
|
1812
496
|
const getProfileData = async () => {
|
|
1813
|
-
const data = await
|
|
497
|
+
const data = await getGameCenterGameProfile2();
|
|
1814
498
|
setProfileData(data);
|
|
1815
499
|
setIsProfileDataLoading(false);
|
|
1816
500
|
};
|
|
@@ -1829,7 +513,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1829
513
|
return;
|
|
1830
514
|
}
|
|
1831
515
|
isCompletedProfileFlow.current = true;
|
|
1832
|
-
if (!
|
|
516
|
+
if (!isMinVersionSupported2(GAME_CENTER_MIN_VERSION)) {
|
|
1833
517
|
updateAppToSupportedMinVersion();
|
|
1834
518
|
return;
|
|
1835
519
|
}
|
|
@@ -1850,7 +534,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1850
534
|
profileData,
|
|
1851
535
|
updateAppToSupportedMinVersion
|
|
1852
536
|
]);
|
|
1853
|
-
if (!
|
|
537
|
+
if (!isMinVersionSupported2(GAME_CENTER_MIN_VERSION)) {
|
|
1854
538
|
return /* @__PURE__ */ jsxs2(Fragment3, { children: [
|
|
1855
539
|
/* @__PURE__ */ jsx4(View, { style: { flex: 1, position: "relative" }, children }),
|
|
1856
540
|
/* @__PURE__ */ jsx4(
|
|
@@ -1913,17 +597,17 @@ var overlayStyle = {
|
|
|
1913
597
|
// src/components/GameWebViewNavigationBar/GameNavigationBar.tsx
|
|
1914
598
|
import { SvgXml } from "@granite-js/native/react-native-svg";
|
|
1915
599
|
import { PageNavbar } from "@toss-design-system/react-native";
|
|
1916
|
-
import { Platform as
|
|
600
|
+
import { Platform as Platform4, TouchableOpacity, View as View3 } from "react-native";
|
|
1917
601
|
|
|
1918
602
|
// src/components/GameWebViewNavigationBar/HeaderRight.tsx
|
|
1919
603
|
import { StyleSheet, View as View2 } from "react-native";
|
|
1920
604
|
|
|
1921
605
|
// src/components/GameWebViewNavigationBar/byPlatform.ts
|
|
1922
|
-
import { Platform as
|
|
606
|
+
import { Platform as Platform2 } from "react-native";
|
|
1923
607
|
function byPlatform({
|
|
1924
608
|
...props
|
|
1925
609
|
}) {
|
|
1926
|
-
return (props[
|
|
610
|
+
return (props[Platform2.OS] ?? props.fallback)();
|
|
1927
611
|
}
|
|
1928
612
|
|
|
1929
613
|
// src/components/GameWebViewNavigationBar/constants.ts
|
|
@@ -1957,10 +641,10 @@ var styles = StyleSheet.create({
|
|
|
1957
641
|
|
|
1958
642
|
// src/components/GameWebViewNavigationBar/useSafeAreaTop.ts
|
|
1959
643
|
import { useSafeAreaInsets } from "@granite-js/native/react-native-safe-area-context";
|
|
1960
|
-
import { Platform as
|
|
644
|
+
import { Platform as Platform3 } from "react-native";
|
|
1961
645
|
function useSafeAreaTop() {
|
|
1962
646
|
const safeAreaInsets = useSafeAreaInsets();
|
|
1963
|
-
const hasDynamicIsland =
|
|
647
|
+
const hasDynamicIsland = Platform3.OS === "ios" && safeAreaInsets.top > 50;
|
|
1964
648
|
const safeAreaTop = hasDynamicIsland ? safeAreaInsets.top - 5 : safeAreaInsets.top;
|
|
1965
649
|
return safeAreaTop;
|
|
1966
650
|
}
|
|
@@ -1977,14 +661,14 @@ function GameNavigationBar({ onClose }) {
|
|
|
1977
661
|
{
|
|
1978
662
|
style: {
|
|
1979
663
|
width: "100%",
|
|
1980
|
-
height:
|
|
664
|
+
height: Platform4.OS === "ios" ? 44 : 54,
|
|
1981
665
|
flexDirection: "row",
|
|
1982
666
|
alignItems: "center",
|
|
1983
667
|
justifyContent: "flex-end",
|
|
1984
668
|
position: "absolute",
|
|
1985
669
|
zIndex: Z_INDEX.CLOSE_BUTTON,
|
|
1986
670
|
marginTop: safeAreaTop,
|
|
1987
|
-
paddingRight:
|
|
671
|
+
paddingRight: Platform4.OS === "ios" ? 10 : 8
|
|
1988
672
|
},
|
|
1989
673
|
pointerEvents: "box-none",
|
|
1990
674
|
children: /* @__PURE__ */ jsx6(HeaderRight, { children: /* @__PURE__ */ jsx6(
|
|
@@ -1995,7 +679,7 @@ function GameNavigationBar({ onClose }) {
|
|
|
1995
679
|
accessible: true,
|
|
1996
680
|
accessibilityLabel: "\uAC8C\uC784\uC885\uB8CC",
|
|
1997
681
|
style: {
|
|
1998
|
-
padding:
|
|
682
|
+
padding: Platform4.OS === "ios" ? 7 : 9
|
|
1999
683
|
},
|
|
2000
684
|
onPress: onClose,
|
|
2001
685
|
children: /* @__PURE__ */ jsx6(SvgXml, { xml: originXML, width: 30, height: 30 })
|
|
@@ -2022,14 +706,14 @@ var GameWebView = forwardRef(function GameWebView2(props, ref) {
|
|
|
2022
706
|
});
|
|
2023
707
|
if (isConfirmed) {
|
|
2024
708
|
captureExitLog(Date.now());
|
|
2025
|
-
|
|
709
|
+
closeView2();
|
|
2026
710
|
}
|
|
2027
711
|
}, [brandDisplayName, captureExitLog, openConfirm]);
|
|
2028
712
|
useEffect6(() => {
|
|
2029
|
-
if (
|
|
2030
|
-
|
|
713
|
+
if (Platform5.OS === "ios") {
|
|
714
|
+
setIosSwipeGestureEnabled2({ isEnabled: false });
|
|
2031
715
|
return () => {
|
|
2032
|
-
|
|
716
|
+
setIosSwipeGestureEnabled2({ isEnabled: true });
|
|
2033
717
|
};
|
|
2034
718
|
}
|
|
2035
719
|
return;
|
|
@@ -2045,7 +729,7 @@ var GameWebView = forwardRef(function GameWebView2(props, ref) {
|
|
|
2045
729
|
};
|
|
2046
730
|
}, [handleClose]);
|
|
2047
731
|
useEffect6(() => {
|
|
2048
|
-
|
|
732
|
+
appsInTossEvent2.addEventListener("entryMessageExited", {
|
|
2049
733
|
onEvent: () => {
|
|
2050
734
|
setIsEntryMessageExited(true);
|
|
2051
735
|
}
|
|
@@ -2185,6 +869,7 @@ function useBridgeHandler({
|
|
|
2185
869
|
}
|
|
2186
870
|
|
|
2187
871
|
// src/hooks/useCreateUserAgent.ts
|
|
872
|
+
import { getPlatformOS, getTossAppVersion } from "@apps-in-toss/native-modules";
|
|
2188
873
|
import { useWindowDimensions } from "react-native";
|
|
2189
874
|
var FontA11yCategory = {
|
|
2190
875
|
Large: "Large",
|
|
@@ -2340,6 +1025,7 @@ function useCreateUserAgent({
|
|
|
2340
1025
|
}
|
|
2341
1026
|
|
|
2342
1027
|
// src/hooks/useGeolocation.ts
|
|
1028
|
+
import { startUpdateLocation } from "@apps-in-toss/native-modules";
|
|
2343
1029
|
import { useVisibility as useVisibility3 } from "@granite-js/react-native";
|
|
2344
1030
|
import { useState as useState3, useEffect as useEffect7 } from "react";
|
|
2345
1031
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
@@ -2363,7 +1049,8 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2363
1049
|
}
|
|
2364
1050
|
|
|
2365
1051
|
// src/utils/log.ts
|
|
2366
|
-
import {
|
|
1052
|
+
import { eventLog as eventLogNative } from "@apps-in-toss/native-modules";
|
|
1053
|
+
import { getSchemeUri as getSchemeUri4 } from "@granite-js/react-native";
|
|
2367
1054
|
|
|
2368
1055
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2369
1056
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2389,7 +1076,7 @@ var getGroupId = (url) => {
|
|
|
2389
1076
|
};
|
|
2390
1077
|
var getReferrer = () => {
|
|
2391
1078
|
try {
|
|
2392
|
-
const referrer = new URL(
|
|
1079
|
+
const referrer = new URL(getSchemeUri4());
|
|
2393
1080
|
return referrer.searchParams.get("referrer");
|
|
2394
1081
|
} catch {
|
|
2395
1082
|
return "";
|
|
@@ -2407,13 +1094,13 @@ var trackScreen = (url) => {
|
|
|
2407
1094
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2408
1095
|
}
|
|
2409
1096
|
};
|
|
2410
|
-
return
|
|
1097
|
+
return eventLogNative(log);
|
|
2411
1098
|
};
|
|
2412
1099
|
|
|
2413
1100
|
// src/components/WebView.tsx
|
|
2414
1101
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
2415
1102
|
var appsInTossGlobals = getAppsInTossGlobals();
|
|
2416
|
-
var operationalEnvironment =
|
|
1103
|
+
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
2417
1104
|
var TYPES = ["partner", "external", "game"];
|
|
2418
1105
|
var WEBVIEW_TYPES = {
|
|
2419
1106
|
partner: PartnerWebViewScreen,
|
|
@@ -2422,7 +1109,7 @@ var WEBVIEW_TYPES = {
|
|
|
2422
1109
|
};
|
|
2423
1110
|
function mergeSchemeQueryParamsInto(url) {
|
|
2424
1111
|
const baseUrl = new URL(url);
|
|
2425
|
-
const schemeUrl = new URL(
|
|
1112
|
+
const schemeUrl = new URL(getSchemeUri5());
|
|
2426
1113
|
baseUrl.pathname = schemeUrl.pathname;
|
|
2427
1114
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
2428
1115
|
baseUrl.searchParams.set(key, value);
|
|
@@ -2467,16 +1154,16 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2467
1154
|
injectedJavaScript: [disableTextSelectionCSS].join("\n"),
|
|
2468
1155
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2469
1156
|
eventListenerMap: {
|
|
2470
|
-
...
|
|
1157
|
+
...appsInTossEventBridges,
|
|
2471
1158
|
navigationAccessoryEvent: ({ onEvent, onError }) => tdsEvent.addEventListener("navigationAccessoryEvent", {
|
|
2472
1159
|
onEvent,
|
|
2473
1160
|
onError
|
|
2474
1161
|
}),
|
|
2475
1162
|
backEvent: ({ onEvent, onError, options }) => graniteEvent.addEventListener("backEvent", { onEvent, onError, options }),
|
|
2476
|
-
entryMessageExited: ({ onEvent, onError }) =>
|
|
2477
|
-
updateLocationEvent: ({ onEvent, onError, options }) =>
|
|
1163
|
+
entryMessageExited: ({ onEvent, onError }) => appsInTossEvent3.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
1164
|
+
updateLocationEvent: ({ onEvent, onError, options }) => appsInTossEvent3.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2478
1165
|
/** @internal */
|
|
2479
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
1166
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => appsInTossEvent3.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2480
1167
|
/** AdMob */
|
|
2481
1168
|
loadAdMobInterstitialAd: GoogleAdMob.loadAdMobInterstitialAd,
|
|
2482
1169
|
showAdMobInterstitialAd: GoogleAdMob.showAdMobInterstitialAd,
|
|
@@ -2485,7 +1172,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2485
1172
|
},
|
|
2486
1173
|
constantHandlerMap: {
|
|
2487
1174
|
...graniteConstantBridges,
|
|
2488
|
-
...
|
|
1175
|
+
...appsInTossConstantBridges,
|
|
2489
1176
|
getSafeAreaTop: () => top,
|
|
2490
1177
|
getSafeAreaBottom: () => bottom,
|
|
2491
1178
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
@@ -2499,10 +1186,10 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2499
1186
|
},
|
|
2500
1187
|
asyncHandlerMap: {
|
|
2501
1188
|
...graniteAsyncBridges,
|
|
2502
|
-
...
|
|
1189
|
+
...appsInTossAsyncBridges,
|
|
2503
1190
|
setIosSwipeGestureEnabled: (options) => {
|
|
2504
1191
|
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
2505
|
-
return
|
|
1192
|
+
return appsInTossAsyncBridges.setIosSwipeGestureEnabled(options);
|
|
2506
1193
|
},
|
|
2507
1194
|
addAccessoryButton: async (params) => partner.addAccessoryButton(params),
|
|
2508
1195
|
removeAccessoryButton: async () => partner.removeAccessoryButton(),
|
|
@@ -2585,7 +1272,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2585
1272
|
"User-Agent": userAgent
|
|
2586
1273
|
}
|
|
2587
1274
|
},
|
|
2588
|
-
userAgent:
|
|
1275
|
+
userAgent: Platform6.OS === "ios" ? userAgent : void 0,
|
|
2589
1276
|
sharedCookiesEnabled: true,
|
|
2590
1277
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2591
1278
|
thirdPartyCookiesEnabled: true,
|
|
@@ -2593,7 +1280,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2593
1280
|
onNavigationStateChange: handleNavigationStateChange,
|
|
2594
1281
|
injectedJavaScript: handler.injectedJavaScript,
|
|
2595
1282
|
injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
|
|
2596
|
-
decelerationRate:
|
|
1283
|
+
decelerationRate: Platform6.OS === "ios" ? 1 : void 0,
|
|
2597
1284
|
allowsBackForwardNavigationGestures
|
|
2598
1285
|
}
|
|
2599
1286
|
);
|
|
@@ -2607,6 +1294,7 @@ function ensureValue(value, name) {
|
|
|
2607
1294
|
|
|
2608
1295
|
// src/index.ts
|
|
2609
1296
|
export * from "@apps-in-toss/analytics";
|
|
1297
|
+
export * from "@apps-in-toss/native-modules";
|
|
2610
1298
|
var Analytics2 = {
|
|
2611
1299
|
init: InternalAnalytics.init,
|
|
2612
1300
|
Impression: InternalAnalytics.Impression,
|
|
@@ -2614,54 +1302,11 @@ var Analytics2 = {
|
|
|
2614
1302
|
Area: InternalAnalytics.Area
|
|
2615
1303
|
};
|
|
2616
1304
|
export {
|
|
2617
|
-
Accuracy,
|
|
2618
1305
|
Analytics2 as Analytics,
|
|
2619
1306
|
AppsInToss,
|
|
2620
|
-
AppsInTossModule,
|
|
2621
|
-
BedrockCoreModule,
|
|
2622
|
-
BedrockModule,
|
|
2623
|
-
GoogleAdMob,
|
|
2624
|
-
IAP,
|
|
2625
|
-
AppsInTossModuleInstance as INTERNAL__AppsInTossModule,
|
|
2626
|
-
INTERNAL__module,
|
|
2627
1307
|
INTERNAL__onVisibilityChangedByTransparentServiceWeb,
|
|
2628
|
-
Storage,
|
|
2629
|
-
TossPay,
|
|
2630
1308
|
WebView,
|
|
2631
|
-
appLogin,
|
|
2632
|
-
appsInTossEvent,
|
|
2633
|
-
closeView,
|
|
2634
|
-
contactsViral,
|
|
2635
1309
|
env,
|
|
2636
|
-
eventLog,
|
|
2637
|
-
fetchAlbumPhotos,
|
|
2638
|
-
fetchContacts,
|
|
2639
|
-
generateHapticFeedback,
|
|
2640
|
-
getClipboardText,
|
|
2641
|
-
getCurrentLocation,
|
|
2642
|
-
getDeviceId,
|
|
2643
|
-
getGameCenterGameProfile,
|
|
2644
|
-
getLocale,
|
|
2645
|
-
getNetworkStatus,
|
|
2646
|
-
getOperationalEnvironment,
|
|
2647
|
-
getPlatformOS,
|
|
2648
|
-
getSchemeUri,
|
|
2649
|
-
getTossAppVersion,
|
|
2650
|
-
getTossShareLink,
|
|
2651
|
-
isMinVersionSupported,
|
|
2652
|
-
onVisibilityChangedByTransparentServiceWeb,
|
|
2653
|
-
openCamera,
|
|
2654
|
-
openGameCenterLeaderboard,
|
|
2655
|
-
openURL2 as openURL,
|
|
2656
|
-
saveBase64Data,
|
|
2657
|
-
setClipboardText,
|
|
2658
|
-
setDeviceOrientation,
|
|
2659
|
-
setIosSwipeGestureEnabled,
|
|
2660
|
-
setScreenAwakeMode,
|
|
2661
|
-
setSecureScreen,
|
|
2662
|
-
share,
|
|
2663
|
-
startUpdateLocation,
|
|
2664
|
-
submitGameCenterLeaderBoardScore,
|
|
2665
1310
|
useCreateUserAgent,
|
|
2666
1311
|
useGeolocation
|
|
2667
1312
|
};
|