@apps-in-toss/native-modules 1.14.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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.cjs
CHANGED
|
@@ -20,12 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
AppsInTossModule: () => AppsInTossModule,
|
|
24
|
-
BedrockCoreModule: () => BedrockCoreModule,
|
|
25
|
-
BedrockModule: () => BedrockModule,
|
|
26
23
|
GoogleAdMob: () => GoogleAdMob,
|
|
27
24
|
IAP: () => IAP,
|
|
28
|
-
INTERNAL__AppsInTossModule: () => AppsInTossModuleInstance,
|
|
29
25
|
INTERNAL__appBridgeHandler: () => INTERNAL__appBridgeHandler,
|
|
30
26
|
INTERNAL__module: () => INTERNAL__module,
|
|
31
27
|
StartUpdateLocationPermissionError: () => import_types8.StartUpdateLocationPermissionError,
|
|
@@ -34,6 +30,7 @@ __export(index_exports, {
|
|
|
34
30
|
appLogin: () => appLogin,
|
|
35
31
|
appsInTossEvent: () => appsInTossEvent,
|
|
36
32
|
appsInTossSignTossCert: () => appsInTossSignTossCert,
|
|
33
|
+
checkoutPayment: () => checkoutPayment,
|
|
37
34
|
closeView: () => closeView,
|
|
38
35
|
contactsViral: () => contactsViral,
|
|
39
36
|
eventLog: () => eventLog,
|
|
@@ -44,6 +41,7 @@ __export(index_exports, {
|
|
|
44
41
|
getCurrentLocation: () => getCurrentLocation,
|
|
45
42
|
getDeviceId: () => getDeviceId,
|
|
46
43
|
getGameCenterGameProfile: () => getGameCenterGameProfile,
|
|
44
|
+
getGroupId: () => getGroupId,
|
|
47
45
|
getIsTossLoginIntegratedService: () => getIsTossLoginIntegratedService,
|
|
48
46
|
getLocale: () => getLocale,
|
|
49
47
|
getNetworkStatus: () => getNetworkStatus,
|
|
@@ -63,6 +61,8 @@ __export(index_exports, {
|
|
|
63
61
|
openURL: () => openURL2,
|
|
64
62
|
processProductGrant: () => processProductGrant,
|
|
65
63
|
requestOneTimePurchase: () => requestOneTimePurchase,
|
|
64
|
+
safePostMessage: () => safePostMessage,
|
|
65
|
+
safeSyncPostMessage: () => safeSyncPostMessage,
|
|
66
66
|
saveBase64Data: () => saveBase64Data,
|
|
67
67
|
setClipboardText: () => setClipboardText,
|
|
68
68
|
setDeviceOrientation: () => setDeviceOrientation,
|
|
@@ -70,35 +70,48 @@ __export(index_exports, {
|
|
|
70
70
|
setScreenAwakeMode: () => setScreenAwakeMode,
|
|
71
71
|
setSecureScreen: () => setSecureScreen,
|
|
72
72
|
share: () => share,
|
|
73
|
+
shareWithScheme: () => shareWithScheme,
|
|
73
74
|
startUpdateLocation: () => startUpdateLocation,
|
|
74
75
|
submitGameCenterLeaderBoardScore: () => submitGameCenterLeaderBoardScore
|
|
75
76
|
});
|
|
76
77
|
module.exports = __toCommonJS(index_exports);
|
|
77
78
|
|
|
78
|
-
// src/
|
|
79
|
-
var
|
|
79
|
+
// src/MiniAppModule.brick.ts
|
|
80
|
+
var import_brick_module = require("brick-module");
|
|
81
|
+
var MiniAppModule = import_brick_module.BrickModule.get("MiniAppModule");
|
|
82
|
+
function safePostMessage(method, params) {
|
|
83
|
+
return MiniAppModule.postMessage(method, params, {});
|
|
84
|
+
}
|
|
85
|
+
function safeSyncPostMessage(method, params) {
|
|
86
|
+
return MiniAppModule.postMessageSync(method, params, {});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// src/MiniAppModule/native-event-emitter/appsInTossEvent.ts
|
|
90
|
+
var import_react_native4 = require("@granite-js/react-native");
|
|
80
91
|
|
|
81
|
-
// src/
|
|
92
|
+
// src/MiniAppModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
82
93
|
var import_types = require("@apps-in-toss/types");
|
|
83
|
-
var
|
|
94
|
+
var import_react_native = require("@granite-js/react-native");
|
|
95
|
+
|
|
96
|
+
// src/TossCoreModule.brick.ts
|
|
97
|
+
var import_brick_module2 = require("brick-module");
|
|
98
|
+
var TossCoreModule = import_brick_module2.BrickModule.get("TossCoreModule");
|
|
84
99
|
|
|
85
|
-
// src/
|
|
86
|
-
var
|
|
87
|
-
var
|
|
88
|
-
var AppsInTossModuleInstance = Module;
|
|
89
|
-
var AppsInTossModule = Module;
|
|
100
|
+
// src/CommonModule.brick.ts
|
|
101
|
+
var import_brick_module3 = require("brick-module");
|
|
102
|
+
var CommonModule = import_brick_module3.BrickModule.get("CommonModule");
|
|
90
103
|
|
|
91
|
-
// src/
|
|
104
|
+
// src/MiniAppModule/native-modules/permissions/openPermissionDialog.ts
|
|
92
105
|
function openPermissionDialog(permission) {
|
|
93
|
-
return
|
|
106
|
+
return safePostMessage("openPermissionDialog", permission);
|
|
94
107
|
}
|
|
95
108
|
|
|
96
|
-
// src/
|
|
109
|
+
// src/MiniAppModule/native-modules/getPermission.ts
|
|
97
110
|
function getPermission(permission) {
|
|
98
|
-
return
|
|
111
|
+
return safePostMessage("getPermission", permission);
|
|
99
112
|
}
|
|
100
113
|
|
|
101
|
-
// src/
|
|
114
|
+
// src/MiniAppModule/native-modules/permissions/requestPermission.ts
|
|
102
115
|
async function requestPermission(permission) {
|
|
103
116
|
const permissionStatus = await getPermission(permission);
|
|
104
117
|
switch (permissionStatus) {
|
|
@@ -110,12 +123,8 @@ async function requestPermission(permission) {
|
|
|
110
123
|
}
|
|
111
124
|
}
|
|
112
125
|
|
|
113
|
-
// src/
|
|
114
|
-
var
|
|
115
|
-
var nativeEventEmitter = new import_react_native2.NativeEventEmitter(AppsInTossModuleInstance);
|
|
116
|
-
|
|
117
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
118
|
-
var UpdateLocationEvent = class extends import_react_native3.GraniteEventDefinition {
|
|
126
|
+
// src/MiniAppModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
127
|
+
var UpdateLocationEvent = class extends import_react_native.GraniteEventDefinition {
|
|
119
128
|
name = "updateLocationEvent";
|
|
120
129
|
subscriptionCount = 0;
|
|
121
130
|
ref = {
|
|
@@ -124,7 +133,7 @@ var UpdateLocationEvent = class extends import_react_native3.GraniteEventDefinit
|
|
|
124
133
|
};
|
|
125
134
|
remove() {
|
|
126
135
|
if (--this.subscriptionCount === 0) {
|
|
127
|
-
|
|
136
|
+
safeSyncPostMessage("stopUpdateLocation", {});
|
|
128
137
|
}
|
|
129
138
|
this.ref.remove();
|
|
130
139
|
}
|
|
@@ -134,25 +143,29 @@ var UpdateLocationEvent = class extends import_react_native3.GraniteEventDefinit
|
|
|
134
143
|
onError(new import_types.GetCurrentLocationPermissionError());
|
|
135
144
|
return;
|
|
136
145
|
}
|
|
137
|
-
void
|
|
138
|
-
const
|
|
146
|
+
void safePostMessage("startUpdateLocation", options).catch(onError);
|
|
147
|
+
const unsubscribe = MiniAppModule.onSendEvent(({ eventName, body }) => {
|
|
148
|
+
if (eventName === "updateLocation") {
|
|
149
|
+
onEvent(body);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
139
152
|
this.ref = {
|
|
140
|
-
remove: () =>
|
|
153
|
+
remove: () => unsubscribe.remove()
|
|
141
154
|
};
|
|
142
155
|
this.subscriptionCount++;
|
|
143
156
|
}).catch(onError);
|
|
144
157
|
}
|
|
145
158
|
};
|
|
146
159
|
|
|
147
|
-
// src/
|
|
148
|
-
var
|
|
160
|
+
// src/MiniAppModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
161
|
+
var import_react_native2 = require("@granite-js/react-native");
|
|
149
162
|
|
|
150
163
|
// src/utils/generateUUID.ts
|
|
151
164
|
function generateUUID(placeholder) {
|
|
152
165
|
return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
|
|
153
166
|
}
|
|
154
167
|
|
|
155
|
-
// src/
|
|
168
|
+
// src/MiniAppModule/native-event-emitter/internal/appBridge.ts
|
|
156
169
|
var INTERNAL__callbacks = /* @__PURE__ */ new Map();
|
|
157
170
|
function invokeAppBridgeCallback(id, ...args) {
|
|
158
171
|
const callback = INTERNAL__callbacks.get(id);
|
|
@@ -162,15 +175,7 @@ function invokeAppBridgeCallback(id, ...args) {
|
|
|
162
175
|
function invokeAppBridgeMethod(methodName, params, callbacks) {
|
|
163
176
|
const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
|
|
164
177
|
const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
|
|
165
|
-
const
|
|
166
|
-
if (method == null) {
|
|
167
|
-
onError(new Error(`'${methodName}' is not defined in AppsInTossModule`));
|
|
168
|
-
return unregisterAll;
|
|
169
|
-
}
|
|
170
|
-
const promise = method({
|
|
171
|
-
params,
|
|
172
|
-
callbacks: callbackMap
|
|
173
|
-
});
|
|
178
|
+
const promise = MiniAppModule.postMessage(methodName, params, callbackMap);
|
|
174
179
|
void promise.then(onSuccess).catch(onError);
|
|
175
180
|
return unregisterAll;
|
|
176
181
|
}
|
|
@@ -205,9 +210,8 @@ var INTERNAL__appBridgeHandler = {
|
|
|
205
210
|
getCallbackIds
|
|
206
211
|
};
|
|
207
212
|
|
|
208
|
-
// src/
|
|
209
|
-
var
|
|
210
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native4.GraniteEventDefinition {
|
|
213
|
+
// src/MiniAppModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
214
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native2.GraniteEventDefinition {
|
|
211
215
|
static INTERNAL__appBridgeSubscription;
|
|
212
216
|
name = "appBridgeCallbackEvent";
|
|
213
217
|
constructor() {
|
|
@@ -222,10 +226,12 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_
|
|
|
222
226
|
if (_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription != null) {
|
|
223
227
|
return;
|
|
224
228
|
}
|
|
225
|
-
|
|
226
|
-
"appBridgeCallback"
|
|
227
|
-
|
|
228
|
-
|
|
229
|
+
const subscription = MiniAppModule.onSendEvent(({ eventName, body }) => {
|
|
230
|
+
if (eventName === "appBridgeCallback") {
|
|
231
|
+
this.ensureInvokeAppBridgeCallback(body);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription = () => subscription.remove();
|
|
229
235
|
}
|
|
230
236
|
ensureInvokeAppBridgeCallback(result) {
|
|
231
237
|
if (typeof result === "object" && typeof result.name === "string") {
|
|
@@ -236,60 +242,62 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_
|
|
|
236
242
|
}
|
|
237
243
|
};
|
|
238
244
|
|
|
239
|
-
// src/
|
|
240
|
-
var
|
|
241
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends
|
|
245
|
+
// src/MiniAppModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
246
|
+
var import_react_native3 = require("@granite-js/react-native");
|
|
247
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native3.GraniteEventDefinition {
|
|
242
248
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
243
|
-
|
|
249
|
+
unsubscribe = null;
|
|
244
250
|
remove() {
|
|
245
|
-
this.
|
|
246
|
-
this.
|
|
251
|
+
this.unsubscribe?.();
|
|
252
|
+
this.unsubscribe = null;
|
|
247
253
|
}
|
|
248
254
|
listener(options, onEvent, onError) {
|
|
249
|
-
const subscription =
|
|
250
|
-
if (
|
|
251
|
-
if (
|
|
252
|
-
|
|
255
|
+
const subscription = MiniAppModule.onSendEvent(({ eventName, body }) => {
|
|
256
|
+
if (eventName === "visibilityChangedByTransparentServiceWeb") {
|
|
257
|
+
if (this.isVisibilityChangedByTransparentServiceWebResult(body)) {
|
|
258
|
+
if (body.callbackId === options.callbackId) {
|
|
259
|
+
onEvent(body.isVisible);
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
onError(new Error("Invalid visibility changed by transparent service web result"));
|
|
253
263
|
}
|
|
254
|
-
} else {
|
|
255
|
-
onError(new Error("Invalid visibility changed by transparent service web result"));
|
|
256
264
|
}
|
|
257
265
|
});
|
|
258
|
-
this.
|
|
266
|
+
this.unsubscribe = () => subscription.remove();
|
|
259
267
|
}
|
|
260
268
|
isVisibilityChangedByTransparentServiceWebResult(params) {
|
|
261
269
|
return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
|
|
262
270
|
}
|
|
263
271
|
};
|
|
264
272
|
|
|
265
|
-
// src/
|
|
266
|
-
var appsInTossEvent = new
|
|
273
|
+
// src/MiniAppModule/native-event-emitter/appsInTossEvent.ts
|
|
274
|
+
var appsInTossEvent = new import_react_native4.GraniteEvent([
|
|
267
275
|
new UpdateLocationEvent(),
|
|
268
276
|
// Internal events
|
|
269
277
|
new AppBridgeCallbackEvent(),
|
|
270
278
|
new VisibilityChangedByTransparentServiceWebEvent()
|
|
271
279
|
]);
|
|
272
280
|
|
|
273
|
-
// src/
|
|
281
|
+
// src/MiniAppModule/native-modules/ads/googleAdMobV2.ts
|
|
274
282
|
var import_es_toolkit = require("es-toolkit");
|
|
275
283
|
|
|
276
284
|
// src/utils/getReferrer.ts
|
|
277
|
-
var
|
|
285
|
+
var import_react_native5 = require("@granite-js/react-native");
|
|
278
286
|
function getReferrer() {
|
|
279
287
|
try {
|
|
280
|
-
return new URL((0,
|
|
288
|
+
return new URL((0, import_react_native5.getSchemeUri)()).searchParams.get("referrer");
|
|
281
289
|
} catch {
|
|
282
290
|
return null;
|
|
283
291
|
}
|
|
284
292
|
}
|
|
285
293
|
|
|
286
|
-
// src/
|
|
294
|
+
// src/MiniAppModule/native-modules/getOperationalEnvironment.ts
|
|
287
295
|
function getOperationalEnvironment() {
|
|
288
|
-
return
|
|
296
|
+
return MiniAppModule.getConstants().operationalEnvironment;
|
|
289
297
|
}
|
|
290
298
|
|
|
291
|
-
// src/
|
|
292
|
-
var
|
|
299
|
+
// src/MiniAppModule/native-modules/isMinVersionSupported.ts
|
|
300
|
+
var import_react_native6 = require("react-native");
|
|
293
301
|
|
|
294
302
|
// src/utils/compareVersion.ts
|
|
295
303
|
var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
|
|
@@ -358,14 +366,14 @@ var compareVersions = (v1, v2) => {
|
|
|
358
366
|
return 0;
|
|
359
367
|
};
|
|
360
368
|
|
|
361
|
-
// src/
|
|
369
|
+
// src/MiniAppModule/native-modules/isMinVersionSupported.ts
|
|
362
370
|
function isMinVersionSupported(minVersions) {
|
|
363
|
-
const operationalEnvironment =
|
|
371
|
+
const operationalEnvironment = MiniAppModule.getConstants().operationalEnvironment;
|
|
364
372
|
if (operationalEnvironment === "sandbox") {
|
|
365
373
|
return true;
|
|
366
374
|
}
|
|
367
|
-
const currentVersion =
|
|
368
|
-
const isIOS =
|
|
375
|
+
const currentVersion = MiniAppModule.getConstants().tossAppVersion;
|
|
376
|
+
const isIOS = import_react_native6.Platform.OS === "ios";
|
|
369
377
|
const minVersion = isIOS ? minVersions.ios : minVersions.android;
|
|
370
378
|
if (minVersion === void 0) {
|
|
371
379
|
return false;
|
|
@@ -379,7 +387,7 @@ function isMinVersionSupported(minVersions) {
|
|
|
379
387
|
return compareVersions(currentVersion, minVersion) >= 0;
|
|
380
388
|
}
|
|
381
389
|
|
|
382
|
-
// src/
|
|
390
|
+
// src/MiniAppModule/native-modules/ads/googleAdMobV2.ts
|
|
383
391
|
function loadAppsInTossAdMob(params) {
|
|
384
392
|
if (!loadAppsInTossAdMob.isSupported()) {
|
|
385
393
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
@@ -474,24 +482,24 @@ function isAppsInTossAdMobLoadedSupported() {
|
|
|
474
482
|
}
|
|
475
483
|
isAppsInTossAdMobLoaded.isSupported = isAppsInTossAdMobLoadedSupported;
|
|
476
484
|
|
|
477
|
-
// src/
|
|
485
|
+
// src/MiniAppModule/native-modules/checkoutPayment.ts
|
|
478
486
|
async function checkoutPayment(options) {
|
|
479
|
-
return
|
|
487
|
+
return safePostMessage("checkoutPayment", options.params);
|
|
480
488
|
}
|
|
481
489
|
|
|
482
|
-
// src/
|
|
490
|
+
// src/MiniAppModule/native-modules/appLogin.ts
|
|
483
491
|
async function appLogin() {
|
|
484
|
-
return
|
|
492
|
+
return safePostMessage("appLogin", {});
|
|
485
493
|
}
|
|
486
494
|
|
|
487
|
-
// src/
|
|
495
|
+
// src/MiniAppModule/native-modules/eventLog.ts
|
|
488
496
|
function normalizeParams(params) {
|
|
489
497
|
return Object.fromEntries(
|
|
490
498
|
Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
|
|
491
499
|
);
|
|
492
500
|
}
|
|
493
501
|
async function eventLog(params) {
|
|
494
|
-
if (
|
|
502
|
+
if (MiniAppModule.getConstants().operationalEnvironment === "sandbox") {
|
|
495
503
|
console.log("[eventLogDebug]", {
|
|
496
504
|
log_name: params.log_name,
|
|
497
505
|
log_type: params.log_type,
|
|
@@ -506,17 +514,17 @@ async function eventLog(params) {
|
|
|
506
514
|
if (!isSupported) {
|
|
507
515
|
return;
|
|
508
516
|
}
|
|
509
|
-
return
|
|
517
|
+
return safePostMessage("eventLog", {
|
|
510
518
|
log_name: params.log_name,
|
|
511
519
|
log_type: params.log_type,
|
|
512
520
|
params: normalizeParams(params.params)
|
|
513
521
|
});
|
|
514
522
|
}
|
|
515
523
|
|
|
516
|
-
// src/
|
|
524
|
+
// src/MiniAppModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts
|
|
517
525
|
var import_types2 = require("@apps-in-toss/types");
|
|
518
526
|
|
|
519
|
-
// src/
|
|
527
|
+
// src/MiniAppModule/native-modules/permissions/createPermissionFunction.ts
|
|
520
528
|
function createPermissionFunction({
|
|
521
529
|
handler,
|
|
522
530
|
permission,
|
|
@@ -534,12 +542,12 @@ function createPermissionFunction({
|
|
|
534
542
|
return permissionFunction;
|
|
535
543
|
}
|
|
536
544
|
|
|
537
|
-
// src/
|
|
545
|
+
// src/MiniAppModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts
|
|
538
546
|
var DEFAULT_MAX_COUNT = 10;
|
|
539
547
|
var DEFAULT_MAX_WIDTH = 1024;
|
|
540
548
|
var fetchAlbumPhotos = createPermissionFunction({
|
|
541
549
|
handler: async (options) => {
|
|
542
|
-
return
|
|
550
|
+
return safePostMessage("fetchAlbumPhotos", {
|
|
543
551
|
...options,
|
|
544
552
|
maxCount: options?.maxCount ?? DEFAULT_MAX_COUNT,
|
|
545
553
|
maxWidth: options?.maxWidth ?? DEFAULT_MAX_WIDTH
|
|
@@ -552,11 +560,11 @@ var fetchAlbumPhotos = createPermissionFunction({
|
|
|
552
560
|
error: import_types2.FetchAlbumPhotosPermissionError
|
|
553
561
|
});
|
|
554
562
|
|
|
555
|
-
// src/
|
|
563
|
+
// src/MiniAppModule/native-modules/permissions/fetchContacts/fetchContacts.ts
|
|
556
564
|
var import_types3 = require("@apps-in-toss/types");
|
|
557
565
|
var fetchContacts = createPermissionFunction({
|
|
558
566
|
handler: async (options) => {
|
|
559
|
-
const contacts = await
|
|
567
|
+
const contacts = await safePostMessage("fetchContacts", options);
|
|
560
568
|
return {
|
|
561
569
|
result: contacts.result,
|
|
562
570
|
nextOffset: contacts.nextOffset ?? null,
|
|
@@ -570,11 +578,11 @@ var fetchContacts = createPermissionFunction({
|
|
|
570
578
|
error: import_types3.FetchContactsPermissionError
|
|
571
579
|
});
|
|
572
580
|
|
|
573
|
-
// src/
|
|
581
|
+
// src/MiniAppModule/native-modules/permissions/getClipboardText/getClipboardText.ts
|
|
574
582
|
var import_types4 = require("@apps-in-toss/types");
|
|
575
583
|
var getClipboardText = createPermissionFunction({
|
|
576
584
|
handler: () => {
|
|
577
|
-
return
|
|
585
|
+
return safePostMessage("getClipboardText", {});
|
|
578
586
|
},
|
|
579
587
|
permission: {
|
|
580
588
|
name: "clipboard",
|
|
@@ -583,11 +591,11 @@ var getClipboardText = createPermissionFunction({
|
|
|
583
591
|
error: import_types4.GetClipboardTextPermissionError
|
|
584
592
|
});
|
|
585
593
|
|
|
586
|
-
// src/
|
|
594
|
+
// src/MiniAppModule/native-modules/permissions/getCurrentLocation/getCurrentLocation.ts
|
|
587
595
|
var import_types5 = require("@apps-in-toss/types");
|
|
588
596
|
var getCurrentLocation = createPermissionFunction({
|
|
589
597
|
handler: async (options) => {
|
|
590
|
-
return
|
|
598
|
+
return safePostMessage("getCurrentLocation", options);
|
|
591
599
|
},
|
|
592
600
|
permission: {
|
|
593
601
|
name: "geolocation",
|
|
@@ -596,11 +604,11 @@ var getCurrentLocation = createPermissionFunction({
|
|
|
596
604
|
error: import_types5.GetCurrentLocationPermissionError
|
|
597
605
|
});
|
|
598
606
|
|
|
599
|
-
// src/
|
|
607
|
+
// src/MiniAppModule/native-modules/permissions/setClipboardText/setClipboardText.ts
|
|
600
608
|
var import_types6 = require("@apps-in-toss/types");
|
|
601
609
|
var setClipboardText = createPermissionFunction({
|
|
602
610
|
handler: (text) => {
|
|
603
|
-
return
|
|
611
|
+
return safePostMessage("setClipboardText", { text });
|
|
604
612
|
},
|
|
605
613
|
permission: {
|
|
606
614
|
name: "clipboard",
|
|
@@ -609,11 +617,11 @@ var setClipboardText = createPermissionFunction({
|
|
|
609
617
|
error: import_types6.SetClipboardTextPermissionError
|
|
610
618
|
});
|
|
611
619
|
|
|
612
|
-
// src/
|
|
620
|
+
// src/MiniAppModule/native-modules/permissions/openCamera/openCamera.ts
|
|
613
621
|
var import_types7 = require("@apps-in-toss/types");
|
|
614
622
|
var openCamera = createPermissionFunction({
|
|
615
623
|
handler: (options) => {
|
|
616
|
-
return
|
|
624
|
+
return safePostMessage("openCamera", {
|
|
617
625
|
base64: false,
|
|
618
626
|
maxWidth: 1024,
|
|
619
627
|
...options
|
|
@@ -626,51 +634,33 @@ var openCamera = createPermissionFunction({
|
|
|
626
634
|
error: import_types7.OpenCameraPermissionError
|
|
627
635
|
});
|
|
628
636
|
|
|
629
|
-
// src/
|
|
637
|
+
// src/MiniAppModule/native-modules/getDeviceId.ts
|
|
630
638
|
function getDeviceId() {
|
|
631
|
-
return
|
|
639
|
+
return MiniAppModule.getConstants().deviceId;
|
|
632
640
|
}
|
|
633
641
|
|
|
634
|
-
// src/
|
|
642
|
+
// src/MiniAppModule/native-modules/getTossAppVersion.ts
|
|
635
643
|
function getTossAppVersion() {
|
|
636
|
-
return
|
|
644
|
+
return MiniAppModule.getConstants().tossAppVersion;
|
|
637
645
|
}
|
|
638
646
|
|
|
639
|
-
// src/
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
ios: "5.239.0"
|
|
643
|
-
};
|
|
644
|
-
async function getTossShareLink(path, ogImageUrl) {
|
|
645
|
-
if (!isMinVersionSupported(V2_MIN_VERSION)) {
|
|
646
|
-
return await getTossShareLinkV1(path);
|
|
647
|
-
}
|
|
648
|
-
const params = {
|
|
649
|
-
params: {
|
|
650
|
-
url: path,
|
|
651
|
-
ogImageUrl
|
|
652
|
-
}
|
|
653
|
-
};
|
|
654
|
-
const { shareLink } = await AppsInTossModule.getTossShareLink(params);
|
|
655
|
-
return shareLink;
|
|
656
|
-
}
|
|
657
|
-
async function getTossShareLinkV1(path) {
|
|
658
|
-
const { shareLink } = await AppsInTossModule.getTossShareLink({});
|
|
647
|
+
// src/MiniAppModule/native-modules/getTossShareLink.ts
|
|
648
|
+
async function getTossShareLink(path) {
|
|
649
|
+
const { shareLink } = await safePostMessage("getTossShareLink", {});
|
|
659
650
|
const shareUrl = new URL(shareLink);
|
|
660
651
|
shareUrl.searchParams.set("deep_link_value", path);
|
|
661
652
|
shareUrl.searchParams.set("af_dp", path);
|
|
662
653
|
return shareUrl.toString();
|
|
663
654
|
}
|
|
664
655
|
|
|
665
|
-
// src/
|
|
666
|
-
var
|
|
667
|
-
};
|
|
656
|
+
// src/MiniAppModule/native-modules/iap.ts
|
|
657
|
+
var import_es_toolkit2 = require("es-toolkit");
|
|
668
658
|
function iapCreateOneTimePurchaseOrder(params) {
|
|
669
659
|
const sku = params.sku ?? params.productId;
|
|
670
|
-
return
|
|
660
|
+
return safePostMessage("iapCreateOneTimePurchaseOrder", { productId: sku });
|
|
671
661
|
}
|
|
672
662
|
function processProductGrant(params) {
|
|
673
|
-
return
|
|
663
|
+
return safePostMessage("processProductGrant", { orderId: params.orderId, isProductGranted: params.isProductGranted });
|
|
674
664
|
}
|
|
675
665
|
function requestOneTimePurchase(params) {
|
|
676
666
|
const { options, onEvent, onError } = params;
|
|
@@ -698,7 +688,7 @@ function createOneTimePurchaseOrder(params) {
|
|
|
698
688
|
ios: "5.219.0"
|
|
699
689
|
});
|
|
700
690
|
if (!isIAPSupported) {
|
|
701
|
-
return
|
|
691
|
+
return import_es_toolkit2.noop;
|
|
702
692
|
}
|
|
703
693
|
const isProcessProductGrantSupported = isMinVersionSupported({
|
|
704
694
|
android: "5.231.1",
|
|
@@ -708,7 +698,7 @@ function createOneTimePurchaseOrder(params) {
|
|
|
708
698
|
const sku = options.sku ?? options.productId;
|
|
709
699
|
if (!isProcessProductGrantSupported) {
|
|
710
700
|
const v1 = () => {
|
|
711
|
-
|
|
701
|
+
safePostMessage("iapCreateOneTimePurchaseOrder", { productId: sku }).then((response) => {
|
|
712
702
|
Promise.resolve(options.processProductGrant({ orderId: response.orderId })).then(() => {
|
|
713
703
|
onEvent({ type: "success", data: response });
|
|
714
704
|
}).catch((error) => {
|
|
@@ -717,7 +707,7 @@ function createOneTimePurchaseOrder(params) {
|
|
|
717
707
|
}).catch((error) => {
|
|
718
708
|
onError(error);
|
|
719
709
|
});
|
|
720
|
-
return
|
|
710
|
+
return import_es_toolkit2.noop;
|
|
721
711
|
};
|
|
722
712
|
return v1();
|
|
723
713
|
}
|
|
@@ -727,7 +717,7 @@ function createOneTimePurchaseOrder(params) {
|
|
|
727
717
|
{
|
|
728
718
|
onPurchased: async (params2) => {
|
|
729
719
|
const isProductGranted = await options.processProductGrant(params2);
|
|
730
|
-
await
|
|
720
|
+
await safePostMessage("processProductGrant", { orderId: params2.orderId, isProductGranted });
|
|
731
721
|
},
|
|
732
722
|
onSuccess: (result) => {
|
|
733
723
|
onEvent({ type: "success", data: result });
|
|
@@ -747,7 +737,7 @@ async function getProductItemList() {
|
|
|
747
737
|
if (!isSupported) {
|
|
748
738
|
return;
|
|
749
739
|
}
|
|
750
|
-
return
|
|
740
|
+
return safePostMessage("iapGetProductItemList", {});
|
|
751
741
|
}
|
|
752
742
|
async function getPendingOrders() {
|
|
753
743
|
const isSupported = isMinVersionSupported({
|
|
@@ -757,7 +747,7 @@ async function getPendingOrders() {
|
|
|
757
747
|
if (!isSupported) {
|
|
758
748
|
return;
|
|
759
749
|
}
|
|
760
|
-
return
|
|
750
|
+
return safePostMessage("getPendingOrders", {});
|
|
761
751
|
}
|
|
762
752
|
async function getCompletedOrRefundedOrders(params) {
|
|
763
753
|
const isSupported = isMinVersionSupported({
|
|
@@ -767,7 +757,7 @@ async function getCompletedOrRefundedOrders(params) {
|
|
|
767
757
|
if (!isSupported) {
|
|
768
758
|
return;
|
|
769
759
|
}
|
|
770
|
-
return
|
|
760
|
+
return safePostMessage("getCompletedOrRefundedOrders", params ?? { key: null });
|
|
771
761
|
}
|
|
772
762
|
async function completeProductGrant(params) {
|
|
773
763
|
const isSupported = isMinVersionSupported({
|
|
@@ -777,7 +767,7 @@ async function completeProductGrant(params) {
|
|
|
777
767
|
if (!isSupported) {
|
|
778
768
|
return;
|
|
779
769
|
}
|
|
780
|
-
return
|
|
770
|
+
return safePostMessage("completeProductGrant", params.params);
|
|
781
771
|
}
|
|
782
772
|
function createSubscriptionPurchaseOrder(params) {
|
|
783
773
|
const isSupported = isMinVersionSupported({
|
|
@@ -785,7 +775,7 @@ function createSubscriptionPurchaseOrder(params) {
|
|
|
785
775
|
ios: "5.249.0"
|
|
786
776
|
});
|
|
787
777
|
if (!isSupported) {
|
|
788
|
-
return
|
|
778
|
+
return import_es_toolkit2.noop;
|
|
789
779
|
}
|
|
790
780
|
const { options, onEvent, onError } = params;
|
|
791
781
|
const { sku, offerId, processProductGrant: processProductGrant2 } = options;
|
|
@@ -795,7 +785,7 @@ function createSubscriptionPurchaseOrder(params) {
|
|
|
795
785
|
{
|
|
796
786
|
onPurchased: async (purchasedParams) => {
|
|
797
787
|
const isProductGranted = await processProductGrant2(purchasedParams);
|
|
798
|
-
await
|
|
788
|
+
await safePostMessage("processProductGrant", { orderId: purchasedParams.orderId, isProductGranted });
|
|
799
789
|
},
|
|
800
790
|
onSuccess: (result) => {
|
|
801
791
|
onEvent({ type: "success", data: result });
|
|
@@ -816,7 +806,7 @@ var IAP = {
|
|
|
816
806
|
completeProductGrant
|
|
817
807
|
};
|
|
818
808
|
|
|
819
|
-
// src/
|
|
809
|
+
// src/MiniAppModule/native-modules/saveBase64Data.ts
|
|
820
810
|
async function saveBase64Data(params) {
|
|
821
811
|
const isSupported = isMinVersionSupported({
|
|
822
812
|
android: "5.218.0",
|
|
@@ -826,10 +816,10 @@ async function saveBase64Data(params) {
|
|
|
826
816
|
console.warn("saveBase64Data is not supported in this app version");
|
|
827
817
|
return;
|
|
828
818
|
}
|
|
829
|
-
await
|
|
819
|
+
await safePostMessage("saveBase64Data", params);
|
|
830
820
|
}
|
|
831
821
|
|
|
832
|
-
// src/
|
|
822
|
+
// src/MiniAppModule/native-modules/setDeviceOrientation.ts
|
|
833
823
|
async function setDeviceOrientation(options) {
|
|
834
824
|
const isSupported = isMinVersionSupported({
|
|
835
825
|
android: "5.215.0",
|
|
@@ -838,24 +828,21 @@ async function setDeviceOrientation(options) {
|
|
|
838
828
|
if (!isSupported) {
|
|
839
829
|
return;
|
|
840
830
|
}
|
|
841
|
-
return
|
|
831
|
+
return safePostMessage("setDeviceOrientation", options);
|
|
842
832
|
}
|
|
843
833
|
|
|
844
|
-
// src/
|
|
834
|
+
// src/MiniAppModule/native-modules/storage.ts
|
|
845
835
|
function getItem(key) {
|
|
846
|
-
return
|
|
836
|
+
return safePostMessage("getStorageItem", { key });
|
|
847
837
|
}
|
|
848
838
|
function setItem(key, value) {
|
|
849
|
-
return
|
|
850
|
-
key,
|
|
851
|
-
value
|
|
852
|
-
});
|
|
839
|
+
return safePostMessage("setStorageItem", { key, value });
|
|
853
840
|
}
|
|
854
841
|
function removeItem(key) {
|
|
855
|
-
return
|
|
842
|
+
return safePostMessage("removeStorageItem", { key });
|
|
856
843
|
}
|
|
857
844
|
function clearItems() {
|
|
858
|
-
return
|
|
845
|
+
return safePostMessage("clearStorage", {});
|
|
859
846
|
}
|
|
860
847
|
var Storage = {
|
|
861
848
|
getItem,
|
|
@@ -864,10 +851,10 @@ var Storage = {
|
|
|
864
851
|
clearItems
|
|
865
852
|
};
|
|
866
853
|
|
|
867
|
-
// src/
|
|
868
|
-
var
|
|
854
|
+
// src/MiniAppModule/native-modules/openGameCenterLeaderboard.ts
|
|
855
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
869
856
|
|
|
870
|
-
// src/
|
|
857
|
+
// src/MiniAppModule/constants.ts
|
|
871
858
|
var GAME_CENTER_MIN_VERSION = {
|
|
872
859
|
android: "5.221.0",
|
|
873
860
|
ios: "5.221.0"
|
|
@@ -889,7 +876,7 @@ var GET_SERVER_TIME_MIN_VERSION = {
|
|
|
889
876
|
ios: "5.245.0"
|
|
890
877
|
};
|
|
891
878
|
|
|
892
|
-
// src/
|
|
879
|
+
// src/MiniAppModule/native-modules/openGameCenterLeaderboard.ts
|
|
893
880
|
async function openGameCenterLeaderboard() {
|
|
894
881
|
if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
|
|
895
882
|
return;
|
|
@@ -901,35 +888,35 @@ async function openGameCenterLeaderboard() {
|
|
|
901
888
|
const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
|
|
902
889
|
url.searchParams.set("appName", appName);
|
|
903
890
|
url.searchParams.set("referrer", `appsintoss.${appName}`);
|
|
904
|
-
return (0,
|
|
891
|
+
return (0, import_react_native7.openURL)(url.toString());
|
|
905
892
|
}
|
|
906
893
|
|
|
907
|
-
// src/
|
|
894
|
+
// src/MiniAppModule/native-modules/getGameCenterGameProfile.ts
|
|
908
895
|
async function getGameCenterGameProfile() {
|
|
909
896
|
const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
|
|
910
897
|
if (!isSupported) {
|
|
911
898
|
return;
|
|
912
899
|
}
|
|
913
|
-
return
|
|
900
|
+
return safePostMessage("getGameCenterGameProfile", {});
|
|
914
901
|
}
|
|
915
902
|
|
|
916
|
-
// src/
|
|
903
|
+
// src/MiniAppModule/native-modules/submitGameCenterLeaderBoardScore.ts
|
|
917
904
|
async function submitGameCenterLeaderBoardScore(params) {
|
|
918
905
|
const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
|
|
919
906
|
if (!isSupported) {
|
|
920
907
|
return;
|
|
921
908
|
}
|
|
922
|
-
return
|
|
909
|
+
return safePostMessage("submitGameCenterLeaderBoardScore", params);
|
|
923
910
|
}
|
|
924
911
|
|
|
925
|
-
// src/
|
|
912
|
+
// src/MiniAppModule/native-modules/getUserKeyForGame.ts
|
|
926
913
|
async function getUserKeyForGame() {
|
|
927
914
|
const isSupported = isMinVersionSupported(GAME_USER_KEY_MIN_VERSION);
|
|
928
915
|
if (!isSupported) {
|
|
929
916
|
return;
|
|
930
917
|
}
|
|
931
918
|
try {
|
|
932
|
-
const response = await
|
|
919
|
+
const response = await safePostMessage("getUserKeyForGame", {});
|
|
933
920
|
if (response.type === "HASH") {
|
|
934
921
|
return response;
|
|
935
922
|
}
|
|
@@ -942,19 +929,20 @@ async function getUserKeyForGame() {
|
|
|
942
929
|
}
|
|
943
930
|
}
|
|
944
931
|
|
|
945
|
-
// src/
|
|
932
|
+
// src/MiniAppModule/native-modules/grantPromotionRewardForGame.ts
|
|
946
933
|
function isGrantPromotionRewardForGameError(error) {
|
|
947
934
|
return typeof error === "object" && error !== null && "code" in error && typeof error.code === "string" && "message" in error && typeof error.message === "string";
|
|
948
935
|
}
|
|
949
|
-
async function grantPromotionRewardForGame({
|
|
950
|
-
params
|
|
951
|
-
}) {
|
|
936
|
+
async function grantPromotionRewardForGame(params) {
|
|
952
937
|
const isSupported = isMinVersionSupported(GAME_PROMOTION_REWARD_MIN_VERSION);
|
|
953
938
|
if (!isSupported) {
|
|
954
939
|
return;
|
|
955
940
|
}
|
|
956
941
|
try {
|
|
957
|
-
const response = await
|
|
942
|
+
const response = await safePostMessage(
|
|
943
|
+
"grantPromotionRewardForGame",
|
|
944
|
+
params.params
|
|
945
|
+
);
|
|
958
946
|
if (response.key) {
|
|
959
947
|
return response;
|
|
960
948
|
}
|
|
@@ -970,17 +958,17 @@ async function grantPromotionRewardForGame({
|
|
|
970
958
|
}
|
|
971
959
|
}
|
|
972
960
|
|
|
973
|
-
// src/
|
|
961
|
+
// src/MiniAppModule/native-modules/getIsTossLoginIntegratedService.ts
|
|
974
962
|
async function getIsTossLoginIntegratedService() {
|
|
975
963
|
const isSupported = isMinVersionSupported(GET_IS_TOSS_LOGIN_INTEGRATED_SERVICE_MIN_VERSION);
|
|
976
964
|
if (!isSupported) {
|
|
977
965
|
return;
|
|
978
966
|
}
|
|
979
|
-
const response = await
|
|
967
|
+
const response = await safePostMessage("getIsTossLoginIntegratedService", {});
|
|
980
968
|
return response;
|
|
981
969
|
}
|
|
982
970
|
|
|
983
|
-
// src/
|
|
971
|
+
// src/MiniAppModule/native-event-emitter/contactsViral.ts
|
|
984
972
|
function contactsViral(params) {
|
|
985
973
|
const isSupported = isMinVersionSupported({
|
|
986
974
|
android: "5.223.0",
|
|
@@ -1003,38 +991,40 @@ function contactsViral(params) {
|
|
|
1003
991
|
return unregisterCallbacks;
|
|
1004
992
|
}
|
|
1005
993
|
|
|
1006
|
-
// src/
|
|
1007
|
-
|
|
1008
|
-
|
|
994
|
+
// src/MiniAppModule/native-modules/appsInTossSignTossCert.ts
|
|
995
|
+
async function appsInTossSignTossCert(params) {
|
|
996
|
+
const isSupported = isMinVersionSupported({
|
|
1009
997
|
android: "5.233.0",
|
|
1010
998
|
ios: "5.233.0"
|
|
1011
|
-
}
|
|
1012
|
-
USER_NONE: {
|
|
1013
|
-
android: "5.236.0",
|
|
1014
|
-
ios: "5.236.0"
|
|
1015
|
-
}
|
|
1016
|
-
};
|
|
1017
|
-
async function appsInTossSignTossCert(params) {
|
|
1018
|
-
const minVersion = params.skipConfirmDoc === true ? MIN_VERSION_BY_USER_TYPE.USER_NONE : MIN_VERSION_BY_USER_TYPE.USER_PERSONAL;
|
|
1019
|
-
const isSupported = isMinVersionSupported(minVersion);
|
|
999
|
+
});
|
|
1020
1000
|
if (!isSupported) {
|
|
1021
1001
|
console.warn("appsInTossSignTossCert is not supported in this app version");
|
|
1022
1002
|
return;
|
|
1023
1003
|
}
|
|
1024
|
-
await
|
|
1004
|
+
await safePostMessage("appsInTossSignTossCert", params);
|
|
1025
1005
|
}
|
|
1026
1006
|
|
|
1027
|
-
// src/
|
|
1007
|
+
// src/MiniAppModule/native-modules/getGroupId.ts
|
|
1008
|
+
function getGroupId() {
|
|
1009
|
+
return MiniAppModule.getConstants().groupId;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
// src/MiniAppModule/native-modules/shareWithScheme.ts
|
|
1013
|
+
function shareWithScheme(params) {
|
|
1014
|
+
safeSyncPostMessage("shareWithScheme", params);
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
// src/MiniAppModule/native-modules/getServerTime.ts
|
|
1028
1018
|
async function getServerTime() {
|
|
1029
1019
|
const isSupported = isMinVersionSupported(GET_SERVER_TIME_MIN_VERSION);
|
|
1030
1020
|
if (!isSupported) {
|
|
1031
1021
|
return;
|
|
1032
1022
|
}
|
|
1033
|
-
return (await
|
|
1023
|
+
return (await safePostMessage("getServerTime", {})).serverTime;
|
|
1034
1024
|
}
|
|
1035
1025
|
getServerTime.isSupported = () => isMinVersionSupported(GET_SERVER_TIME_MIN_VERSION);
|
|
1036
1026
|
|
|
1037
|
-
// src/
|
|
1027
|
+
// src/MiniAppModule/native-modules/index.ts
|
|
1038
1028
|
var TossPay = {
|
|
1039
1029
|
checkoutPayment
|
|
1040
1030
|
};
|
|
@@ -1044,35 +1034,34 @@ var GoogleAdMob = {
|
|
|
1044
1034
|
isAppsInTossAdMobLoaded
|
|
1045
1035
|
};
|
|
1046
1036
|
|
|
1047
|
-
// src/
|
|
1037
|
+
// src/MiniAppModule/native-event-emitter/startUpdateLocation.ts
|
|
1048
1038
|
function startUpdateLocation(eventParams) {
|
|
1049
1039
|
return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
|
|
1050
1040
|
}
|
|
1051
1041
|
startUpdateLocation.openPermissionDialog = getCurrentLocation.openPermissionDialog;
|
|
1052
1042
|
startUpdateLocation.getPermission = getCurrentLocation.getPermission;
|
|
1053
1043
|
|
|
1054
|
-
// src/
|
|
1044
|
+
// src/MiniAppModule/native-event-emitter/StartUpdateLocationPermissionError.ts
|
|
1055
1045
|
var import_types8 = require("@apps-in-toss/types");
|
|
1056
1046
|
|
|
1057
|
-
// src/
|
|
1047
|
+
// src/MiniAppModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
1058
1048
|
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
1059
1049
|
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
1060
1050
|
}
|
|
1061
1051
|
|
|
1062
1052
|
// src/BedrockModule/native-modules/natives/BedrockModule.ts
|
|
1063
|
-
var
|
|
1064
|
-
var BedrockModule = import_react_native10.NativeModules.BedrockModule;
|
|
1053
|
+
var CommonModule2 = CommonModule;
|
|
1065
1054
|
|
|
1066
1055
|
// src/BedrockModule/native-modules/natives/closeView.ts
|
|
1067
1056
|
async function closeView() {
|
|
1068
|
-
return
|
|
1057
|
+
return CommonModule2.closeView();
|
|
1069
1058
|
}
|
|
1070
1059
|
|
|
1071
1060
|
// src/BedrockModule/native-modules/natives/getLocale.ts
|
|
1072
|
-
var
|
|
1061
|
+
var import_react_native8 = require("react-native");
|
|
1073
1062
|
function getLocale() {
|
|
1074
|
-
const locale =
|
|
1075
|
-
if (
|
|
1063
|
+
const locale = CommonModule2?.getConstants().locale ?? "ko-KR";
|
|
1064
|
+
if (import_react_native8.Platform.OS === "android") {
|
|
1076
1065
|
return replaceUnderbarToHypen(locale);
|
|
1077
1066
|
}
|
|
1078
1067
|
return locale;
|
|
@@ -1083,73 +1072,65 @@ function replaceUnderbarToHypen(locale) {
|
|
|
1083
1072
|
|
|
1084
1073
|
// src/BedrockModule/native-modules/natives/getSchemeUri.ts
|
|
1085
1074
|
function getSchemeUri2() {
|
|
1086
|
-
return
|
|
1075
|
+
return CommonModule2.getConstants().schemeUri;
|
|
1087
1076
|
}
|
|
1088
1077
|
|
|
1089
1078
|
// src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts
|
|
1090
1079
|
function generateHapticFeedback(options) {
|
|
1091
|
-
return
|
|
1080
|
+
return CommonModule2.generateHapticFeedback(options);
|
|
1092
1081
|
}
|
|
1093
1082
|
|
|
1094
1083
|
// src/BedrockModule/native-modules/natives/share.ts
|
|
1095
1084
|
async function share(message) {
|
|
1096
|
-
|
|
1085
|
+
CommonModule2.share(message);
|
|
1097
1086
|
}
|
|
1098
1087
|
|
|
1099
1088
|
// src/BedrockModule/native-modules/natives/setSecureScreen.ts
|
|
1100
1089
|
function setSecureScreen(options) {
|
|
1101
|
-
return
|
|
1090
|
+
return CommonModule2.setSecureScreen(options);
|
|
1102
1091
|
}
|
|
1103
1092
|
|
|
1104
1093
|
// src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts
|
|
1105
1094
|
async function setScreenAwakeMode(options) {
|
|
1106
|
-
return
|
|
1095
|
+
return CommonModule2.setScreenAwakeMode(options);
|
|
1107
1096
|
}
|
|
1108
1097
|
|
|
1109
1098
|
// src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts
|
|
1110
1099
|
function getNetworkStatus() {
|
|
1111
|
-
return
|
|
1100
|
+
return CommonModule2.getNetworkStatus();
|
|
1112
1101
|
}
|
|
1113
1102
|
|
|
1114
1103
|
// src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts
|
|
1115
1104
|
async function setIosSwipeGestureEnabled(options) {
|
|
1116
|
-
if (
|
|
1105
|
+
if (CommonModule2.setIosSwipeGestureEnabled == null) {
|
|
1117
1106
|
return;
|
|
1118
1107
|
}
|
|
1119
|
-
return
|
|
1108
|
+
return CommonModule2.setIosSwipeGestureEnabled(options);
|
|
1120
1109
|
}
|
|
1121
1110
|
|
|
1122
1111
|
// src/BedrockModule/native-modules/natives/openURL.ts
|
|
1123
|
-
var
|
|
1112
|
+
var import_react_native9 = require("react-native");
|
|
1124
1113
|
function openURL2(url) {
|
|
1125
|
-
return
|
|
1114
|
+
return import_react_native9.Linking.openURL(url);
|
|
1126
1115
|
}
|
|
1127
1116
|
|
|
1128
1117
|
// src/BedrockModule/native-modules/natives/getPlatformOS.ts
|
|
1129
|
-
var
|
|
1118
|
+
var import_react_native10 = require("react-native");
|
|
1130
1119
|
function getPlatformOS() {
|
|
1131
|
-
return
|
|
1120
|
+
return import_react_native10.Platform.OS;
|
|
1132
1121
|
}
|
|
1133
1122
|
|
|
1134
|
-
// src/
|
|
1135
|
-
var import_react_native14 = require("react-native");
|
|
1136
|
-
var BedrockCoreModule = import_react_native14.NativeModules.BedrockCoreModule;
|
|
1137
|
-
|
|
1138
|
-
// src/AppsInTossModule/native-modules/tossCore.ts
|
|
1139
|
-
var import_react_native15 = require("react-native");
|
|
1140
|
-
var TossCoreModule = import_react_native15.NativeModules.TossCoreModule;
|
|
1123
|
+
// src/MiniAppModule/native-modules/tossCore.ts
|
|
1141
1124
|
function tossCoreEventLog(params) {
|
|
1142
1125
|
const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
|
|
1143
1126
|
const isSandbox = getOperationalEnvironment() === "sandbox";
|
|
1144
1127
|
if (!supported || isSandbox) {
|
|
1145
1128
|
return;
|
|
1146
1129
|
}
|
|
1147
|
-
TossCoreModule.eventLog({
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
params: params.params
|
|
1152
|
-
}
|
|
1130
|
+
return TossCoreModule.eventLog({
|
|
1131
|
+
log_name: params.log_name,
|
|
1132
|
+
log_type: params.log_type,
|
|
1133
|
+
params: params.params
|
|
1153
1134
|
});
|
|
1154
1135
|
}
|
|
1155
1136
|
|
|
@@ -1159,12 +1140,8 @@ var INTERNAL__module = {
|
|
|
1159
1140
|
};
|
|
1160
1141
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1161
1142
|
0 && (module.exports = {
|
|
1162
|
-
AppsInTossModule,
|
|
1163
|
-
BedrockCoreModule,
|
|
1164
|
-
BedrockModule,
|
|
1165
1143
|
GoogleAdMob,
|
|
1166
1144
|
IAP,
|
|
1167
|
-
INTERNAL__AppsInTossModule,
|
|
1168
1145
|
INTERNAL__appBridgeHandler,
|
|
1169
1146
|
INTERNAL__module,
|
|
1170
1147
|
StartUpdateLocationPermissionError,
|
|
@@ -1173,6 +1150,7 @@ var INTERNAL__module = {
|
|
|
1173
1150
|
appLogin,
|
|
1174
1151
|
appsInTossEvent,
|
|
1175
1152
|
appsInTossSignTossCert,
|
|
1153
|
+
checkoutPayment,
|
|
1176
1154
|
closeView,
|
|
1177
1155
|
contactsViral,
|
|
1178
1156
|
eventLog,
|
|
@@ -1183,6 +1161,7 @@ var INTERNAL__module = {
|
|
|
1183
1161
|
getCurrentLocation,
|
|
1184
1162
|
getDeviceId,
|
|
1185
1163
|
getGameCenterGameProfile,
|
|
1164
|
+
getGroupId,
|
|
1186
1165
|
getIsTossLoginIntegratedService,
|
|
1187
1166
|
getLocale,
|
|
1188
1167
|
getNetworkStatus,
|
|
@@ -1202,6 +1181,8 @@ var INTERNAL__module = {
|
|
|
1202
1181
|
openURL,
|
|
1203
1182
|
processProductGrant,
|
|
1204
1183
|
requestOneTimePurchase,
|
|
1184
|
+
safePostMessage,
|
|
1185
|
+
safeSyncPostMessage,
|
|
1205
1186
|
saveBase64Data,
|
|
1206
1187
|
setClipboardText,
|
|
1207
1188
|
setDeviceOrientation,
|
|
@@ -1209,6 +1190,7 @@ var INTERNAL__module = {
|
|
|
1209
1190
|
setScreenAwakeMode,
|
|
1210
1191
|
setSecureScreen,
|
|
1211
1192
|
share,
|
|
1193
|
+
shareWithScheme,
|
|
1212
1194
|
startUpdateLocation,
|
|
1213
1195
|
submitGameCenterLeaderBoardScore
|
|
1214
1196
|
});
|