@apps-in-toss/native-modules 1.14.1 → 2.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/bridges-meta.json +11 -7
- package/dist/index.cjs +201 -219
- package/dist/index.d.cts +1479 -1446
- package/dist/index.d.ts +1479 -1446
- package/dist/index.js +173 -192
- package/package.json +10 -8
- package/src/BedrockModule/native-modules/index.ts +0 -2
- package/src/BedrockModule/native-modules/natives/BedrockModule.ts +8 -18
- package/src/BedrockModule/native-modules/natives/closeView.ts +2 -2
- package/src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts +2 -2
- package/src/BedrockModule/native-modules/natives/getLocale.ts +2 -2
- package/src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts +2 -2
- package/src/BedrockModule/native-modules/natives/getSchemeUri.ts +2 -2
- package/src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts +3 -3
- package/src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts +2 -2
- package/src/BedrockModule/native-modules/natives/setSecureScreen.ts +2 -2
- package/src/BedrockModule/native-modules/natives/share.ts +2 -2
- package/src/CommonModule.brick.ts +36 -0
- package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/event-plugins/UpdateLocationEvent.ts +9 -6
- package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/internal/AppBridgeCallbackEvent.ts +8 -9
- package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts +13 -12
- package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/internal/appBridge.spec.ts +5 -5
- package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/internal/appBridge.ts +4 -12
- package/src/MiniAppModule/native-modules/ads/types.ts +179 -0
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/appLogin.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/appsInTossSignTossCert.ts +6 -18
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/checkoutPayment.ts +3 -3
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/eventLog.ts +3 -3
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/getDeviceId.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/getGameCenterGameProfile.ts +2 -2
- package/src/MiniAppModule/native-modules/getGroupId.ts +20 -0
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/getIsTossLoginIntegratedService.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/getOperationalEnvironment.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/getPermission.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/getServerTime.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/getTossAppVersion.ts +2 -2
- package/src/MiniAppModule/native-modules/getTossShareLink.ts +39 -0
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/getUserKeyForGame.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/grantPromotionRewardForGame.ts +10 -6
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/iap.ts +11 -12
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/index.ts +5 -3
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/isMinVersionSupported.ts +3 -3
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/permissions/fetchContacts/fetchContacts.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/permissions/getClipboardText/getClipboardText.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/permissions/getCurrentLocation/getCurrentLocation.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/permissions/openCamera/openCamera.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/permissions/openPermissionDialog.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/permissions/setClipboardText/setClipboardText.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/saveBase64Data.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/setDeviceOrientation.ts +2 -2
- package/src/MiniAppModule/native-modules/shareWithScheme.ts +23 -0
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/storage.ts +5 -8
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/submitGameCenterLeaderBoardScore.ts +2 -2
- package/src/{AppsInTossModule → MiniAppModule}/native-modules/tossCore.ts +5 -17
- package/src/MiniAppModule.brick.ts +158 -0
- package/src/TossCoreModule.brick.ts +17 -0
- package/src/async-bridges.ts +23 -23
- package/src/constant-bridges.ts +4 -3
- package/src/event-bridges.ts +3 -3
- package/src/index.ts +6 -5
- package/src/natives.ts +10 -0
- package/src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts +0 -35
- package/src/AppsInTossModule/native-modules/AppsInTossModule.ts +0 -107
- package/src/AppsInTossModule/native-modules/getTossShareLink.ts +0 -65
- package/src/BedrockModule/native-modules/core/BedrockCoreModule.ts +0 -8
- /package/src/{AppsInTossModule → MiniAppModule}/constants.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/StartUpdateLocationPermissionError.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/appsInTossEvent.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/contactsViral.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/index.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/startUpdateLocation.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-event-emitter/types.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-modules/ads/googleAdMobV2.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-modules/eventLog.spec.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-modules/isMinVersionSupported.spec.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-modules/openGameCenterLeaderboard.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-modules/permissions/createPermissionFunction.ts +0 -0
- /package/src/{AppsInTossModule → MiniAppModule}/native-modules/permissions/requestPermission.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,27 +1,39 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/MiniAppModule.brick.ts
|
|
2
|
+
import { BrickModule } from "brick-module";
|
|
3
|
+
var MiniAppModule = BrickModule.get("MiniAppModule");
|
|
4
|
+
function safePostMessage(method, params) {
|
|
5
|
+
return MiniAppModule.postMessage(method, params, {});
|
|
6
|
+
}
|
|
7
|
+
function safeSyncPostMessage(method, params) {
|
|
8
|
+
return MiniAppModule.postMessageSync(method, params, {});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/MiniAppModule/native-event-emitter/appsInTossEvent.ts
|
|
2
12
|
import { GraniteEvent } from "@granite-js/react-native";
|
|
3
13
|
|
|
4
|
-
// src/
|
|
14
|
+
// src/MiniAppModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
5
15
|
import { GetCurrentLocationPermissionError } from "@apps-in-toss/types";
|
|
6
16
|
import { GraniteEventDefinition } from "@granite-js/react-native";
|
|
7
17
|
|
|
8
|
-
// src/
|
|
9
|
-
import {
|
|
10
|
-
var
|
|
11
|
-
var AppsInTossModuleInstance = Module;
|
|
12
|
-
var AppsInTossModule = Module;
|
|
18
|
+
// src/TossCoreModule.brick.ts
|
|
19
|
+
import { BrickModule as BrickModule2 } from "brick-module";
|
|
20
|
+
var TossCoreModule = BrickModule2.get("TossCoreModule");
|
|
13
21
|
|
|
14
|
-
// src/
|
|
22
|
+
// src/CommonModule.brick.ts
|
|
23
|
+
import { BrickModule as BrickModule3 } from "brick-module";
|
|
24
|
+
var CommonModule = BrickModule3.get("CommonModule");
|
|
25
|
+
|
|
26
|
+
// src/MiniAppModule/native-modules/permissions/openPermissionDialog.ts
|
|
15
27
|
function openPermissionDialog(permission) {
|
|
16
|
-
return
|
|
28
|
+
return safePostMessage("openPermissionDialog", permission);
|
|
17
29
|
}
|
|
18
30
|
|
|
19
|
-
// src/
|
|
31
|
+
// src/MiniAppModule/native-modules/getPermission.ts
|
|
20
32
|
function getPermission(permission) {
|
|
21
|
-
return
|
|
33
|
+
return safePostMessage("getPermission", permission);
|
|
22
34
|
}
|
|
23
35
|
|
|
24
|
-
// src/
|
|
36
|
+
// src/MiniAppModule/native-modules/permissions/requestPermission.ts
|
|
25
37
|
async function requestPermission(permission) {
|
|
26
38
|
const permissionStatus = await getPermission(permission);
|
|
27
39
|
switch (permissionStatus) {
|
|
@@ -33,11 +45,7 @@ async function requestPermission(permission) {
|
|
|
33
45
|
}
|
|
34
46
|
}
|
|
35
47
|
|
|
36
|
-
// src/
|
|
37
|
-
import { NativeEventEmitter } from "react-native";
|
|
38
|
-
var nativeEventEmitter = new NativeEventEmitter(AppsInTossModuleInstance);
|
|
39
|
-
|
|
40
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
48
|
+
// src/MiniAppModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
41
49
|
var UpdateLocationEvent = class extends GraniteEventDefinition {
|
|
42
50
|
name = "updateLocationEvent";
|
|
43
51
|
subscriptionCount = 0;
|
|
@@ -47,7 +55,7 @@ var UpdateLocationEvent = class extends GraniteEventDefinition {
|
|
|
47
55
|
};
|
|
48
56
|
remove() {
|
|
49
57
|
if (--this.subscriptionCount === 0) {
|
|
50
|
-
|
|
58
|
+
safeSyncPostMessage("stopUpdateLocation", {});
|
|
51
59
|
}
|
|
52
60
|
this.ref.remove();
|
|
53
61
|
}
|
|
@@ -57,17 +65,21 @@ var UpdateLocationEvent = class extends GraniteEventDefinition {
|
|
|
57
65
|
onError(new GetCurrentLocationPermissionError());
|
|
58
66
|
return;
|
|
59
67
|
}
|
|
60
|
-
void
|
|
61
|
-
const
|
|
68
|
+
void safePostMessage("startUpdateLocation", options).catch(onError);
|
|
69
|
+
const unsubscribe = MiniAppModule.onSendEvent(({ eventName, body }) => {
|
|
70
|
+
if (eventName === "updateLocation") {
|
|
71
|
+
onEvent(body);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
62
74
|
this.ref = {
|
|
63
|
-
remove: () =>
|
|
75
|
+
remove: () => unsubscribe.remove()
|
|
64
76
|
};
|
|
65
77
|
this.subscriptionCount++;
|
|
66
78
|
}).catch(onError);
|
|
67
79
|
}
|
|
68
80
|
};
|
|
69
81
|
|
|
70
|
-
// src/
|
|
82
|
+
// src/MiniAppModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
71
83
|
import { GraniteEventDefinition as GraniteEventDefinition2 } from "@granite-js/react-native";
|
|
72
84
|
|
|
73
85
|
// src/utils/generateUUID.ts
|
|
@@ -75,7 +87,7 @@ function generateUUID(placeholder) {
|
|
|
75
87
|
return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
|
|
76
88
|
}
|
|
77
89
|
|
|
78
|
-
// src/
|
|
90
|
+
// src/MiniAppModule/native-event-emitter/internal/appBridge.ts
|
|
79
91
|
var INTERNAL__callbacks = /* @__PURE__ */ new Map();
|
|
80
92
|
function invokeAppBridgeCallback(id, ...args) {
|
|
81
93
|
const callback = INTERNAL__callbacks.get(id);
|
|
@@ -85,15 +97,7 @@ function invokeAppBridgeCallback(id, ...args) {
|
|
|
85
97
|
function invokeAppBridgeMethod(methodName, params, callbacks) {
|
|
86
98
|
const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
|
|
87
99
|
const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
|
|
88
|
-
const
|
|
89
|
-
if (method == null) {
|
|
90
|
-
onError(new Error(`'${methodName}' is not defined in AppsInTossModule`));
|
|
91
|
-
return unregisterAll;
|
|
92
|
-
}
|
|
93
|
-
const promise = method({
|
|
94
|
-
params,
|
|
95
|
-
callbacks: callbackMap
|
|
96
|
-
});
|
|
100
|
+
const promise = MiniAppModule.postMessage(methodName, params, callbackMap);
|
|
97
101
|
void promise.then(onSuccess).catch(onError);
|
|
98
102
|
return unregisterAll;
|
|
99
103
|
}
|
|
@@ -128,8 +132,7 @@ var INTERNAL__appBridgeHandler = {
|
|
|
128
132
|
getCallbackIds
|
|
129
133
|
};
|
|
130
134
|
|
|
131
|
-
// src/
|
|
132
|
-
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
135
|
+
// src/MiniAppModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
133
136
|
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventDefinition2 {
|
|
134
137
|
static INTERNAL__appBridgeSubscription;
|
|
135
138
|
name = "appBridgeCallbackEvent";
|
|
@@ -145,10 +148,12 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventD
|
|
|
145
148
|
if (_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription != null) {
|
|
146
149
|
return;
|
|
147
150
|
}
|
|
148
|
-
|
|
149
|
-
"appBridgeCallback"
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
const subscription = MiniAppModule.onSendEvent(({ eventName, body }) => {
|
|
152
|
+
if (eventName === "appBridgeCallback") {
|
|
153
|
+
this.ensureInvokeAppBridgeCallback(body);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription = () => subscription.remove();
|
|
152
157
|
}
|
|
153
158
|
ensureInvokeAppBridgeCallback(result) {
|
|
154
159
|
if (typeof result === "object" && typeof result.name === "string") {
|
|
@@ -159,33 +164,35 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventD
|
|
|
159
164
|
}
|
|
160
165
|
};
|
|
161
166
|
|
|
162
|
-
// src/
|
|
167
|
+
// src/MiniAppModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
163
168
|
import { GraniteEventDefinition as GraniteEventDefinition3 } from "@granite-js/react-native";
|
|
164
169
|
var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDefinition3 {
|
|
165
170
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
166
|
-
|
|
171
|
+
unsubscribe = null;
|
|
167
172
|
remove() {
|
|
168
|
-
this.
|
|
169
|
-
this.
|
|
173
|
+
this.unsubscribe?.();
|
|
174
|
+
this.unsubscribe = null;
|
|
170
175
|
}
|
|
171
176
|
listener(options, onEvent, onError) {
|
|
172
|
-
const subscription =
|
|
173
|
-
if (
|
|
174
|
-
if (
|
|
175
|
-
|
|
177
|
+
const subscription = MiniAppModule.onSendEvent(({ eventName, body }) => {
|
|
178
|
+
if (eventName === "visibilityChangedByTransparentServiceWeb") {
|
|
179
|
+
if (this.isVisibilityChangedByTransparentServiceWebResult(body)) {
|
|
180
|
+
if (body.callbackId === options.callbackId) {
|
|
181
|
+
onEvent(body.isVisible);
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
184
|
+
onError(new Error("Invalid visibility changed by transparent service web result"));
|
|
176
185
|
}
|
|
177
|
-
} else {
|
|
178
|
-
onError(new Error("Invalid visibility changed by transparent service web result"));
|
|
179
186
|
}
|
|
180
187
|
});
|
|
181
|
-
this.
|
|
188
|
+
this.unsubscribe = () => subscription.remove();
|
|
182
189
|
}
|
|
183
190
|
isVisibilityChangedByTransparentServiceWebResult(params) {
|
|
184
191
|
return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
|
|
185
192
|
}
|
|
186
193
|
};
|
|
187
194
|
|
|
188
|
-
// src/
|
|
195
|
+
// src/MiniAppModule/native-event-emitter/appsInTossEvent.ts
|
|
189
196
|
var appsInTossEvent = new GraniteEvent([
|
|
190
197
|
new UpdateLocationEvent(),
|
|
191
198
|
// Internal events
|
|
@@ -193,7 +200,7 @@ var appsInTossEvent = new GraniteEvent([
|
|
|
193
200
|
new VisibilityChangedByTransparentServiceWebEvent()
|
|
194
201
|
]);
|
|
195
202
|
|
|
196
|
-
// src/
|
|
203
|
+
// src/MiniAppModule/native-modules/ads/googleAdMobV2.ts
|
|
197
204
|
import { noop } from "es-toolkit";
|
|
198
205
|
|
|
199
206
|
// src/utils/getReferrer.ts
|
|
@@ -206,12 +213,12 @@ function getReferrer() {
|
|
|
206
213
|
}
|
|
207
214
|
}
|
|
208
215
|
|
|
209
|
-
// src/
|
|
216
|
+
// src/MiniAppModule/native-modules/getOperationalEnvironment.ts
|
|
210
217
|
function getOperationalEnvironment() {
|
|
211
|
-
return
|
|
218
|
+
return MiniAppModule.getConstants().operationalEnvironment;
|
|
212
219
|
}
|
|
213
220
|
|
|
214
|
-
// src/
|
|
221
|
+
// src/MiniAppModule/native-modules/isMinVersionSupported.ts
|
|
215
222
|
import { Platform } from "react-native";
|
|
216
223
|
|
|
217
224
|
// src/utils/compareVersion.ts
|
|
@@ -281,13 +288,13 @@ var compareVersions = (v1, v2) => {
|
|
|
281
288
|
return 0;
|
|
282
289
|
};
|
|
283
290
|
|
|
284
|
-
// src/
|
|
291
|
+
// src/MiniAppModule/native-modules/isMinVersionSupported.ts
|
|
285
292
|
function isMinVersionSupported(minVersions) {
|
|
286
|
-
const operationalEnvironment =
|
|
293
|
+
const operationalEnvironment = MiniAppModule.getConstants().operationalEnvironment;
|
|
287
294
|
if (operationalEnvironment === "sandbox") {
|
|
288
295
|
return true;
|
|
289
296
|
}
|
|
290
|
-
const currentVersion =
|
|
297
|
+
const currentVersion = MiniAppModule.getConstants().tossAppVersion;
|
|
291
298
|
const isIOS = Platform.OS === "ios";
|
|
292
299
|
const minVersion = isIOS ? minVersions.ios : minVersions.android;
|
|
293
300
|
if (minVersion === void 0) {
|
|
@@ -302,7 +309,7 @@ function isMinVersionSupported(minVersions) {
|
|
|
302
309
|
return compareVersions(currentVersion, minVersion) >= 0;
|
|
303
310
|
}
|
|
304
311
|
|
|
305
|
-
// src/
|
|
312
|
+
// src/MiniAppModule/native-modules/ads/googleAdMobV2.ts
|
|
306
313
|
function loadAppsInTossAdMob(params) {
|
|
307
314
|
if (!loadAppsInTossAdMob.isSupported()) {
|
|
308
315
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
@@ -397,24 +404,24 @@ function isAppsInTossAdMobLoadedSupported() {
|
|
|
397
404
|
}
|
|
398
405
|
isAppsInTossAdMobLoaded.isSupported = isAppsInTossAdMobLoadedSupported;
|
|
399
406
|
|
|
400
|
-
// src/
|
|
407
|
+
// src/MiniAppModule/native-modules/checkoutPayment.ts
|
|
401
408
|
async function checkoutPayment(options) {
|
|
402
|
-
return
|
|
409
|
+
return safePostMessage("checkoutPayment", options.params);
|
|
403
410
|
}
|
|
404
411
|
|
|
405
|
-
// src/
|
|
412
|
+
// src/MiniAppModule/native-modules/appLogin.ts
|
|
406
413
|
async function appLogin() {
|
|
407
|
-
return
|
|
414
|
+
return safePostMessage("appLogin", {});
|
|
408
415
|
}
|
|
409
416
|
|
|
410
|
-
// src/
|
|
417
|
+
// src/MiniAppModule/native-modules/eventLog.ts
|
|
411
418
|
function normalizeParams(params) {
|
|
412
419
|
return Object.fromEntries(
|
|
413
420
|
Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
|
|
414
421
|
);
|
|
415
422
|
}
|
|
416
423
|
async function eventLog(params) {
|
|
417
|
-
if (
|
|
424
|
+
if (MiniAppModule.getConstants().operationalEnvironment === "sandbox") {
|
|
418
425
|
console.log("[eventLogDebug]", {
|
|
419
426
|
log_name: params.log_name,
|
|
420
427
|
log_type: params.log_type,
|
|
@@ -429,17 +436,17 @@ async function eventLog(params) {
|
|
|
429
436
|
if (!isSupported) {
|
|
430
437
|
return;
|
|
431
438
|
}
|
|
432
|
-
return
|
|
439
|
+
return safePostMessage("eventLog", {
|
|
433
440
|
log_name: params.log_name,
|
|
434
441
|
log_type: params.log_type,
|
|
435
442
|
params: normalizeParams(params.params)
|
|
436
443
|
});
|
|
437
444
|
}
|
|
438
445
|
|
|
439
|
-
// src/
|
|
446
|
+
// src/MiniAppModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts
|
|
440
447
|
import { FetchAlbumPhotosPermissionError } from "@apps-in-toss/types";
|
|
441
448
|
|
|
442
|
-
// src/
|
|
449
|
+
// src/MiniAppModule/native-modules/permissions/createPermissionFunction.ts
|
|
443
450
|
function createPermissionFunction({
|
|
444
451
|
handler,
|
|
445
452
|
permission,
|
|
@@ -457,12 +464,12 @@ function createPermissionFunction({
|
|
|
457
464
|
return permissionFunction;
|
|
458
465
|
}
|
|
459
466
|
|
|
460
|
-
// src/
|
|
467
|
+
// src/MiniAppModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts
|
|
461
468
|
var DEFAULT_MAX_COUNT = 10;
|
|
462
469
|
var DEFAULT_MAX_WIDTH = 1024;
|
|
463
470
|
var fetchAlbumPhotos = createPermissionFunction({
|
|
464
471
|
handler: async (options) => {
|
|
465
|
-
return
|
|
472
|
+
return safePostMessage("fetchAlbumPhotos", {
|
|
466
473
|
...options,
|
|
467
474
|
maxCount: options?.maxCount ?? DEFAULT_MAX_COUNT,
|
|
468
475
|
maxWidth: options?.maxWidth ?? DEFAULT_MAX_WIDTH
|
|
@@ -475,11 +482,11 @@ var fetchAlbumPhotos = createPermissionFunction({
|
|
|
475
482
|
error: FetchAlbumPhotosPermissionError
|
|
476
483
|
});
|
|
477
484
|
|
|
478
|
-
// src/
|
|
485
|
+
// src/MiniAppModule/native-modules/permissions/fetchContacts/fetchContacts.ts
|
|
479
486
|
import { FetchContactsPermissionError } from "@apps-in-toss/types";
|
|
480
487
|
var fetchContacts = createPermissionFunction({
|
|
481
488
|
handler: async (options) => {
|
|
482
|
-
const contacts = await
|
|
489
|
+
const contacts = await safePostMessage("fetchContacts", options);
|
|
483
490
|
return {
|
|
484
491
|
result: contacts.result,
|
|
485
492
|
nextOffset: contacts.nextOffset ?? null,
|
|
@@ -493,11 +500,11 @@ var fetchContacts = createPermissionFunction({
|
|
|
493
500
|
error: FetchContactsPermissionError
|
|
494
501
|
});
|
|
495
502
|
|
|
496
|
-
// src/
|
|
503
|
+
// src/MiniAppModule/native-modules/permissions/getClipboardText/getClipboardText.ts
|
|
497
504
|
import { GetClipboardTextPermissionError } from "@apps-in-toss/types";
|
|
498
505
|
var getClipboardText = createPermissionFunction({
|
|
499
506
|
handler: () => {
|
|
500
|
-
return
|
|
507
|
+
return safePostMessage("getClipboardText", {});
|
|
501
508
|
},
|
|
502
509
|
permission: {
|
|
503
510
|
name: "clipboard",
|
|
@@ -506,11 +513,11 @@ var getClipboardText = createPermissionFunction({
|
|
|
506
513
|
error: GetClipboardTextPermissionError
|
|
507
514
|
});
|
|
508
515
|
|
|
509
|
-
// src/
|
|
516
|
+
// src/MiniAppModule/native-modules/permissions/getCurrentLocation/getCurrentLocation.ts
|
|
510
517
|
import { GetCurrentLocationPermissionError as GetCurrentLocationPermissionError2 } from "@apps-in-toss/types";
|
|
511
518
|
var getCurrentLocation = createPermissionFunction({
|
|
512
519
|
handler: async (options) => {
|
|
513
|
-
return
|
|
520
|
+
return safePostMessage("getCurrentLocation", options);
|
|
514
521
|
},
|
|
515
522
|
permission: {
|
|
516
523
|
name: "geolocation",
|
|
@@ -519,11 +526,11 @@ var getCurrentLocation = createPermissionFunction({
|
|
|
519
526
|
error: GetCurrentLocationPermissionError2
|
|
520
527
|
});
|
|
521
528
|
|
|
522
|
-
// src/
|
|
529
|
+
// src/MiniAppModule/native-modules/permissions/setClipboardText/setClipboardText.ts
|
|
523
530
|
import { SetClipboardTextPermissionError } from "@apps-in-toss/types";
|
|
524
531
|
var setClipboardText = createPermissionFunction({
|
|
525
532
|
handler: (text) => {
|
|
526
|
-
return
|
|
533
|
+
return safePostMessage("setClipboardText", { text });
|
|
527
534
|
},
|
|
528
535
|
permission: {
|
|
529
536
|
name: "clipboard",
|
|
@@ -532,11 +539,11 @@ var setClipboardText = createPermissionFunction({
|
|
|
532
539
|
error: SetClipboardTextPermissionError
|
|
533
540
|
});
|
|
534
541
|
|
|
535
|
-
// src/
|
|
542
|
+
// src/MiniAppModule/native-modules/permissions/openCamera/openCamera.ts
|
|
536
543
|
import { OpenCameraPermissionError } from "@apps-in-toss/types";
|
|
537
544
|
var openCamera = createPermissionFunction({
|
|
538
545
|
handler: (options) => {
|
|
539
|
-
return
|
|
546
|
+
return safePostMessage("openCamera", {
|
|
540
547
|
base64: false,
|
|
541
548
|
maxWidth: 1024,
|
|
542
549
|
...options
|
|
@@ -549,51 +556,33 @@ var openCamera = createPermissionFunction({
|
|
|
549
556
|
error: OpenCameraPermissionError
|
|
550
557
|
});
|
|
551
558
|
|
|
552
|
-
// src/
|
|
559
|
+
// src/MiniAppModule/native-modules/getDeviceId.ts
|
|
553
560
|
function getDeviceId() {
|
|
554
|
-
return
|
|
561
|
+
return MiniAppModule.getConstants().deviceId;
|
|
555
562
|
}
|
|
556
563
|
|
|
557
|
-
// src/
|
|
564
|
+
// src/MiniAppModule/native-modules/getTossAppVersion.ts
|
|
558
565
|
function getTossAppVersion() {
|
|
559
|
-
return
|
|
566
|
+
return MiniAppModule.getConstants().tossAppVersion;
|
|
560
567
|
}
|
|
561
568
|
|
|
562
|
-
// src/
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
ios: "5.239.0"
|
|
566
|
-
};
|
|
567
|
-
async function getTossShareLink(path, ogImageUrl) {
|
|
568
|
-
if (!isMinVersionSupported(V2_MIN_VERSION)) {
|
|
569
|
-
return await getTossShareLinkV1(path);
|
|
570
|
-
}
|
|
571
|
-
const params = {
|
|
572
|
-
params: {
|
|
573
|
-
url: path,
|
|
574
|
-
ogImageUrl
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
const { shareLink } = await AppsInTossModule.getTossShareLink(params);
|
|
578
|
-
return shareLink;
|
|
579
|
-
}
|
|
580
|
-
async function getTossShareLinkV1(path) {
|
|
581
|
-
const { shareLink } = await AppsInTossModule.getTossShareLink({});
|
|
569
|
+
// src/MiniAppModule/native-modules/getTossShareLink.ts
|
|
570
|
+
async function getTossShareLink(path) {
|
|
571
|
+
const { shareLink } = await safePostMessage("getTossShareLink", {});
|
|
582
572
|
const shareUrl = new URL(shareLink);
|
|
583
573
|
shareUrl.searchParams.set("deep_link_value", path);
|
|
584
574
|
shareUrl.searchParams.set("af_dp", path);
|
|
585
575
|
return shareUrl.toString();
|
|
586
576
|
}
|
|
587
577
|
|
|
588
|
-
// src/
|
|
589
|
-
|
|
590
|
-
};
|
|
578
|
+
// src/MiniAppModule/native-modules/iap.ts
|
|
579
|
+
import { noop as noop2 } from "es-toolkit";
|
|
591
580
|
function iapCreateOneTimePurchaseOrder(params) {
|
|
592
581
|
const sku = params.sku ?? params.productId;
|
|
593
|
-
return
|
|
582
|
+
return safePostMessage("iapCreateOneTimePurchaseOrder", { productId: sku });
|
|
594
583
|
}
|
|
595
584
|
function processProductGrant(params) {
|
|
596
|
-
return
|
|
585
|
+
return safePostMessage("processProductGrant", { orderId: params.orderId, isProductGranted: params.isProductGranted });
|
|
597
586
|
}
|
|
598
587
|
function requestOneTimePurchase(params) {
|
|
599
588
|
const { options, onEvent, onError } = params;
|
|
@@ -631,7 +620,7 @@ function createOneTimePurchaseOrder(params) {
|
|
|
631
620
|
const sku = options.sku ?? options.productId;
|
|
632
621
|
if (!isProcessProductGrantSupported) {
|
|
633
622
|
const v1 = () => {
|
|
634
|
-
|
|
623
|
+
safePostMessage("iapCreateOneTimePurchaseOrder", { productId: sku }).then((response) => {
|
|
635
624
|
Promise.resolve(options.processProductGrant({ orderId: response.orderId })).then(() => {
|
|
636
625
|
onEvent({ type: "success", data: response });
|
|
637
626
|
}).catch((error) => {
|
|
@@ -650,7 +639,7 @@ function createOneTimePurchaseOrder(params) {
|
|
|
650
639
|
{
|
|
651
640
|
onPurchased: async (params2) => {
|
|
652
641
|
const isProductGranted = await options.processProductGrant(params2);
|
|
653
|
-
await
|
|
642
|
+
await safePostMessage("processProductGrant", { orderId: params2.orderId, isProductGranted });
|
|
654
643
|
},
|
|
655
644
|
onSuccess: (result) => {
|
|
656
645
|
onEvent({ type: "success", data: result });
|
|
@@ -670,7 +659,7 @@ async function getProductItemList() {
|
|
|
670
659
|
if (!isSupported) {
|
|
671
660
|
return;
|
|
672
661
|
}
|
|
673
|
-
return
|
|
662
|
+
return safePostMessage("iapGetProductItemList", {});
|
|
674
663
|
}
|
|
675
664
|
async function getPendingOrders() {
|
|
676
665
|
const isSupported = isMinVersionSupported({
|
|
@@ -680,7 +669,7 @@ async function getPendingOrders() {
|
|
|
680
669
|
if (!isSupported) {
|
|
681
670
|
return;
|
|
682
671
|
}
|
|
683
|
-
return
|
|
672
|
+
return safePostMessage("getPendingOrders", {});
|
|
684
673
|
}
|
|
685
674
|
async function getCompletedOrRefundedOrders(params) {
|
|
686
675
|
const isSupported = isMinVersionSupported({
|
|
@@ -690,7 +679,7 @@ async function getCompletedOrRefundedOrders(params) {
|
|
|
690
679
|
if (!isSupported) {
|
|
691
680
|
return;
|
|
692
681
|
}
|
|
693
|
-
return
|
|
682
|
+
return safePostMessage("getCompletedOrRefundedOrders", params ?? { key: null });
|
|
694
683
|
}
|
|
695
684
|
async function completeProductGrant(params) {
|
|
696
685
|
const isSupported = isMinVersionSupported({
|
|
@@ -700,7 +689,7 @@ async function completeProductGrant(params) {
|
|
|
700
689
|
if (!isSupported) {
|
|
701
690
|
return;
|
|
702
691
|
}
|
|
703
|
-
return
|
|
692
|
+
return safePostMessage("completeProductGrant", params.params);
|
|
704
693
|
}
|
|
705
694
|
function createSubscriptionPurchaseOrder(params) {
|
|
706
695
|
const isSupported = isMinVersionSupported({
|
|
@@ -718,7 +707,7 @@ function createSubscriptionPurchaseOrder(params) {
|
|
|
718
707
|
{
|
|
719
708
|
onPurchased: async (purchasedParams) => {
|
|
720
709
|
const isProductGranted = await processProductGrant2(purchasedParams);
|
|
721
|
-
await
|
|
710
|
+
await safePostMessage("processProductGrant", { orderId: purchasedParams.orderId, isProductGranted });
|
|
722
711
|
},
|
|
723
712
|
onSuccess: (result) => {
|
|
724
713
|
onEvent({ type: "success", data: result });
|
|
@@ -739,7 +728,7 @@ var IAP = {
|
|
|
739
728
|
completeProductGrant
|
|
740
729
|
};
|
|
741
730
|
|
|
742
|
-
// src/
|
|
731
|
+
// src/MiniAppModule/native-modules/saveBase64Data.ts
|
|
743
732
|
async function saveBase64Data(params) {
|
|
744
733
|
const isSupported = isMinVersionSupported({
|
|
745
734
|
android: "5.218.0",
|
|
@@ -749,10 +738,10 @@ async function saveBase64Data(params) {
|
|
|
749
738
|
console.warn("saveBase64Data is not supported in this app version");
|
|
750
739
|
return;
|
|
751
740
|
}
|
|
752
|
-
await
|
|
741
|
+
await safePostMessage("saveBase64Data", params);
|
|
753
742
|
}
|
|
754
743
|
|
|
755
|
-
// src/
|
|
744
|
+
// src/MiniAppModule/native-modules/setDeviceOrientation.ts
|
|
756
745
|
async function setDeviceOrientation(options) {
|
|
757
746
|
const isSupported = isMinVersionSupported({
|
|
758
747
|
android: "5.215.0",
|
|
@@ -761,24 +750,21 @@ async function setDeviceOrientation(options) {
|
|
|
761
750
|
if (!isSupported) {
|
|
762
751
|
return;
|
|
763
752
|
}
|
|
764
|
-
return
|
|
753
|
+
return safePostMessage("setDeviceOrientation", options);
|
|
765
754
|
}
|
|
766
755
|
|
|
767
|
-
// src/
|
|
756
|
+
// src/MiniAppModule/native-modules/storage.ts
|
|
768
757
|
function getItem(key) {
|
|
769
|
-
return
|
|
758
|
+
return safePostMessage("getStorageItem", { key });
|
|
770
759
|
}
|
|
771
760
|
function setItem(key, value) {
|
|
772
|
-
return
|
|
773
|
-
key,
|
|
774
|
-
value
|
|
775
|
-
});
|
|
761
|
+
return safePostMessage("setStorageItem", { key, value });
|
|
776
762
|
}
|
|
777
763
|
function removeItem(key) {
|
|
778
|
-
return
|
|
764
|
+
return safePostMessage("removeStorageItem", { key });
|
|
779
765
|
}
|
|
780
766
|
function clearItems() {
|
|
781
|
-
return
|
|
767
|
+
return safePostMessage("clearStorage", {});
|
|
782
768
|
}
|
|
783
769
|
var Storage = {
|
|
784
770
|
getItem,
|
|
@@ -787,10 +773,10 @@ var Storage = {
|
|
|
787
773
|
clearItems
|
|
788
774
|
};
|
|
789
775
|
|
|
790
|
-
// src/
|
|
776
|
+
// src/MiniAppModule/native-modules/openGameCenterLeaderboard.ts
|
|
791
777
|
import { openURL } from "@granite-js/react-native";
|
|
792
778
|
|
|
793
|
-
// src/
|
|
779
|
+
// src/MiniAppModule/constants.ts
|
|
794
780
|
var GAME_CENTER_MIN_VERSION = {
|
|
795
781
|
android: "5.221.0",
|
|
796
782
|
ios: "5.221.0"
|
|
@@ -812,7 +798,7 @@ var GET_SERVER_TIME_MIN_VERSION = {
|
|
|
812
798
|
ios: "5.245.0"
|
|
813
799
|
};
|
|
814
800
|
|
|
815
|
-
// src/
|
|
801
|
+
// src/MiniAppModule/native-modules/openGameCenterLeaderboard.ts
|
|
816
802
|
async function openGameCenterLeaderboard() {
|
|
817
803
|
if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
|
|
818
804
|
return;
|
|
@@ -827,32 +813,32 @@ async function openGameCenterLeaderboard() {
|
|
|
827
813
|
return openURL(url.toString());
|
|
828
814
|
}
|
|
829
815
|
|
|
830
|
-
// src/
|
|
816
|
+
// src/MiniAppModule/native-modules/getGameCenterGameProfile.ts
|
|
831
817
|
async function getGameCenterGameProfile() {
|
|
832
818
|
const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
|
|
833
819
|
if (!isSupported) {
|
|
834
820
|
return;
|
|
835
821
|
}
|
|
836
|
-
return
|
|
822
|
+
return safePostMessage("getGameCenterGameProfile", {});
|
|
837
823
|
}
|
|
838
824
|
|
|
839
|
-
// src/
|
|
825
|
+
// src/MiniAppModule/native-modules/submitGameCenterLeaderBoardScore.ts
|
|
840
826
|
async function submitGameCenterLeaderBoardScore(params) {
|
|
841
827
|
const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
|
|
842
828
|
if (!isSupported) {
|
|
843
829
|
return;
|
|
844
830
|
}
|
|
845
|
-
return
|
|
831
|
+
return safePostMessage("submitGameCenterLeaderBoardScore", params);
|
|
846
832
|
}
|
|
847
833
|
|
|
848
|
-
// src/
|
|
834
|
+
// src/MiniAppModule/native-modules/getUserKeyForGame.ts
|
|
849
835
|
async function getUserKeyForGame() {
|
|
850
836
|
const isSupported = isMinVersionSupported(GAME_USER_KEY_MIN_VERSION);
|
|
851
837
|
if (!isSupported) {
|
|
852
838
|
return;
|
|
853
839
|
}
|
|
854
840
|
try {
|
|
855
|
-
const response = await
|
|
841
|
+
const response = await safePostMessage("getUserKeyForGame", {});
|
|
856
842
|
if (response.type === "HASH") {
|
|
857
843
|
return response;
|
|
858
844
|
}
|
|
@@ -865,19 +851,20 @@ async function getUserKeyForGame() {
|
|
|
865
851
|
}
|
|
866
852
|
}
|
|
867
853
|
|
|
868
|
-
// src/
|
|
854
|
+
// src/MiniAppModule/native-modules/grantPromotionRewardForGame.ts
|
|
869
855
|
function isGrantPromotionRewardForGameError(error) {
|
|
870
856
|
return typeof error === "object" && error !== null && "code" in error && typeof error.code === "string" && "message" in error && typeof error.message === "string";
|
|
871
857
|
}
|
|
872
|
-
async function grantPromotionRewardForGame({
|
|
873
|
-
params
|
|
874
|
-
}) {
|
|
858
|
+
async function grantPromotionRewardForGame(params) {
|
|
875
859
|
const isSupported = isMinVersionSupported(GAME_PROMOTION_REWARD_MIN_VERSION);
|
|
876
860
|
if (!isSupported) {
|
|
877
861
|
return;
|
|
878
862
|
}
|
|
879
863
|
try {
|
|
880
|
-
const response = await
|
|
864
|
+
const response = await safePostMessage(
|
|
865
|
+
"grantPromotionRewardForGame",
|
|
866
|
+
params.params
|
|
867
|
+
);
|
|
881
868
|
if (response.key) {
|
|
882
869
|
return response;
|
|
883
870
|
}
|
|
@@ -893,17 +880,17 @@ async function grantPromotionRewardForGame({
|
|
|
893
880
|
}
|
|
894
881
|
}
|
|
895
882
|
|
|
896
|
-
// src/
|
|
883
|
+
// src/MiniAppModule/native-modules/getIsTossLoginIntegratedService.ts
|
|
897
884
|
async function getIsTossLoginIntegratedService() {
|
|
898
885
|
const isSupported = isMinVersionSupported(GET_IS_TOSS_LOGIN_INTEGRATED_SERVICE_MIN_VERSION);
|
|
899
886
|
if (!isSupported) {
|
|
900
887
|
return;
|
|
901
888
|
}
|
|
902
|
-
const response = await
|
|
889
|
+
const response = await safePostMessage("getIsTossLoginIntegratedService", {});
|
|
903
890
|
return response;
|
|
904
891
|
}
|
|
905
892
|
|
|
906
|
-
// src/
|
|
893
|
+
// src/MiniAppModule/native-event-emitter/contactsViral.ts
|
|
907
894
|
function contactsViral(params) {
|
|
908
895
|
const isSupported = isMinVersionSupported({
|
|
909
896
|
android: "5.223.0",
|
|
@@ -926,38 +913,40 @@ function contactsViral(params) {
|
|
|
926
913
|
return unregisterCallbacks;
|
|
927
914
|
}
|
|
928
915
|
|
|
929
|
-
// src/
|
|
930
|
-
|
|
931
|
-
|
|
916
|
+
// src/MiniAppModule/native-modules/appsInTossSignTossCert.ts
|
|
917
|
+
async function appsInTossSignTossCert(params) {
|
|
918
|
+
const isSupported = isMinVersionSupported({
|
|
932
919
|
android: "5.233.0",
|
|
933
920
|
ios: "5.233.0"
|
|
934
|
-
}
|
|
935
|
-
USER_NONE: {
|
|
936
|
-
android: "5.236.0",
|
|
937
|
-
ios: "5.236.0"
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
async function appsInTossSignTossCert(params) {
|
|
941
|
-
const minVersion = params.skipConfirmDoc === true ? MIN_VERSION_BY_USER_TYPE.USER_NONE : MIN_VERSION_BY_USER_TYPE.USER_PERSONAL;
|
|
942
|
-
const isSupported = isMinVersionSupported(minVersion);
|
|
921
|
+
});
|
|
943
922
|
if (!isSupported) {
|
|
944
923
|
console.warn("appsInTossSignTossCert is not supported in this app version");
|
|
945
924
|
return;
|
|
946
925
|
}
|
|
947
|
-
await
|
|
926
|
+
await safePostMessage("appsInTossSignTossCert", params);
|
|
948
927
|
}
|
|
949
928
|
|
|
950
|
-
// src/
|
|
929
|
+
// src/MiniAppModule/native-modules/getGroupId.ts
|
|
930
|
+
function getGroupId() {
|
|
931
|
+
return MiniAppModule.getConstants().groupId;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// src/MiniAppModule/native-modules/shareWithScheme.ts
|
|
935
|
+
function shareWithScheme(params) {
|
|
936
|
+
safeSyncPostMessage("shareWithScheme", params);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// src/MiniAppModule/native-modules/getServerTime.ts
|
|
951
940
|
async function getServerTime() {
|
|
952
941
|
const isSupported = isMinVersionSupported(GET_SERVER_TIME_MIN_VERSION);
|
|
953
942
|
if (!isSupported) {
|
|
954
943
|
return;
|
|
955
944
|
}
|
|
956
|
-
return (await
|
|
945
|
+
return (await safePostMessage("getServerTime", {})).serverTime;
|
|
957
946
|
}
|
|
958
947
|
getServerTime.isSupported = () => isMinVersionSupported(GET_SERVER_TIME_MIN_VERSION);
|
|
959
948
|
|
|
960
|
-
// src/
|
|
949
|
+
// src/MiniAppModule/native-modules/index.ts
|
|
961
950
|
var TossPay = {
|
|
962
951
|
checkoutPayment
|
|
963
952
|
};
|
|
@@ -967,34 +956,33 @@ var GoogleAdMob = {
|
|
|
967
956
|
isAppsInTossAdMobLoaded
|
|
968
957
|
};
|
|
969
958
|
|
|
970
|
-
// src/
|
|
959
|
+
// src/MiniAppModule/native-event-emitter/startUpdateLocation.ts
|
|
971
960
|
function startUpdateLocation(eventParams) {
|
|
972
961
|
return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
|
|
973
962
|
}
|
|
974
963
|
startUpdateLocation.openPermissionDialog = getCurrentLocation.openPermissionDialog;
|
|
975
964
|
startUpdateLocation.getPermission = getCurrentLocation.getPermission;
|
|
976
965
|
|
|
977
|
-
// src/
|
|
966
|
+
// src/MiniAppModule/native-event-emitter/StartUpdateLocationPermissionError.ts
|
|
978
967
|
import { StartUpdateLocationPermissionError } from "@apps-in-toss/types";
|
|
979
968
|
|
|
980
|
-
// src/
|
|
969
|
+
// src/MiniAppModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
981
970
|
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
982
971
|
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
983
972
|
}
|
|
984
973
|
|
|
985
974
|
// src/BedrockModule/native-modules/natives/BedrockModule.ts
|
|
986
|
-
|
|
987
|
-
var BedrockModule = NativeModules.BedrockModule;
|
|
975
|
+
var CommonModule2 = CommonModule;
|
|
988
976
|
|
|
989
977
|
// src/BedrockModule/native-modules/natives/closeView.ts
|
|
990
978
|
async function closeView() {
|
|
991
|
-
return
|
|
979
|
+
return CommonModule2.closeView();
|
|
992
980
|
}
|
|
993
981
|
|
|
994
982
|
// src/BedrockModule/native-modules/natives/getLocale.ts
|
|
995
983
|
import { Platform as Platform2 } from "react-native";
|
|
996
984
|
function getLocale() {
|
|
997
|
-
const locale =
|
|
985
|
+
const locale = CommonModule2?.getConstants().locale ?? "ko-KR";
|
|
998
986
|
if (Platform2.OS === "android") {
|
|
999
987
|
return replaceUnderbarToHypen(locale);
|
|
1000
988
|
}
|
|
@@ -1006,40 +994,40 @@ function replaceUnderbarToHypen(locale) {
|
|
|
1006
994
|
|
|
1007
995
|
// src/BedrockModule/native-modules/natives/getSchemeUri.ts
|
|
1008
996
|
function getSchemeUri2() {
|
|
1009
|
-
return
|
|
997
|
+
return CommonModule2.getConstants().schemeUri;
|
|
1010
998
|
}
|
|
1011
999
|
|
|
1012
1000
|
// src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts
|
|
1013
1001
|
function generateHapticFeedback(options) {
|
|
1014
|
-
return
|
|
1002
|
+
return CommonModule2.generateHapticFeedback(options);
|
|
1015
1003
|
}
|
|
1016
1004
|
|
|
1017
1005
|
// src/BedrockModule/native-modules/natives/share.ts
|
|
1018
1006
|
async function share(message) {
|
|
1019
|
-
|
|
1007
|
+
CommonModule2.share(message);
|
|
1020
1008
|
}
|
|
1021
1009
|
|
|
1022
1010
|
// src/BedrockModule/native-modules/natives/setSecureScreen.ts
|
|
1023
1011
|
function setSecureScreen(options) {
|
|
1024
|
-
return
|
|
1012
|
+
return CommonModule2.setSecureScreen(options);
|
|
1025
1013
|
}
|
|
1026
1014
|
|
|
1027
1015
|
// src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts
|
|
1028
1016
|
async function setScreenAwakeMode(options) {
|
|
1029
|
-
return
|
|
1017
|
+
return CommonModule2.setScreenAwakeMode(options);
|
|
1030
1018
|
}
|
|
1031
1019
|
|
|
1032
1020
|
// src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts
|
|
1033
1021
|
function getNetworkStatus() {
|
|
1034
|
-
return
|
|
1022
|
+
return CommonModule2.getNetworkStatus();
|
|
1035
1023
|
}
|
|
1036
1024
|
|
|
1037
1025
|
// src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts
|
|
1038
1026
|
async function setIosSwipeGestureEnabled(options) {
|
|
1039
|
-
if (
|
|
1027
|
+
if (CommonModule2.setIosSwipeGestureEnabled == null) {
|
|
1040
1028
|
return;
|
|
1041
1029
|
}
|
|
1042
|
-
return
|
|
1030
|
+
return CommonModule2.setIosSwipeGestureEnabled(options);
|
|
1043
1031
|
}
|
|
1044
1032
|
|
|
1045
1033
|
// src/BedrockModule/native-modules/natives/openURL.ts
|
|
@@ -1054,25 +1042,17 @@ function getPlatformOS() {
|
|
|
1054
1042
|
return Platform3.OS;
|
|
1055
1043
|
}
|
|
1056
1044
|
|
|
1057
|
-
// src/
|
|
1058
|
-
import { NativeModules as NativeModules2 } from "react-native";
|
|
1059
|
-
var BedrockCoreModule = NativeModules2.BedrockCoreModule;
|
|
1060
|
-
|
|
1061
|
-
// src/AppsInTossModule/native-modules/tossCore.ts
|
|
1062
|
-
import { NativeModules as NativeModules3 } from "react-native";
|
|
1063
|
-
var TossCoreModule = NativeModules3.TossCoreModule;
|
|
1045
|
+
// src/MiniAppModule/native-modules/tossCore.ts
|
|
1064
1046
|
function tossCoreEventLog(params) {
|
|
1065
1047
|
const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
|
|
1066
1048
|
const isSandbox = getOperationalEnvironment() === "sandbox";
|
|
1067
1049
|
if (!supported || isSandbox) {
|
|
1068
1050
|
return;
|
|
1069
1051
|
}
|
|
1070
|
-
TossCoreModule.eventLog({
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
params: params.params
|
|
1075
|
-
}
|
|
1052
|
+
return TossCoreModule.eventLog({
|
|
1053
|
+
log_name: params.log_name,
|
|
1054
|
+
log_type: params.log_type,
|
|
1055
|
+
params: params.params
|
|
1076
1056
|
});
|
|
1077
1057
|
}
|
|
1078
1058
|
|
|
@@ -1081,12 +1061,8 @@ var INTERNAL__module = {
|
|
|
1081
1061
|
tossCoreEventLog
|
|
1082
1062
|
};
|
|
1083
1063
|
export {
|
|
1084
|
-
AppsInTossModule,
|
|
1085
|
-
BedrockCoreModule,
|
|
1086
|
-
BedrockModule,
|
|
1087
1064
|
GoogleAdMob,
|
|
1088
1065
|
IAP,
|
|
1089
|
-
AppsInTossModuleInstance as INTERNAL__AppsInTossModule,
|
|
1090
1066
|
INTERNAL__appBridgeHandler,
|
|
1091
1067
|
INTERNAL__module,
|
|
1092
1068
|
StartUpdateLocationPermissionError,
|
|
@@ -1095,6 +1071,7 @@ export {
|
|
|
1095
1071
|
appLogin,
|
|
1096
1072
|
appsInTossEvent,
|
|
1097
1073
|
appsInTossSignTossCert,
|
|
1074
|
+
checkoutPayment,
|
|
1098
1075
|
closeView,
|
|
1099
1076
|
contactsViral,
|
|
1100
1077
|
eventLog,
|
|
@@ -1105,6 +1082,7 @@ export {
|
|
|
1105
1082
|
getCurrentLocation,
|
|
1106
1083
|
getDeviceId,
|
|
1107
1084
|
getGameCenterGameProfile,
|
|
1085
|
+
getGroupId,
|
|
1108
1086
|
getIsTossLoginIntegratedService,
|
|
1109
1087
|
getLocale,
|
|
1110
1088
|
getNetworkStatus,
|
|
@@ -1124,6 +1102,8 @@ export {
|
|
|
1124
1102
|
openURL2 as openURL,
|
|
1125
1103
|
processProductGrant,
|
|
1126
1104
|
requestOneTimePurchase,
|
|
1105
|
+
safePostMessage,
|
|
1106
|
+
safeSyncPostMessage,
|
|
1127
1107
|
saveBase64Data,
|
|
1128
1108
|
setClipboardText,
|
|
1129
1109
|
setDeviceOrientation,
|
|
@@ -1131,6 +1111,7 @@ export {
|
|
|
1131
1111
|
setScreenAwakeMode,
|
|
1132
1112
|
setSecureScreen,
|
|
1133
1113
|
share,
|
|
1114
|
+
shareWithScheme,
|
|
1134
1115
|
startUpdateLocation,
|
|
1135
1116
|
submitGameCenterLeaderBoardScore
|
|
1136
1117
|
};
|