@apps-in-toss/native-modules 1.0.3 → 1.1.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 +24 -12
- package/dist/index.cjs +212 -154
- package/dist/index.d.cts +640 -588
- package/dist/index.d.ts +640 -588
- package/dist/index.js +190 -132
- package/package.json +5 -4
- package/src/AppsInTossModule/native-event-emitter/StartUpdateLocationPermissionError.ts +1 -0
- package/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts +5 -0
- package/src/AppsInTossModule/native-event-emitter/event-plugins/BackButtonClickHandleEvent.ts +10 -0
- package/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts +3 -3
- package/src/AppsInTossModule/native-event-emitter/index.ts +1 -0
- package/src/AppsInTossModule/native-event-emitter/internal/appBridge.ts +7 -1
- package/src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts +64 -44
- package/src/AppsInTossModule/native-modules/AppsInTossModule.ts +22 -27
- package/src/AppsInTossModule/native-modules/getPermission.ts +1 -1
- package/src/AppsInTossModule/native-modules/index.ts +9 -6
- package/src/AppsInTossModule/native-modules/permissions/createPermissionFunction.ts +25 -0
- package/src/AppsInTossModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts +109 -0
- package/src/AppsInTossModule/native-modules/{fetchContacts.ts → permissions/fetchContacts/fetchContacts.ts} +51 -40
- package/src/AppsInTossModule/native-modules/permissions/getClipboardText/getClipboardText.ts +87 -0
- package/src/AppsInTossModule/native-modules/permissions/getCurrentLocation/getCurrentLocation.ts +88 -0
- package/src/AppsInTossModule/native-modules/permissions/openCamera/openCamera.ts +99 -0
- package/src/AppsInTossModule/native-modules/{openPermissionDialog.ts → permissions/openPermissionDialog.ts} +3 -3
- package/src/AppsInTossModule/native-modules/{requestPermission.ts → permissions/requestPermission.ts} +2 -2
- package/src/AppsInTossModule/native-modules/permissions/setClipboardText/setClipboardText.ts +75 -0
- package/src/AppsInTossModule/native-modules/saveBase64Data.ts +1 -1
- package/src/async-bridges.ts +9 -6
- package/src/types.ts +0 -106
- package/src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts +0 -88
- package/src/AppsInTossModule/native-modules/getClipboardText.ts +0 -47
- package/src/AppsInTossModule/native-modules/getCurrentLocation.ts +0 -65
- package/src/AppsInTossModule/native-modules/openCamera.ts +0 -81
- package/src/AppsInTossModule/native-modules/setClipboardText.ts +0 -39
package/dist/index.cjs
CHANGED
|
@@ -20,7 +20,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
Accuracy: () => Accuracy,
|
|
24
23
|
AppsInTossModule: () => AppsInTossModule,
|
|
25
24
|
BedrockCoreModule: () => BedrockCoreModule,
|
|
26
25
|
BedrockModule: () => BedrockModule,
|
|
@@ -29,6 +28,7 @@ __export(index_exports, {
|
|
|
29
28
|
INTERNAL__AppsInTossModule: () => AppsInTossModuleInstance,
|
|
30
29
|
INTERNAL__appBridgeHandler: () => INTERNAL__appBridgeHandler,
|
|
31
30
|
INTERNAL__module: () => INTERNAL__module,
|
|
31
|
+
StartUpdateLocationPermissionError: () => import_types8.StartUpdateLocationPermissionError,
|
|
32
32
|
Storage: () => Storage,
|
|
33
33
|
TossPay: () => TossPay,
|
|
34
34
|
appLogin: () => appLogin,
|
|
@@ -68,11 +68,22 @@ __export(index_exports, {
|
|
|
68
68
|
module.exports = __toCommonJS(index_exports);
|
|
69
69
|
|
|
70
70
|
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
71
|
-
var
|
|
71
|
+
var import_react_native9 = require("@granite-js/react-native");
|
|
72
72
|
|
|
73
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/
|
|
73
|
+
// src/AppsInTossModule/native-event-emitter/event-plugins/BackButtonClickHandleEvent.ts
|
|
74
74
|
var import_react_native = require("@granite-js/react-native");
|
|
75
|
-
var
|
|
75
|
+
var BackButtonClickHandleEvent = class extends import_react_native.GraniteEventDefinition {
|
|
76
|
+
name = "backButtonClickEvent";
|
|
77
|
+
remove() {
|
|
78
|
+
}
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
80
|
+
listener(_) {
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
|
|
85
|
+
var import_react_native2 = require("@granite-js/react-native");
|
|
86
|
+
var EntryMessageExitedEvent = class extends import_react_native2.GraniteEventDefinition {
|
|
76
87
|
name = "entryMessageExited";
|
|
77
88
|
remove() {
|
|
78
89
|
}
|
|
@@ -82,8 +93,8 @@ var EntryMessageExitedEvent = class extends import_react_native.GraniteEventDefi
|
|
|
82
93
|
};
|
|
83
94
|
|
|
84
95
|
// src/AppsInTossModule/native-event-emitter/event-plugins/HomeIconButtonClickHandleEvent.ts
|
|
85
|
-
var
|
|
86
|
-
var HomeIconButtonClickHandleEvent = class extends
|
|
96
|
+
var import_react_native3 = require("@granite-js/react-native");
|
|
97
|
+
var HomeIconButtonClickHandleEvent = class extends import_react_native3.GraniteEventDefinition {
|
|
87
98
|
name = "homeIconButtonClickEvent";
|
|
88
99
|
remove() {
|
|
89
100
|
}
|
|
@@ -93,25 +104,26 @@ var HomeIconButtonClickHandleEvent = class extends import_react_native2.GraniteE
|
|
|
93
104
|
};
|
|
94
105
|
|
|
95
106
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
96
|
-
var
|
|
107
|
+
var import_types = require("@apps-in-toss/types");
|
|
108
|
+
var import_react_native6 = require("@granite-js/react-native");
|
|
97
109
|
|
|
98
110
|
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
99
|
-
var
|
|
100
|
-
var Module =
|
|
111
|
+
var import_react_native4 = require("react-native");
|
|
112
|
+
var Module = import_react_native4.TurboModuleRegistry.getEnforcing("AppsInTossModule");
|
|
101
113
|
var AppsInTossModuleInstance = Module;
|
|
102
114
|
var AppsInTossModule = Module;
|
|
103
115
|
|
|
116
|
+
// src/AppsInTossModule/native-modules/permissions/openPermissionDialog.ts
|
|
117
|
+
function openPermissionDialog(permission) {
|
|
118
|
+
return AppsInTossModule.openPermissionDialog(permission);
|
|
119
|
+
}
|
|
120
|
+
|
|
104
121
|
// src/AppsInTossModule/native-modules/getPermission.ts
|
|
105
122
|
function getPermission(permission) {
|
|
106
123
|
return AppsInTossModule.getPermission(permission);
|
|
107
124
|
}
|
|
108
125
|
|
|
109
|
-
// src/AppsInTossModule/native-modules/
|
|
110
|
-
function openPermissionDialog(permission) {
|
|
111
|
-
return AppsInTossModule.openPermissionDialog(permission);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// src/AppsInTossModule/native-modules/requestPermission.ts
|
|
126
|
+
// src/AppsInTossModule/native-modules/permissions/requestPermission.ts
|
|
115
127
|
async function requestPermission(permission) {
|
|
116
128
|
const permissionStatus = await getPermission(permission);
|
|
117
129
|
switch (permissionStatus) {
|
|
@@ -124,11 +136,11 @@ async function requestPermission(permission) {
|
|
|
124
136
|
}
|
|
125
137
|
|
|
126
138
|
// src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
|
|
127
|
-
var
|
|
128
|
-
var nativeEventEmitter = new
|
|
139
|
+
var import_react_native5 = require("react-native");
|
|
140
|
+
var nativeEventEmitter = new import_react_native5.NativeEventEmitter(AppsInTossModuleInstance);
|
|
129
141
|
|
|
130
142
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
131
|
-
var UpdateLocationEvent = class extends
|
|
143
|
+
var UpdateLocationEvent = class extends import_react_native6.GraniteEventDefinition {
|
|
132
144
|
name = "updateLocationEvent";
|
|
133
145
|
subscriptionCount = 0;
|
|
134
146
|
ref = {
|
|
@@ -144,7 +156,7 @@ var UpdateLocationEvent = class extends import_react_native5.GraniteEventDefinit
|
|
|
144
156
|
listener(options, onEvent, onError) {
|
|
145
157
|
requestPermission({ name: "geolocation", access: "access" }).then((permissionStatus) => {
|
|
146
158
|
if (permissionStatus === "denied") {
|
|
147
|
-
onError(new
|
|
159
|
+
onError(new import_types.GetCurrentLocationPermissionError());
|
|
148
160
|
return;
|
|
149
161
|
}
|
|
150
162
|
void AppsInTossModuleInstance.startUpdateLocation(options).catch(onError);
|
|
@@ -158,7 +170,7 @@ var UpdateLocationEvent = class extends import_react_native5.GraniteEventDefinit
|
|
|
158
170
|
};
|
|
159
171
|
|
|
160
172
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
161
|
-
var
|
|
173
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
162
174
|
|
|
163
175
|
// src/utils/generateUUID.ts
|
|
164
176
|
function generateUUID(placeholder) {
|
|
@@ -175,7 +187,12 @@ function invokeAppBridgeCallback(id, ...args) {
|
|
|
175
187
|
function invokeAppBridgeMethod(methodName, params, callbacks) {
|
|
176
188
|
const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
|
|
177
189
|
const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
|
|
178
|
-
const
|
|
190
|
+
const method = AppsInTossModuleInstance[methodName];
|
|
191
|
+
if (method == null) {
|
|
192
|
+
onError(new Error(`'${methodName}' is not defined in AppsInTossModule`));
|
|
193
|
+
return unregisterAll;
|
|
194
|
+
}
|
|
195
|
+
const promise = method({
|
|
179
196
|
params,
|
|
180
197
|
callbacks: callbackMap
|
|
181
198
|
});
|
|
@@ -215,7 +232,7 @@ var INTERNAL__appBridgeHandler = {
|
|
|
215
232
|
|
|
216
233
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
217
234
|
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
218
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends
|
|
235
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native7.GraniteEventDefinition {
|
|
219
236
|
static INTERNAL__appBridgeSubscription;
|
|
220
237
|
name = "appBridgeCallbackEvent";
|
|
221
238
|
constructor() {
|
|
@@ -245,8 +262,8 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_
|
|
|
245
262
|
};
|
|
246
263
|
|
|
247
264
|
// src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
248
|
-
var
|
|
249
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends
|
|
265
|
+
var import_react_native8 = require("@granite-js/react-native");
|
|
266
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native8.GraniteEventDefinition {
|
|
250
267
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
251
268
|
subscription = null;
|
|
252
269
|
remove() {
|
|
@@ -271,22 +288,27 @@ var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_n
|
|
|
271
288
|
};
|
|
272
289
|
|
|
273
290
|
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
274
|
-
var appsInTossEvent = new
|
|
291
|
+
var appsInTossEvent = new import_react_native9.GraniteEvent([
|
|
275
292
|
new UpdateLocationEvent(),
|
|
276
293
|
new EntryMessageExitedEvent(),
|
|
294
|
+
// Navigation Bar events
|
|
277
295
|
new HomeIconButtonClickHandleEvent(),
|
|
296
|
+
new BackButtonClickHandleEvent(),
|
|
278
297
|
// Internal events
|
|
279
298
|
new AppBridgeCallbackEvent(),
|
|
280
299
|
new VisibilityChangedByTransparentServiceWebEvent()
|
|
281
300
|
]);
|
|
282
301
|
|
|
283
|
-
// src/AppsInTossModule/native-
|
|
284
|
-
|
|
285
|
-
|
|
302
|
+
// src/AppsInTossModule/native-modules/ads/googleAdMob.ts
|
|
303
|
+
var import_es_toolkit = require("es-toolkit");
|
|
304
|
+
|
|
305
|
+
// src/AppsInTossModule/native-modules/getOperationalEnvironment.ts
|
|
306
|
+
function getOperationalEnvironment() {
|
|
307
|
+
return AppsInTossModule.operationalEnvironment;
|
|
286
308
|
}
|
|
287
309
|
|
|
288
310
|
// src/AppsInTossModule/native-modules/isMinVersionSupported.ts
|
|
289
|
-
var
|
|
311
|
+
var import_react_native10 = require("react-native");
|
|
290
312
|
|
|
291
313
|
// src/utils/compareVersion.ts
|
|
292
314
|
var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
|
|
@@ -362,7 +384,7 @@ function isMinVersionSupported(minVersions) {
|
|
|
362
384
|
return true;
|
|
363
385
|
}
|
|
364
386
|
const currentVersion = AppsInTossModule.tossAppVersion;
|
|
365
|
-
const isIOS =
|
|
387
|
+
const isIOS = import_react_native10.Platform.OS === "ios";
|
|
366
388
|
const minVersion = isIOS ? minVersions.ios : minVersions.android;
|
|
367
389
|
if (minVersion === void 0) {
|
|
368
390
|
return false;
|
|
@@ -376,42 +398,6 @@ function isMinVersionSupported(minVersions) {
|
|
|
376
398
|
return compareVersions(currentVersion, minVersion) >= 0;
|
|
377
399
|
}
|
|
378
400
|
|
|
379
|
-
// src/AppsInTossModule/native-event-emitter/contactsViral.ts
|
|
380
|
-
function contactsViral(params) {
|
|
381
|
-
const isSupported = isMinVersionSupported({
|
|
382
|
-
android: "5.223.0",
|
|
383
|
-
ios: "5.223.0"
|
|
384
|
-
});
|
|
385
|
-
if (!isSupported) {
|
|
386
|
-
return () => {
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
const { onEvent, onError, options } = params;
|
|
390
|
-
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("contactsViral", options, {
|
|
391
|
-
onRewardFromContactsViral: (result) => {
|
|
392
|
-
onEvent({ type: "sendViral", data: result });
|
|
393
|
-
},
|
|
394
|
-
onSuccess: (result) => {
|
|
395
|
-
onEvent({ type: "close", data: result });
|
|
396
|
-
},
|
|
397
|
-
onError
|
|
398
|
-
});
|
|
399
|
-
return unregisterCallbacks;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
403
|
-
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
404
|
-
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
// src/AppsInTossModule/native-modules/ads/googleAdMob.ts
|
|
408
|
-
var import_es_toolkit = require("es-toolkit");
|
|
409
|
-
|
|
410
|
-
// src/AppsInTossModule/native-modules/getOperationalEnvironment.ts
|
|
411
|
-
function getOperationalEnvironment() {
|
|
412
|
-
return AppsInTossModule.operationalEnvironment;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
401
|
// src/AppsInTossModule/native-modules/ads/googleAdMob.ts
|
|
416
402
|
function loadAdMobInterstitialAd(params) {
|
|
417
403
|
if (!loadAdMobInterstitialAd.isSupported()) {
|
|
@@ -615,54 +601,118 @@ async function eventLog(params) {
|
|
|
615
601
|
});
|
|
616
602
|
}
|
|
617
603
|
|
|
618
|
-
// src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts
|
|
604
|
+
// src/AppsInTossModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts
|
|
605
|
+
var import_types2 = require("@apps-in-toss/types");
|
|
606
|
+
|
|
607
|
+
// src/AppsInTossModule/native-modules/permissions/createPermissionFunction.ts
|
|
608
|
+
function createPermissionFunction({
|
|
609
|
+
handler,
|
|
610
|
+
permission,
|
|
611
|
+
error
|
|
612
|
+
}) {
|
|
613
|
+
const permissionFunction = async (...args) => {
|
|
614
|
+
const permissionStatus = await requestPermission(permission);
|
|
615
|
+
if (permissionStatus === "denied") {
|
|
616
|
+
throw new error();
|
|
617
|
+
}
|
|
618
|
+
return handler(...args);
|
|
619
|
+
};
|
|
620
|
+
permissionFunction.getPermission = () => getPermission(permission);
|
|
621
|
+
permissionFunction.openPermissionDialog = () => openPermissionDialog(permission);
|
|
622
|
+
return permissionFunction;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
// src/AppsInTossModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts
|
|
619
626
|
var DEFAULT_MAX_COUNT = 10;
|
|
620
627
|
var DEFAULT_MAX_WIDTH = 1024;
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
}
|
|
628
|
+
var fetchAlbumPhotos = createPermissionFunction({
|
|
629
|
+
handler: async (options) => {
|
|
630
|
+
return AppsInTossModule.fetchAlbumPhotos({
|
|
631
|
+
...options,
|
|
632
|
+
maxCount: options?.maxCount ?? DEFAULT_MAX_COUNT,
|
|
633
|
+
maxWidth: options?.maxWidth ?? DEFAULT_MAX_WIDTH
|
|
634
|
+
});
|
|
635
|
+
},
|
|
636
|
+
permission: {
|
|
637
|
+
name: "photos",
|
|
638
|
+
access: "read"
|
|
639
|
+
},
|
|
640
|
+
error: import_types2.FetchAlbumPhotosPermissionError
|
|
641
|
+
});
|
|
633
642
|
|
|
634
|
-
// src/AppsInTossModule/native-modules/fetchContacts.ts
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
643
|
+
// src/AppsInTossModule/native-modules/permissions/fetchContacts/fetchContacts.ts
|
|
644
|
+
var import_types3 = require("@apps-in-toss/types");
|
|
645
|
+
var fetchContacts = createPermissionFunction({
|
|
646
|
+
handler: async (options) => {
|
|
647
|
+
const contacts = await AppsInTossModule.fetchContacts(options);
|
|
648
|
+
return {
|
|
649
|
+
result: contacts.result,
|
|
650
|
+
nextOffset: contacts.nextOffset ?? null,
|
|
651
|
+
done: contacts.done
|
|
652
|
+
};
|
|
653
|
+
},
|
|
654
|
+
permission: {
|
|
655
|
+
name: "contacts",
|
|
656
|
+
access: "read"
|
|
657
|
+
},
|
|
658
|
+
error: import_types3.FetchContactsPermissionError
|
|
659
|
+
});
|
|
647
660
|
|
|
648
|
-
// src/AppsInTossModule/native-modules/getClipboardText.ts
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
|
|
661
|
+
// src/AppsInTossModule/native-modules/permissions/getClipboardText/getClipboardText.ts
|
|
662
|
+
var import_types4 = require("@apps-in-toss/types");
|
|
663
|
+
var getClipboardText = createPermissionFunction({
|
|
664
|
+
handler: () => {
|
|
665
|
+
return AppsInTossModule.getClipboardText({});
|
|
666
|
+
},
|
|
667
|
+
permission: {
|
|
668
|
+
name: "clipboard",
|
|
669
|
+
access: "read"
|
|
670
|
+
},
|
|
671
|
+
error: import_types4.GetClipboardTextPermissionError
|
|
672
|
+
});
|
|
656
673
|
|
|
657
|
-
// src/AppsInTossModule/native-modules/getCurrentLocation.ts
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
674
|
+
// src/AppsInTossModule/native-modules/permissions/getCurrentLocation/getCurrentLocation.ts
|
|
675
|
+
var import_types5 = require("@apps-in-toss/types");
|
|
676
|
+
var getCurrentLocation = createPermissionFunction({
|
|
677
|
+
handler: async (options) => {
|
|
678
|
+
return AppsInTossModule.getCurrentLocation(options);
|
|
679
|
+
},
|
|
680
|
+
permission: {
|
|
681
|
+
name: "geolocation",
|
|
682
|
+
access: "access"
|
|
683
|
+
},
|
|
684
|
+
error: import_types5.GetCurrentLocationPermissionError
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
// src/AppsInTossModule/native-modules/permissions/setClipboardText/setClipboardText.ts
|
|
688
|
+
var import_types6 = require("@apps-in-toss/types");
|
|
689
|
+
var setClipboardText = createPermissionFunction({
|
|
690
|
+
handler: (text) => {
|
|
691
|
+
return AppsInTossModule.setClipboardText({ text });
|
|
692
|
+
},
|
|
693
|
+
permission: {
|
|
694
|
+
name: "clipboard",
|
|
695
|
+
access: "write"
|
|
696
|
+
},
|
|
697
|
+
error: import_types6.SetClipboardTextPermissionError
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
// src/AppsInTossModule/native-modules/permissions/openCamera/openCamera.ts
|
|
701
|
+
var import_types7 = require("@apps-in-toss/types");
|
|
702
|
+
var openCamera = createPermissionFunction({
|
|
703
|
+
handler: (options) => {
|
|
704
|
+
return AppsInTossModule.openCamera({
|
|
705
|
+
base64: false,
|
|
706
|
+
maxWidth: 1024,
|
|
707
|
+
...options
|
|
708
|
+
});
|
|
709
|
+
},
|
|
710
|
+
permission: {
|
|
711
|
+
name: "camera",
|
|
712
|
+
access: "access"
|
|
713
|
+
},
|
|
714
|
+
error: import_types7.OpenCameraPermissionError
|
|
715
|
+
});
|
|
666
716
|
|
|
667
717
|
// src/AppsInTossModule/native-modules/getDeviceId.ts
|
|
668
718
|
function getDeviceId() {
|
|
@@ -709,16 +759,6 @@ var IAP = {
|
|
|
709
759
|
getProductItemList
|
|
710
760
|
};
|
|
711
761
|
|
|
712
|
-
// src/AppsInTossModule/native-modules/openCamera.ts
|
|
713
|
-
async function openCamera(options) {
|
|
714
|
-
const permissionStatus = await requestPermission({ name: "camera", access: "access" });
|
|
715
|
-
if (permissionStatus === "denied") {
|
|
716
|
-
throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
717
|
-
}
|
|
718
|
-
const photo = await AppsInTossModule.openCamera({ base64: false, maxWidth: 1024, ...options });
|
|
719
|
-
return photo;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
762
|
// src/AppsInTossModule/native-modules/saveBase64Data.ts
|
|
723
763
|
async function saveBase64Data(params) {
|
|
724
764
|
const isSupported = isMinVersionSupported({
|
|
@@ -732,15 +772,6 @@ async function saveBase64Data(params) {
|
|
|
732
772
|
await AppsInTossModule.saveBase64Data(params);
|
|
733
773
|
}
|
|
734
774
|
|
|
735
|
-
// src/AppsInTossModule/native-modules/setClipboardText.ts
|
|
736
|
-
async function setClipboardText(text) {
|
|
737
|
-
const permissionStatus = await requestPermission({ name: "clipboard", access: "write" });
|
|
738
|
-
if (permissionStatus === "denied") {
|
|
739
|
-
throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
740
|
-
}
|
|
741
|
-
return AppsInTossModule.setClipboardText({ text });
|
|
742
|
-
}
|
|
743
|
-
|
|
744
775
|
// src/AppsInTossModule/native-modules/setDeviceOrientation.ts
|
|
745
776
|
async function setDeviceOrientation(options) {
|
|
746
777
|
const isSupported = isMinVersionSupported({
|
|
@@ -777,7 +808,7 @@ var Storage = {
|
|
|
777
808
|
};
|
|
778
809
|
|
|
779
810
|
// src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts
|
|
780
|
-
var
|
|
811
|
+
var import_react_native11 = require("@granite-js/react-native");
|
|
781
812
|
|
|
782
813
|
// src/AppsInTossModule/constants.ts
|
|
783
814
|
var GAME_CENTER_MIN_VERSION = {
|
|
@@ -797,7 +828,7 @@ async function openGameCenterLeaderboard() {
|
|
|
797
828
|
const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
|
|
798
829
|
url.searchParams.set("appName", appName);
|
|
799
830
|
url.searchParams.set("referrer", `appsintoss.${appName}`);
|
|
800
|
-
return (0,
|
|
831
|
+
return (0, import_react_native11.openURL)(url.toString());
|
|
801
832
|
}
|
|
802
833
|
|
|
803
834
|
// src/AppsInTossModule/native-modules/getGameCenterGameProfile.ts
|
|
@@ -818,6 +849,29 @@ async function submitGameCenterLeaderBoardScore(params) {
|
|
|
818
849
|
return AppsInTossModule.submitGameCenterLeaderBoardScore(params);
|
|
819
850
|
}
|
|
820
851
|
|
|
852
|
+
// src/AppsInTossModule/native-event-emitter/contactsViral.ts
|
|
853
|
+
function contactsViral(params) {
|
|
854
|
+
const isSupported = isMinVersionSupported({
|
|
855
|
+
android: "5.223.0",
|
|
856
|
+
ios: "5.223.0"
|
|
857
|
+
});
|
|
858
|
+
if (!isSupported) {
|
|
859
|
+
return () => {
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
const { onEvent, onError, options } = params;
|
|
863
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("contactsViral", options, {
|
|
864
|
+
onRewardFromContactsViral: (result) => {
|
|
865
|
+
onEvent({ type: "sendViral", data: result });
|
|
866
|
+
},
|
|
867
|
+
onSuccess: (result) => {
|
|
868
|
+
onEvent({ type: "close", data: result });
|
|
869
|
+
},
|
|
870
|
+
onError
|
|
871
|
+
});
|
|
872
|
+
return unregisterCallbacks;
|
|
873
|
+
}
|
|
874
|
+
|
|
821
875
|
// src/AppsInTossModule/native-modules/index.ts
|
|
822
876
|
var TossPay = {
|
|
823
877
|
checkoutPayment
|
|
@@ -831,9 +885,24 @@ var GoogleAdMob = {
|
|
|
831
885
|
showAppsInTossAdMob
|
|
832
886
|
};
|
|
833
887
|
|
|
888
|
+
// src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts
|
|
889
|
+
function startUpdateLocation(eventParams) {
|
|
890
|
+
return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
|
|
891
|
+
}
|
|
892
|
+
startUpdateLocation.openPermissionDialog = getCurrentLocation.openPermissionDialog;
|
|
893
|
+
startUpdateLocation.getPermission = getCurrentLocation.getPermission;
|
|
894
|
+
|
|
895
|
+
// src/AppsInTossModule/native-event-emitter/StartUpdateLocationPermissionError.ts
|
|
896
|
+
var import_types8 = require("@apps-in-toss/types");
|
|
897
|
+
|
|
898
|
+
// src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
899
|
+
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
900
|
+
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
901
|
+
}
|
|
902
|
+
|
|
834
903
|
// src/BedrockModule/native-modules/natives/BedrockModule.ts
|
|
835
|
-
var
|
|
836
|
-
var BedrockModule =
|
|
904
|
+
var import_react_native12 = require("react-native");
|
|
905
|
+
var BedrockModule = import_react_native12.NativeModules.BedrockModule;
|
|
837
906
|
|
|
838
907
|
// src/BedrockModule/native-modules/natives/closeView.ts
|
|
839
908
|
async function closeView() {
|
|
@@ -841,10 +910,10 @@ async function closeView() {
|
|
|
841
910
|
}
|
|
842
911
|
|
|
843
912
|
// src/BedrockModule/native-modules/natives/getLocale.ts
|
|
844
|
-
var
|
|
913
|
+
var import_react_native13 = require("react-native");
|
|
845
914
|
function getLocale() {
|
|
846
915
|
const locale = BedrockModule?.DeviceInfo?.locale ?? "ko-KR";
|
|
847
|
-
if (
|
|
916
|
+
if (import_react_native13.Platform.OS === "android") {
|
|
848
917
|
return replaceUnderbarToHypen(locale);
|
|
849
918
|
}
|
|
850
919
|
return locale;
|
|
@@ -892,35 +961,24 @@ async function setIosSwipeGestureEnabled(options) {
|
|
|
892
961
|
}
|
|
893
962
|
|
|
894
963
|
// src/BedrockModule/native-modules/natives/openURL.ts
|
|
895
|
-
var
|
|
964
|
+
var import_react_native14 = require("react-native");
|
|
896
965
|
function openURL2(url) {
|
|
897
|
-
return
|
|
966
|
+
return import_react_native14.Linking.openURL(url);
|
|
898
967
|
}
|
|
899
968
|
|
|
900
969
|
// src/BedrockModule/native-modules/natives/getPlatformOS.ts
|
|
901
|
-
var
|
|
970
|
+
var import_react_native15 = require("react-native");
|
|
902
971
|
function getPlatformOS() {
|
|
903
|
-
return
|
|
972
|
+
return import_react_native15.Platform.OS;
|
|
904
973
|
}
|
|
905
974
|
|
|
906
975
|
// src/BedrockModule/native-modules/core/BedrockCoreModule.ts
|
|
907
|
-
var
|
|
908
|
-
var BedrockCoreModule =
|
|
909
|
-
|
|
910
|
-
// src/types.ts
|
|
911
|
-
var Accuracy = /* @__PURE__ */ ((Accuracy2) => {
|
|
912
|
-
Accuracy2[Accuracy2["Lowest"] = 1] = "Lowest";
|
|
913
|
-
Accuracy2[Accuracy2["Low"] = 2] = "Low";
|
|
914
|
-
Accuracy2[Accuracy2["Balanced"] = 3] = "Balanced";
|
|
915
|
-
Accuracy2[Accuracy2["High"] = 4] = "High";
|
|
916
|
-
Accuracy2[Accuracy2["Highest"] = 5] = "Highest";
|
|
917
|
-
Accuracy2[Accuracy2["BestForNavigation"] = 6] = "BestForNavigation";
|
|
918
|
-
return Accuracy2;
|
|
919
|
-
})(Accuracy || {});
|
|
976
|
+
var import_react_native16 = require("react-native");
|
|
977
|
+
var BedrockCoreModule = import_react_native16.NativeModules.BedrockCoreModule;
|
|
920
978
|
|
|
921
979
|
// src/AppsInTossModule/native-modules/tossCore.ts
|
|
922
|
-
var
|
|
923
|
-
var TossCoreModule =
|
|
980
|
+
var import_react_native17 = require("react-native");
|
|
981
|
+
var TossCoreModule = import_react_native17.NativeModules.TossCoreModule;
|
|
924
982
|
function tossCoreEventLog(params) {
|
|
925
983
|
const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
|
|
926
984
|
const isSandbox = getOperationalEnvironment() === "sandbox";
|
|
@@ -942,7 +1000,6 @@ var INTERNAL__module = {
|
|
|
942
1000
|
};
|
|
943
1001
|
// Annotate the CommonJS export names for ESM import in node:
|
|
944
1002
|
0 && (module.exports = {
|
|
945
|
-
Accuracy,
|
|
946
1003
|
AppsInTossModule,
|
|
947
1004
|
BedrockCoreModule,
|
|
948
1005
|
BedrockModule,
|
|
@@ -951,6 +1008,7 @@ var INTERNAL__module = {
|
|
|
951
1008
|
INTERNAL__AppsInTossModule,
|
|
952
1009
|
INTERNAL__appBridgeHandler,
|
|
953
1010
|
INTERNAL__module,
|
|
1011
|
+
StartUpdateLocationPermissionError,
|
|
954
1012
|
Storage,
|
|
955
1013
|
TossPay,
|
|
956
1014
|
appLogin,
|