@apps-in-toss/native-modules 1.5.1 → 1.5.3
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 +3 -3
- package/dist/index.cjs +59 -46
- package/dist/index.d.cts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.js +35 -22
- package/package.json +3 -3
- package/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts +0 -2
- package/src/AppsInTossModule/native-modules/AppsInTossModule.ts +1 -1
- package/src/AppsInTossModule/native-modules/appsInTossSignTossCert.ts +16 -4
- package/src/AppsInTossModule/native-modules/eventLog.ts +2 -2
- package/src/AppsInTossModule/native-modules/getTossShareLink.ts +38 -12
- package/src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts +0 -10
package/dist/bridges-meta.json
CHANGED
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"identifier": "eventLog",
|
|
76
|
-
"dts": "export type Primitive = string | number | boolean | null | undefined | symbol;\nexport interface EventLogParams {\n\tlog_name: string;\n\tlog_type: \"debug\" | \"info\" | \"warn\" | \"error\" | \"screen\" | \"impression\" | \"click\";\n\tparams: Record<string, Primitive>;\n}\n/**\n * @category 로깅\n * @kind function\n * @name eventLog\n * @description\n * 이벤트 로그를 기록하는 함수예요.\n *\n * 이 함수는 앱 내에서 발생하는 다양한 이벤트를 로깅하는 데 사용돼요. 디버깅, 정보 제공, 경고, 오류 등 다양한 유형의 로그를 기록할 수 있어요. 샌드박스 환경에서는 콘솔에 로그가 출력되고, 실제 환경에서는 로그 시스템에 기록돼요.\n *\n * @param {Object} params 로그 기록에 필요한 매개변수 객체예요.\n * @param {string} params.log_name 로그의 이름이에요.\n * @param {'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.\n * @param {Record<string, Primitive>} params.params 로그에 포함할 추가 매개변수 객체예요.\n *\n * @returns {Promise<void>} 로그 기록이 완료되면 해결되는 Promise예요.\n *\n * @example\n * ### 이벤트 로그 기록하기\n *\n * ```tsx\n * import { eventLog } from '@apps-in-toss/framework';\n *\n * function logUserAction() {\n * eventLog({\n * log_name: 'user_action',\n * log_type: 'info',\n * params: {\n * action: 'button_click',\n * screen: 'main',\n * userId: 12345\n * }\n * });\n * }\n * ```\n */\nexport declare function eventLog(params: EventLogParams): Promise<void>;\n\nexport {};\n"
|
|
76
|
+
"dts": "export type Primitive = string | number | boolean | null | undefined | symbol;\nexport interface EventLogParams {\n\tlog_name: string;\n\tlog_type: \"debug\" | \"info\" | \"warn\" | \"error\" | \"event\" | \"screen\" | \"impression\" | \"click\";\n\tparams: Record<string, Primitive>;\n}\n/**\n * @category 로깅\n * @kind function\n * @name eventLog\n * @description\n * 이벤트 로그를 기록하는 함수예요.\n *\n * 이 함수는 앱 내에서 발생하는 다양한 이벤트를 로깅하는 데 사용돼요. 디버깅, 정보 제공, 경고, 오류 등 다양한 유형의 로그를 기록할 수 있어요. 샌드박스 환경에서는 콘솔에 로그가 출력되고, 실제 환경에서는 로그 시스템에 기록돼요.\n *\n * @param {Object} params 로그 기록에 필요한 매개변수 객체예요.\n * @param {string} params.log_name 로그의 이름이에요.\n * @param {'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.\n * @param {Record<string, Primitive>} params.params 로그에 포함할 추가 매개변수 객체예요.\n *\n * @returns {Promise<void>} 로그 기록이 완료되면 해결되는 Promise예요.\n *\n * @example\n * ### 이벤트 로그 기록하기\n *\n * ```tsx\n * import { eventLog } from '@apps-in-toss/framework';\n *\n * function logUserAction() {\n * eventLog({\n * log_name: 'user_action',\n * log_type: 'info',\n * params: {\n * action: 'button_click',\n * screen: 'main',\n * userId: 12345\n * }\n * });\n * }\n * ```\n */\nexport declare function eventLog(params: EventLogParams): Promise<void>;\n\nexport {};\n"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"identifier": "getTossShareLink",
|
|
80
|
-
"dts": "/**\n * @public\n * @category 공유\n * @kind function\n * @name getTossShareLink\n * @description\n *
|
|
80
|
+
"dts": "/**\n * @public\n * @category 공유\n * @kind function\n * @name getTossShareLink\n * @description\n * 사용자가 지정한 경로를 토스 앱에서 열 수 있는 공유 링크를 생성해요.\n *\n * 생성된 링크를 다른 사람과 공유하면:\n * - 토스 앱이 설치되어 있으면: 토스 앱이 실행되면서 지정한 경로로 이동해요.\n * - 토스 앱이 없으면: iOS는 앱스토어로, Android는 플레이스토어로 이동해요.\n *\n * @param path - 딥링크 경로예요. `intoss://`로 시작하는 문자열이어야 해요. (예: `intoss://my-app`, `intoss://my-app/detail?id=123`)\n * @param ogImageUrl - (선택) 공유 시 표시될 커스텀 OG 이미지 URL이에요. 최소 버전: Android 5.240.0, iOS 5.239.0\n * @returns {Promise<string>} 생성된 토스 공유 링크\n *\n * @example\n * ```tsx\n * import { share } from '@granite-js/react-native';\n * import { getTossShareLink } from '@apps-in-toss/framework';\n *\n * // 기본 사용법\n * const tossLink = await getTossShareLink('intoss://my-app');\n * await share({ message: tossLink });\n *\n * // 커스텀 OG 이미지와 함께 사용\n * const linkWithImage = await getTossShareLink(\n * 'intoss://my-app/event',\n * 'https://example.com/og-image.png'\n * );\n * await share({ message: linkWithImage });\n * ```\n */\nexport declare function getTossShareLink(path: string, ogImageUrl?: string): Promise<string>;\n\nexport {};\n"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
"identifier": "setDeviceOrientation",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
"identifier": "appsInTossSignTossCert",
|
|
96
|
-
"dts": "export interface AppsInTossSignTossCertParams {\n\ttxId: string;\n}\n/**\n * @public\n * @category 토스인증\n * @name appsInTossSignTossCert\n * @description 토스 인증서를 사용해 서명하는 기능을 제공해요. 이 함수를 사용하면 앱인토스에서 제공하는 인증서를 활용해 서명을 할 수 있어요.\n *\n * @param {AppsInTossSignTossCertParams} params - 서명에 필요한 파라미터를 포함하는 객체예요.\n * @param {string} params.txId - 토스인증서를 사용한 본인확인이나 간편인증, 전자서명에서 사용하는 Transaction Id예요.\n *\n * @example\n * ```tsx\n * import { appsInTossSignTossCert } from '@apps-in-toss/framework';\n *\n * // 서명에 필요한 파라미터를 정의해요.\n * const params = {\n * txId: \"f2e1a6df...\"\n * };\n *\n * appsInTossSignTossCert(params)\n * .then(() => {\n * console.log('서명 작업이 성공적으로 완료되었어요.');\n * })\n * .catch((error) => {\n * console.error('서명 작업 중 에러가 발생했어요:', error);\n * });\n * ```\n */\nexport declare function appsInTossSignTossCert(params: AppsInTossSignTossCertParams): Promise<void>;\n\nexport {};\n"
|
|
96
|
+
"dts": "export interface AppsInTossSignTossCertParams {\n\ttxId: string;\n\tskipConfirmDoc?: boolean;\n}\n/**\n * @public\n * @category 토스인증\n * @name appsInTossSignTossCert\n * @description 토스 인증서를 사용해 서명하는 기능을 제공해요. 이 함수를 사용하면 앱인토스에서 제공하는 인증서를 활용해 서명을 할 수 있어요.\n *\n * @param {AppsInTossSignTossCertParams} params - 서명에 필요한 파라미터를 포함하는 객체예요.\n * @param {string} params.txId - 토스인증서를 사용한 본인확인이나 간편인증, 전자서명에서 사용하는 Transaction Id예요.\n * @param {boolean} params.skipConfirmDoc - (선택) 토스 원터치 인증방식을 사용하기 위한 옵션이예요. true 설정 시 최소 버전: Android 5.236.0, iOS 5.236.0 (default: false)\n *\n * @example\n * ```tsx\n * import { appsInTossSignTossCert } from '@apps-in-toss/framework';\n *\n * // 서명에 필요한 파라미터를 정의해요.\n * const params = {\n * txId: \"f2e1a6df...\"\n * };\n *\n * appsInTossSignTossCert(params)\n * .then(() => {\n * console.log('서명 작업이 성공적으로 완료되었어요.');\n * })\n * .catch((error) => {\n * console.error('서명 작업 중 에러가 발생했어요:', error);\n * });\n * ```\n */\nexport declare function appsInTossSignTossCert(params: AppsInTossSignTossCertParams): Promise<void>;\n\nexport {};\n"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"identifier": "getGameCenterGameProfile",
|
package/dist/index.cjs
CHANGED
|
@@ -75,26 +75,15 @@ __export(index_exports, {
|
|
|
75
75
|
module.exports = __toCommonJS(index_exports);
|
|
76
76
|
|
|
77
77
|
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
|
|
81
|
-
var import_react_native = require("@granite-js/react-native");
|
|
82
|
-
var EntryMessageExitedEvent = class extends import_react_native.GraniteEventDefinition {
|
|
83
|
-
name = "entryMessageExited";
|
|
84
|
-
remove() {
|
|
85
|
-
}
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
87
|
-
listener(_) {
|
|
88
|
-
}
|
|
89
|
-
};
|
|
78
|
+
var import_react_native6 = require("@granite-js/react-native");
|
|
90
79
|
|
|
91
80
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
92
81
|
var import_types = require("@apps-in-toss/types");
|
|
93
|
-
var
|
|
82
|
+
var import_react_native3 = require("@granite-js/react-native");
|
|
94
83
|
|
|
95
84
|
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
96
|
-
var
|
|
97
|
-
var Module =
|
|
85
|
+
var import_react_native = require("react-native");
|
|
86
|
+
var Module = import_react_native.TurboModuleRegistry.getEnforcing("AppsInTossModule");
|
|
98
87
|
var AppsInTossModuleInstance = Module;
|
|
99
88
|
var AppsInTossModule = Module;
|
|
100
89
|
|
|
@@ -121,11 +110,11 @@ async function requestPermission(permission) {
|
|
|
121
110
|
}
|
|
122
111
|
|
|
123
112
|
// src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
|
|
124
|
-
var
|
|
125
|
-
var nativeEventEmitter = new
|
|
113
|
+
var import_react_native2 = require("react-native");
|
|
114
|
+
var nativeEventEmitter = new import_react_native2.NativeEventEmitter(AppsInTossModuleInstance);
|
|
126
115
|
|
|
127
116
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
128
|
-
var UpdateLocationEvent = class extends
|
|
117
|
+
var UpdateLocationEvent = class extends import_react_native3.GraniteEventDefinition {
|
|
129
118
|
name = "updateLocationEvent";
|
|
130
119
|
subscriptionCount = 0;
|
|
131
120
|
ref = {
|
|
@@ -155,7 +144,7 @@ var UpdateLocationEvent = class extends import_react_native4.GraniteEventDefinit
|
|
|
155
144
|
};
|
|
156
145
|
|
|
157
146
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
158
|
-
var
|
|
147
|
+
var import_react_native4 = require("@granite-js/react-native");
|
|
159
148
|
|
|
160
149
|
// src/utils/generateUUID.ts
|
|
161
150
|
function generateUUID(placeholder) {
|
|
@@ -217,7 +206,7 @@ var INTERNAL__appBridgeHandler = {
|
|
|
217
206
|
|
|
218
207
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
219
208
|
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
220
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends
|
|
209
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native4.GraniteEventDefinition {
|
|
221
210
|
static INTERNAL__appBridgeSubscription;
|
|
222
211
|
name = "appBridgeCallbackEvent";
|
|
223
212
|
constructor() {
|
|
@@ -247,8 +236,8 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_
|
|
|
247
236
|
};
|
|
248
237
|
|
|
249
238
|
// src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
250
|
-
var
|
|
251
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends
|
|
239
|
+
var import_react_native5 = require("@granite-js/react-native");
|
|
240
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native5.GraniteEventDefinition {
|
|
252
241
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
253
242
|
subscription = null;
|
|
254
243
|
remove() {
|
|
@@ -273,9 +262,8 @@ var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_n
|
|
|
273
262
|
};
|
|
274
263
|
|
|
275
264
|
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
276
|
-
var appsInTossEvent = new
|
|
265
|
+
var appsInTossEvent = new import_react_native6.GraniteEvent([
|
|
277
266
|
new UpdateLocationEvent(),
|
|
278
|
-
new EntryMessageExitedEvent(),
|
|
279
267
|
// Internal events
|
|
280
268
|
new AppBridgeCallbackEvent(),
|
|
281
269
|
new VisibilityChangedByTransparentServiceWebEvent()
|
|
@@ -290,7 +278,7 @@ function getOperationalEnvironment() {
|
|
|
290
278
|
}
|
|
291
279
|
|
|
292
280
|
// src/AppsInTossModule/native-modules/isMinVersionSupported.ts
|
|
293
|
-
var
|
|
281
|
+
var import_react_native7 = require("react-native");
|
|
294
282
|
|
|
295
283
|
// src/utils/compareVersion.ts
|
|
296
284
|
var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
|
|
@@ -366,7 +354,7 @@ function isMinVersionSupported(minVersions) {
|
|
|
366
354
|
return true;
|
|
367
355
|
}
|
|
368
356
|
const currentVersion = AppsInTossModule.tossAppVersion;
|
|
369
|
-
const isIOS =
|
|
357
|
+
const isIOS = import_react_native7.Platform.OS === "ios";
|
|
370
358
|
const minVersion = isIOS ? minVersions.ios : minVersions.android;
|
|
371
359
|
if (minVersion === void 0) {
|
|
372
360
|
return false;
|
|
@@ -486,10 +474,10 @@ showAdMobRewardedAd.isSupported = createIsSupported();
|
|
|
486
474
|
var import_es_toolkit2 = require("es-toolkit");
|
|
487
475
|
|
|
488
476
|
// src/utils/getReferrer.ts
|
|
489
|
-
var
|
|
477
|
+
var import_react_native8 = require("@granite-js/react-native");
|
|
490
478
|
function getReferrer() {
|
|
491
479
|
try {
|
|
492
|
-
return new URL((0,
|
|
480
|
+
return new URL((0, import_react_native8.getSchemeUri)()).searchParams.get("referrer");
|
|
493
481
|
} catch {
|
|
494
482
|
return null;
|
|
495
483
|
}
|
|
@@ -729,7 +717,24 @@ function getTossAppVersion() {
|
|
|
729
717
|
}
|
|
730
718
|
|
|
731
719
|
// src/AppsInTossModule/native-modules/getTossShareLink.ts
|
|
732
|
-
|
|
720
|
+
var V2_MIN_VERSION = {
|
|
721
|
+
android: "5.240.0",
|
|
722
|
+
ios: "5.239.0"
|
|
723
|
+
};
|
|
724
|
+
async function getTossShareLink(path, ogImageUrl) {
|
|
725
|
+
if (!isMinVersionSupported(V2_MIN_VERSION)) {
|
|
726
|
+
return await getTossShareLinkV1(path);
|
|
727
|
+
}
|
|
728
|
+
const params = {
|
|
729
|
+
params: {
|
|
730
|
+
url: path,
|
|
731
|
+
ogImageUrl
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
const { shareLink } = await AppsInTossModule.getTossShareLink(params);
|
|
735
|
+
return shareLink;
|
|
736
|
+
}
|
|
737
|
+
async function getTossShareLinkV1(path) {
|
|
733
738
|
const { shareLink } = await AppsInTossModule.getTossShareLink({});
|
|
734
739
|
const shareUrl = new URL(shareLink);
|
|
735
740
|
shareUrl.searchParams.set("deep_link_value", path);
|
|
@@ -910,7 +915,7 @@ var Storage = {
|
|
|
910
915
|
};
|
|
911
916
|
|
|
912
917
|
// src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts
|
|
913
|
-
var
|
|
918
|
+
var import_react_native9 = require("@granite-js/react-native");
|
|
914
919
|
|
|
915
920
|
// src/AppsInTossModule/constants.ts
|
|
916
921
|
var GAME_CENTER_MIN_VERSION = {
|
|
@@ -942,7 +947,7 @@ async function openGameCenterLeaderboard() {
|
|
|
942
947
|
const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
|
|
943
948
|
url.searchParams.set("appName", appName);
|
|
944
949
|
url.searchParams.set("referrer", `appsintoss.${appName}`);
|
|
945
|
-
return (0,
|
|
950
|
+
return (0, import_react_native9.openURL)(url.toString());
|
|
946
951
|
}
|
|
947
952
|
|
|
948
953
|
// src/AppsInTossModule/native-modules/getGameCenterGameProfile.ts
|
|
@@ -1045,11 +1050,19 @@ function contactsViral(params) {
|
|
|
1045
1050
|
}
|
|
1046
1051
|
|
|
1047
1052
|
// src/AppsInTossModule/native-modules/appsInTossSignTossCert.ts
|
|
1048
|
-
|
|
1049
|
-
|
|
1053
|
+
var MIN_VERSION_BY_USER_TYPE = {
|
|
1054
|
+
USER_PERSONAL: {
|
|
1050
1055
|
android: "5.233.0",
|
|
1051
1056
|
ios: "5.233.0"
|
|
1052
|
-
}
|
|
1057
|
+
},
|
|
1058
|
+
USER_NONE: {
|
|
1059
|
+
android: "5.236.0",
|
|
1060
|
+
ios: "5.236.0"
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
async function appsInTossSignTossCert(params) {
|
|
1064
|
+
const minVersion = params.skipConfirmDoc === true ? MIN_VERSION_BY_USER_TYPE.USER_NONE : MIN_VERSION_BY_USER_TYPE.USER_PERSONAL;
|
|
1065
|
+
const isSupported = isMinVersionSupported(minVersion);
|
|
1053
1066
|
if (!isSupported) {
|
|
1054
1067
|
console.warn("appsInTossSignTossCert is not supported in this app version");
|
|
1055
1068
|
return;
|
|
@@ -1086,8 +1099,8 @@ function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
|
1086
1099
|
}
|
|
1087
1100
|
|
|
1088
1101
|
// src/BedrockModule/native-modules/natives/BedrockModule.ts
|
|
1089
|
-
var
|
|
1090
|
-
var BedrockModule =
|
|
1102
|
+
var import_react_native10 = require("react-native");
|
|
1103
|
+
var BedrockModule = import_react_native10.NativeModules.BedrockModule;
|
|
1091
1104
|
|
|
1092
1105
|
// src/BedrockModule/native-modules/natives/closeView.ts
|
|
1093
1106
|
async function closeView() {
|
|
@@ -1095,10 +1108,10 @@ async function closeView() {
|
|
|
1095
1108
|
}
|
|
1096
1109
|
|
|
1097
1110
|
// src/BedrockModule/native-modules/natives/getLocale.ts
|
|
1098
|
-
var
|
|
1111
|
+
var import_react_native11 = require("react-native");
|
|
1099
1112
|
function getLocale() {
|
|
1100
1113
|
const locale = BedrockModule?.DeviceInfo?.locale ?? "ko-KR";
|
|
1101
|
-
if (
|
|
1114
|
+
if (import_react_native11.Platform.OS === "android") {
|
|
1102
1115
|
return replaceUnderbarToHypen(locale);
|
|
1103
1116
|
}
|
|
1104
1117
|
return locale;
|
|
@@ -1146,24 +1159,24 @@ async function setIosSwipeGestureEnabled(options) {
|
|
|
1146
1159
|
}
|
|
1147
1160
|
|
|
1148
1161
|
// src/BedrockModule/native-modules/natives/openURL.ts
|
|
1149
|
-
var
|
|
1162
|
+
var import_react_native12 = require("react-native");
|
|
1150
1163
|
function openURL2(url) {
|
|
1151
|
-
return
|
|
1164
|
+
return import_react_native12.Linking.openURL(url);
|
|
1152
1165
|
}
|
|
1153
1166
|
|
|
1154
1167
|
// src/BedrockModule/native-modules/natives/getPlatformOS.ts
|
|
1155
|
-
var
|
|
1168
|
+
var import_react_native13 = require("react-native");
|
|
1156
1169
|
function getPlatformOS() {
|
|
1157
|
-
return
|
|
1170
|
+
return import_react_native13.Platform.OS;
|
|
1158
1171
|
}
|
|
1159
1172
|
|
|
1160
1173
|
// src/BedrockModule/native-modules/core/BedrockCoreModule.ts
|
|
1161
|
-
var
|
|
1162
|
-
var BedrockCoreModule =
|
|
1174
|
+
var import_react_native14 = require("react-native");
|
|
1175
|
+
var BedrockCoreModule = import_react_native14.NativeModules.BedrockCoreModule;
|
|
1163
1176
|
|
|
1164
1177
|
// src/AppsInTossModule/native-modules/tossCore.ts
|
|
1165
|
-
var
|
|
1166
|
-
var TossCoreModule =
|
|
1178
|
+
var import_react_native15 = require("react-native");
|
|
1179
|
+
var TossCoreModule = import_react_native15.NativeModules.TossCoreModule;
|
|
1167
1180
|
function tossCoreEventLog(params) {
|
|
1168
1181
|
const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
|
|
1169
1182
|
const isSandbox = getOperationalEnvironment() === "sandbox";
|
package/dist/index.d.cts
CHANGED
|
@@ -231,12 +231,6 @@ interface ContactsViralParams {
|
|
|
231
231
|
*/
|
|
232
232
|
declare function contactsViral(params: ContactsViralParams): () => void;
|
|
233
233
|
|
|
234
|
-
declare class EntryMessageExitedEvent extends GraniteEventDefinition<undefined, undefined> {
|
|
235
|
-
name: "entryMessageExited";
|
|
236
|
-
remove(): void;
|
|
237
|
-
listener(_: undefined): void;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
234
|
interface StartUpdateLocationOptions {
|
|
241
235
|
/**
|
|
242
236
|
* 위치 정확도를 설정해요.
|
|
@@ -286,7 +280,7 @@ declare class VisibilityChangedByTransparentServiceWebEvent extends GraniteEvent
|
|
|
286
280
|
private isVisibilityChangedByTransparentServiceWebResult;
|
|
287
281
|
}
|
|
288
282
|
|
|
289
|
-
declare const appsInTossEvent: GraniteEvent<
|
|
283
|
+
declare const appsInTossEvent: GraniteEvent<UpdateLocationEvent | AppBridgeCallbackEvent | VisibilityChangedByTransparentServiceWebEvent>;
|
|
290
284
|
|
|
291
285
|
declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
|
|
292
286
|
options: {
|
|
@@ -1357,6 +1351,7 @@ declare function checkoutPayment(options: CheckoutPaymentOptions): Promise<Check
|
|
|
1357
1351
|
|
|
1358
1352
|
interface AppsInTossSignTossCertParams {
|
|
1359
1353
|
txId: string;
|
|
1354
|
+
skipConfirmDoc?: boolean;
|
|
1360
1355
|
}
|
|
1361
1356
|
/**
|
|
1362
1357
|
* @public
|
|
@@ -1366,6 +1361,7 @@ interface AppsInTossSignTossCertParams {
|
|
|
1366
1361
|
*
|
|
1367
1362
|
* @param {AppsInTossSignTossCertParams} params - 서명에 필요한 파라미터를 포함하는 객체예요.
|
|
1368
1363
|
* @param {string} params.txId - 토스인증서를 사용한 본인확인이나 간편인증, 전자서명에서 사용하는 Transaction Id예요.
|
|
1364
|
+
* @param {boolean} params.skipConfirmDoc - (선택) 토스 원터치 인증방식을 사용하기 위한 옵션이예요. true 설정 시 최소 버전: Android 5.236.0, iOS 5.236.0 (default: false)
|
|
1369
1365
|
*
|
|
1370
1366
|
* @example
|
|
1371
1367
|
* ```tsx
|
|
@@ -2159,7 +2155,7 @@ interface Spec extends TurboModule {
|
|
|
2159
2155
|
clearStorage: (arg: CompatiblePlaceholderArgument) => Promise<void>;
|
|
2160
2156
|
eventLog: (params: {
|
|
2161
2157
|
log_name: string;
|
|
2162
|
-
log_type: 'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click';
|
|
2158
|
+
log_type: 'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click';
|
|
2163
2159
|
params: Record<string, string>;
|
|
2164
2160
|
}) => Promise<void>;
|
|
2165
2161
|
getTossShareLink: (params: object) => Promise<{
|
|
@@ -2257,7 +2253,7 @@ type Primitive = string | number | boolean | null | undefined | symbol;
|
|
|
2257
2253
|
|
|
2258
2254
|
interface EventLogParams {
|
|
2259
2255
|
log_name: string;
|
|
2260
|
-
log_type: 'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click';
|
|
2256
|
+
log_type: 'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click';
|
|
2261
2257
|
params: Record<string, Primitive>;
|
|
2262
2258
|
}
|
|
2263
2259
|
/**
|
|
@@ -2271,7 +2267,7 @@ interface EventLogParams {
|
|
|
2271
2267
|
*
|
|
2272
2268
|
* @param {Object} params 로그 기록에 필요한 매개변수 객체예요.
|
|
2273
2269
|
* @param {string} params.log_name 로그의 이름이에요.
|
|
2274
|
-
* @param {'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.
|
|
2270
|
+
* @param {'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.
|
|
2275
2271
|
* @param {Record<string, Primitive>} params.params 로그에 포함할 추가 매개변수 객체예요.
|
|
2276
2272
|
*
|
|
2277
2273
|
* @returns {Promise<void>} 로그 기록이 완료되면 해결되는 Promise예요.
|
|
@@ -2897,30 +2893,34 @@ declare function getTossAppVersion(): string;
|
|
|
2897
2893
|
* @kind function
|
|
2898
2894
|
* @name getTossShareLink
|
|
2899
2895
|
* @description
|
|
2900
|
-
*
|
|
2901
|
-
* 이 링크를 다른 사람과 공유하면 토스 앱이 실행되면서 지정한 경로로 진입해요. 토스앱이 없는 사람은 iOS 일 때는 앱스토어로 이동하고, Android 일 때는 플레이스토어로 이동해요.
|
|
2896
|
+
* 사용자가 지정한 경로를 토스 앱에서 열 수 있는 공유 링크를 생성해요.
|
|
2902
2897
|
*
|
|
2903
|
-
*
|
|
2904
|
-
*
|
|
2898
|
+
* 생성된 링크를 다른 사람과 공유하면:
|
|
2899
|
+
* - 토스 앱이 설치되어 있으면: 토스 앱이 실행되면서 지정한 경로로 이동해요.
|
|
2900
|
+
* - 토스 앱이 없으면: iOS는 앱스토어로, Android는 플레이스토어로 이동해요.
|
|
2905
2901
|
*
|
|
2906
|
-
*
|
|
2907
|
-
*
|
|
2908
|
-
* @
|
|
2909
|
-
* @returns {Promise<string>} `deep_link_value`가 포함된 토스 공유 링크를 반환해요.
|
|
2902
|
+
* @param path - 딥링크 경로예요. `intoss://`로 시작하는 문자열이어야 해요. (예: `intoss://my-app`, `intoss://my-app/detail?id=123`)
|
|
2903
|
+
* @param ogImageUrl - (선택) 공유 시 표시될 커스텀 OG 이미지 URL이에요. 최소 버전: Android 5.240.0, iOS 5.239.0
|
|
2904
|
+
* @returns {Promise<string>} 생성된 토스 공유 링크
|
|
2910
2905
|
*
|
|
2911
2906
|
* @example
|
|
2912
2907
|
* ```tsx
|
|
2913
2908
|
* import { share } from '@granite-js/react-native';
|
|
2914
2909
|
* import { getTossShareLink } from '@apps-in-toss/framework';
|
|
2915
2910
|
*
|
|
2916
|
-
* //
|
|
2911
|
+
* // 기본 사용법
|
|
2917
2912
|
* const tossLink = await getTossShareLink('intoss://my-app');
|
|
2918
|
-
*
|
|
2919
|
-
* // 생성한 링크를 메시지로 공유해요.
|
|
2920
2913
|
* await share({ message: tossLink });
|
|
2914
|
+
*
|
|
2915
|
+
* // 커스텀 OG 이미지와 함께 사용
|
|
2916
|
+
* const linkWithImage = await getTossShareLink(
|
|
2917
|
+
* 'intoss://my-app/event',
|
|
2918
|
+
* 'https://example.com/og-image.png'
|
|
2919
|
+
* );
|
|
2920
|
+
* await share({ message: linkWithImage });
|
|
2921
2921
|
* ```
|
|
2922
2922
|
*/
|
|
2923
|
-
declare function getTossShareLink(path: string): Promise<string>;
|
|
2923
|
+
declare function getTossShareLink(path: string, ogImageUrl?: string): Promise<string>;
|
|
2924
2924
|
|
|
2925
2925
|
/**
|
|
2926
2926
|
* @public
|
package/dist/index.d.ts
CHANGED
|
@@ -231,12 +231,6 @@ interface ContactsViralParams {
|
|
|
231
231
|
*/
|
|
232
232
|
declare function contactsViral(params: ContactsViralParams): () => void;
|
|
233
233
|
|
|
234
|
-
declare class EntryMessageExitedEvent extends GraniteEventDefinition<undefined, undefined> {
|
|
235
|
-
name: "entryMessageExited";
|
|
236
|
-
remove(): void;
|
|
237
|
-
listener(_: undefined): void;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
234
|
interface StartUpdateLocationOptions {
|
|
241
235
|
/**
|
|
242
236
|
* 위치 정확도를 설정해요.
|
|
@@ -286,7 +280,7 @@ declare class VisibilityChangedByTransparentServiceWebEvent extends GraniteEvent
|
|
|
286
280
|
private isVisibilityChangedByTransparentServiceWebResult;
|
|
287
281
|
}
|
|
288
282
|
|
|
289
|
-
declare const appsInTossEvent: GraniteEvent<
|
|
283
|
+
declare const appsInTossEvent: GraniteEvent<UpdateLocationEvent | AppBridgeCallbackEvent | VisibilityChangedByTransparentServiceWebEvent>;
|
|
290
284
|
|
|
291
285
|
declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
|
|
292
286
|
options: {
|
|
@@ -1357,6 +1351,7 @@ declare function checkoutPayment(options: CheckoutPaymentOptions): Promise<Check
|
|
|
1357
1351
|
|
|
1358
1352
|
interface AppsInTossSignTossCertParams {
|
|
1359
1353
|
txId: string;
|
|
1354
|
+
skipConfirmDoc?: boolean;
|
|
1360
1355
|
}
|
|
1361
1356
|
/**
|
|
1362
1357
|
* @public
|
|
@@ -1366,6 +1361,7 @@ interface AppsInTossSignTossCertParams {
|
|
|
1366
1361
|
*
|
|
1367
1362
|
* @param {AppsInTossSignTossCertParams} params - 서명에 필요한 파라미터를 포함하는 객체예요.
|
|
1368
1363
|
* @param {string} params.txId - 토스인증서를 사용한 본인확인이나 간편인증, 전자서명에서 사용하는 Transaction Id예요.
|
|
1364
|
+
* @param {boolean} params.skipConfirmDoc - (선택) 토스 원터치 인증방식을 사용하기 위한 옵션이예요. true 설정 시 최소 버전: Android 5.236.0, iOS 5.236.0 (default: false)
|
|
1369
1365
|
*
|
|
1370
1366
|
* @example
|
|
1371
1367
|
* ```tsx
|
|
@@ -2159,7 +2155,7 @@ interface Spec extends TurboModule {
|
|
|
2159
2155
|
clearStorage: (arg: CompatiblePlaceholderArgument) => Promise<void>;
|
|
2160
2156
|
eventLog: (params: {
|
|
2161
2157
|
log_name: string;
|
|
2162
|
-
log_type: 'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click';
|
|
2158
|
+
log_type: 'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click';
|
|
2163
2159
|
params: Record<string, string>;
|
|
2164
2160
|
}) => Promise<void>;
|
|
2165
2161
|
getTossShareLink: (params: object) => Promise<{
|
|
@@ -2257,7 +2253,7 @@ type Primitive = string | number | boolean | null | undefined | symbol;
|
|
|
2257
2253
|
|
|
2258
2254
|
interface EventLogParams {
|
|
2259
2255
|
log_name: string;
|
|
2260
|
-
log_type: 'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click';
|
|
2256
|
+
log_type: 'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click';
|
|
2261
2257
|
params: Record<string, Primitive>;
|
|
2262
2258
|
}
|
|
2263
2259
|
/**
|
|
@@ -2271,7 +2267,7 @@ interface EventLogParams {
|
|
|
2271
2267
|
*
|
|
2272
2268
|
* @param {Object} params 로그 기록에 필요한 매개변수 객체예요.
|
|
2273
2269
|
* @param {string} params.log_name 로그의 이름이에요.
|
|
2274
|
-
* @param {'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.
|
|
2270
|
+
* @param {'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.
|
|
2275
2271
|
* @param {Record<string, Primitive>} params.params 로그에 포함할 추가 매개변수 객체예요.
|
|
2276
2272
|
*
|
|
2277
2273
|
* @returns {Promise<void>} 로그 기록이 완료되면 해결되는 Promise예요.
|
|
@@ -2897,30 +2893,34 @@ declare function getTossAppVersion(): string;
|
|
|
2897
2893
|
* @kind function
|
|
2898
2894
|
* @name getTossShareLink
|
|
2899
2895
|
* @description
|
|
2900
|
-
*
|
|
2901
|
-
* 이 링크를 다른 사람과 공유하면 토스 앱이 실행되면서 지정한 경로로 진입해요. 토스앱이 없는 사람은 iOS 일 때는 앱스토어로 이동하고, Android 일 때는 플레이스토어로 이동해요.
|
|
2896
|
+
* 사용자가 지정한 경로를 토스 앱에서 열 수 있는 공유 링크를 생성해요.
|
|
2902
2897
|
*
|
|
2903
|
-
*
|
|
2904
|
-
*
|
|
2898
|
+
* 생성된 링크를 다른 사람과 공유하면:
|
|
2899
|
+
* - 토스 앱이 설치되어 있으면: 토스 앱이 실행되면서 지정한 경로로 이동해요.
|
|
2900
|
+
* - 토스 앱이 없으면: iOS는 앱스토어로, Android는 플레이스토어로 이동해요.
|
|
2905
2901
|
*
|
|
2906
|
-
*
|
|
2907
|
-
*
|
|
2908
|
-
* @
|
|
2909
|
-
* @returns {Promise<string>} `deep_link_value`가 포함된 토스 공유 링크를 반환해요.
|
|
2902
|
+
* @param path - 딥링크 경로예요. `intoss://`로 시작하는 문자열이어야 해요. (예: `intoss://my-app`, `intoss://my-app/detail?id=123`)
|
|
2903
|
+
* @param ogImageUrl - (선택) 공유 시 표시될 커스텀 OG 이미지 URL이에요. 최소 버전: Android 5.240.0, iOS 5.239.0
|
|
2904
|
+
* @returns {Promise<string>} 생성된 토스 공유 링크
|
|
2910
2905
|
*
|
|
2911
2906
|
* @example
|
|
2912
2907
|
* ```tsx
|
|
2913
2908
|
* import { share } from '@granite-js/react-native';
|
|
2914
2909
|
* import { getTossShareLink } from '@apps-in-toss/framework';
|
|
2915
2910
|
*
|
|
2916
|
-
* //
|
|
2911
|
+
* // 기본 사용법
|
|
2917
2912
|
* const tossLink = await getTossShareLink('intoss://my-app');
|
|
2918
|
-
*
|
|
2919
|
-
* // 생성한 링크를 메시지로 공유해요.
|
|
2920
2913
|
* await share({ message: tossLink });
|
|
2914
|
+
*
|
|
2915
|
+
* // 커스텀 OG 이미지와 함께 사용
|
|
2916
|
+
* const linkWithImage = await getTossShareLink(
|
|
2917
|
+
* 'intoss://my-app/event',
|
|
2918
|
+
* 'https://example.com/og-image.png'
|
|
2919
|
+
* );
|
|
2920
|
+
* await share({ message: linkWithImage });
|
|
2921
2921
|
* ```
|
|
2922
2922
|
*/
|
|
2923
|
-
declare function getTossShareLink(path: string): Promise<string>;
|
|
2923
|
+
declare function getTossShareLink(path: string, ogImageUrl?: string): Promise<string>;
|
|
2924
2924
|
|
|
2925
2925
|
/**
|
|
2926
2926
|
* @public
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
2
2
|
import { GraniteEvent } from "@granite-js/react-native";
|
|
3
3
|
|
|
4
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
|
|
5
|
-
import { GraniteEventDefinition } from "@granite-js/react-native";
|
|
6
|
-
var EntryMessageExitedEvent = class extends GraniteEventDefinition {
|
|
7
|
-
name = "entryMessageExited";
|
|
8
|
-
remove() {
|
|
9
|
-
}
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
|
-
listener(_) {
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
4
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
16
5
|
import { GetCurrentLocationPermissionError } from "@apps-in-toss/types";
|
|
17
|
-
import { GraniteEventDefinition
|
|
6
|
+
import { GraniteEventDefinition } from "@granite-js/react-native";
|
|
18
7
|
|
|
19
8
|
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
20
9
|
import { TurboModuleRegistry } from "react-native";
|
|
@@ -49,7 +38,7 @@ import { NativeEventEmitter } from "react-native";
|
|
|
49
38
|
var nativeEventEmitter = new NativeEventEmitter(AppsInTossModuleInstance);
|
|
50
39
|
|
|
51
40
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
52
|
-
var UpdateLocationEvent = class extends
|
|
41
|
+
var UpdateLocationEvent = class extends GraniteEventDefinition {
|
|
53
42
|
name = "updateLocationEvent";
|
|
54
43
|
subscriptionCount = 0;
|
|
55
44
|
ref = {
|
|
@@ -79,7 +68,7 @@ var UpdateLocationEvent = class extends GraniteEventDefinition2 {
|
|
|
79
68
|
};
|
|
80
69
|
|
|
81
70
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
82
|
-
import { GraniteEventDefinition as
|
|
71
|
+
import { GraniteEventDefinition as GraniteEventDefinition2 } from "@granite-js/react-native";
|
|
83
72
|
|
|
84
73
|
// src/utils/generateUUID.ts
|
|
85
74
|
function generateUUID(placeholder) {
|
|
@@ -141,7 +130,7 @@ var INTERNAL__appBridgeHandler = {
|
|
|
141
130
|
|
|
142
131
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
143
132
|
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
144
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends
|
|
133
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventDefinition2 {
|
|
145
134
|
static INTERNAL__appBridgeSubscription;
|
|
146
135
|
name = "appBridgeCallbackEvent";
|
|
147
136
|
constructor() {
|
|
@@ -171,8 +160,8 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventD
|
|
|
171
160
|
};
|
|
172
161
|
|
|
173
162
|
// src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
174
|
-
import { GraniteEventDefinition as
|
|
175
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends
|
|
163
|
+
import { GraniteEventDefinition as GraniteEventDefinition3 } from "@granite-js/react-native";
|
|
164
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDefinition3 {
|
|
176
165
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
177
166
|
subscription = null;
|
|
178
167
|
remove() {
|
|
@@ -199,7 +188,6 @@ var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDe
|
|
|
199
188
|
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
200
189
|
var appsInTossEvent = new GraniteEvent([
|
|
201
190
|
new UpdateLocationEvent(),
|
|
202
|
-
new EntryMessageExitedEvent(),
|
|
203
191
|
// Internal events
|
|
204
192
|
new AppBridgeCallbackEvent(),
|
|
205
193
|
new VisibilityChangedByTransparentServiceWebEvent()
|
|
@@ -653,7 +641,24 @@ function getTossAppVersion() {
|
|
|
653
641
|
}
|
|
654
642
|
|
|
655
643
|
// src/AppsInTossModule/native-modules/getTossShareLink.ts
|
|
656
|
-
|
|
644
|
+
var V2_MIN_VERSION = {
|
|
645
|
+
android: "5.240.0",
|
|
646
|
+
ios: "5.239.0"
|
|
647
|
+
};
|
|
648
|
+
async function getTossShareLink(path, ogImageUrl) {
|
|
649
|
+
if (!isMinVersionSupported(V2_MIN_VERSION)) {
|
|
650
|
+
return await getTossShareLinkV1(path);
|
|
651
|
+
}
|
|
652
|
+
const params = {
|
|
653
|
+
params: {
|
|
654
|
+
url: path,
|
|
655
|
+
ogImageUrl
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
const { shareLink } = await AppsInTossModule.getTossShareLink(params);
|
|
659
|
+
return shareLink;
|
|
660
|
+
}
|
|
661
|
+
async function getTossShareLinkV1(path) {
|
|
657
662
|
const { shareLink } = await AppsInTossModule.getTossShareLink({});
|
|
658
663
|
const shareUrl = new URL(shareLink);
|
|
659
664
|
shareUrl.searchParams.set("deep_link_value", path);
|
|
@@ -969,11 +974,19 @@ function contactsViral(params) {
|
|
|
969
974
|
}
|
|
970
975
|
|
|
971
976
|
// src/AppsInTossModule/native-modules/appsInTossSignTossCert.ts
|
|
972
|
-
|
|
973
|
-
|
|
977
|
+
var MIN_VERSION_BY_USER_TYPE = {
|
|
978
|
+
USER_PERSONAL: {
|
|
974
979
|
android: "5.233.0",
|
|
975
980
|
ios: "5.233.0"
|
|
976
|
-
}
|
|
981
|
+
},
|
|
982
|
+
USER_NONE: {
|
|
983
|
+
android: "5.236.0",
|
|
984
|
+
ios: "5.236.0"
|
|
985
|
+
}
|
|
986
|
+
};
|
|
987
|
+
async function appsInTossSignTossCert(params) {
|
|
988
|
+
const minVersion = params.skipConfirmDoc === true ? MIN_VERSION_BY_USER_TYPE.USER_NONE : MIN_VERSION_BY_USER_TYPE.USER_PERSONAL;
|
|
989
|
+
const isSupported = isMinVersionSupported(minVersion);
|
|
977
990
|
if (!isSupported) {
|
|
978
991
|
console.warn("appsInTossSignTossCert is not supported in this app version");
|
|
979
992
|
return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/native-modules",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.3",
|
|
5
5
|
"description": "Native Modules for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"vitest": "^3.2.4"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@apps-in-toss/types": "^1.5.
|
|
46
|
+
"@apps-in-toss/types": "^1.5.3",
|
|
47
47
|
"es-toolkit": "^1.39.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "b6152cb5bd176d6fd1863ff00638b38f17269e09"
|
|
58
58
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { GraniteEvent } from '@granite-js/react-native';
|
|
2
|
-
import { EntryMessageExitedEvent } from './event-plugins/EntryMessageExitedEvent';
|
|
3
2
|
import { UpdateLocationEvent } from './event-plugins/UpdateLocationEvent';
|
|
4
3
|
import { AppBridgeCallbackEvent } from './internal/AppBridgeCallbackEvent';
|
|
5
4
|
import { VisibilityChangedByTransparentServiceWebEvent } from './internal/VisibilityChangedByTransparentServiceWebEvent';
|
|
6
5
|
|
|
7
6
|
export const appsInTossEvent = new GraniteEvent([
|
|
8
7
|
new UpdateLocationEvent(),
|
|
9
|
-
new EntryMessageExitedEvent(),
|
|
10
8
|
|
|
11
9
|
// Internal events
|
|
12
10
|
new AppBridgeCallbackEvent(),
|
|
@@ -59,7 +59,7 @@ interface Spec extends __TurboModule {
|
|
|
59
59
|
clearStorage: (arg: CompatiblePlaceholderArgument) => Promise<void>;
|
|
60
60
|
eventLog: (params: {
|
|
61
61
|
log_name: string;
|
|
62
|
-
log_type: 'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click';
|
|
62
|
+
log_type: 'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click';
|
|
63
63
|
params: Record<string, string>;
|
|
64
64
|
}) => Promise<void>;
|
|
65
65
|
getTossShareLink: (params: object) => Promise<{ shareLink: string }>;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { AppsInTossModule } from './AppsInTossModule';
|
|
2
2
|
import { isMinVersionSupported } from './isMinVersionSupported';
|
|
3
3
|
|
|
4
|
+
const MIN_VERSION_BY_USER_TYPE = {
|
|
5
|
+
USER_PERSONAL: {
|
|
6
|
+
android: '5.233.0',
|
|
7
|
+
ios: '5.233.0',
|
|
8
|
+
},
|
|
9
|
+
USER_NONE: {
|
|
10
|
+
android: '5.236.0',
|
|
11
|
+
ios: '5.236.0',
|
|
12
|
+
},
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
4
15
|
export interface AppsInTossSignTossCertParams {
|
|
5
16
|
txId: string;
|
|
17
|
+
skipConfirmDoc?: boolean;
|
|
6
18
|
}
|
|
7
19
|
|
|
8
20
|
/**
|
|
@@ -13,6 +25,7 @@ export interface AppsInTossSignTossCertParams {
|
|
|
13
25
|
*
|
|
14
26
|
* @param {AppsInTossSignTossCertParams} params - 서명에 필요한 파라미터를 포함하는 객체예요.
|
|
15
27
|
* @param {string} params.txId - 토스인증서를 사용한 본인확인이나 간편인증, 전자서명에서 사용하는 Transaction Id예요.
|
|
28
|
+
* @param {boolean} params.skipConfirmDoc - (선택) 토스 원터치 인증방식을 사용하기 위한 옵션이예요. true 설정 시 최소 버전: Android 5.236.0, iOS 5.236.0 (default: false)
|
|
16
29
|
*
|
|
17
30
|
* @example
|
|
18
31
|
* ```tsx
|
|
@@ -34,10 +47,9 @@ export interface AppsInTossSignTossCertParams {
|
|
|
34
47
|
*/
|
|
35
48
|
|
|
36
49
|
export async function appsInTossSignTossCert(params: AppsInTossSignTossCertParams) {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
50
|
+
const minVersion =
|
|
51
|
+
params.skipConfirmDoc === true ? MIN_VERSION_BY_USER_TYPE.USER_NONE : MIN_VERSION_BY_USER_TYPE.USER_PERSONAL;
|
|
52
|
+
const isSupported = isMinVersionSupported(minVersion);
|
|
41
53
|
|
|
42
54
|
if (!isSupported) {
|
|
43
55
|
console.warn('appsInTossSignTossCert is not supported in this app version');
|
|
@@ -12,7 +12,7 @@ function normalizeParams(params: Record<string, Primitive>): Record<string, stri
|
|
|
12
12
|
|
|
13
13
|
export interface EventLogParams {
|
|
14
14
|
log_name: string;
|
|
15
|
-
log_type: 'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click';
|
|
15
|
+
log_type: 'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click';
|
|
16
16
|
params: Record<string, Primitive>;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -27,7 +27,7 @@ export interface EventLogParams {
|
|
|
27
27
|
*
|
|
28
28
|
* @param {Object} params 로그 기록에 필요한 매개변수 객체예요.
|
|
29
29
|
* @param {string} params.log_name 로그의 이름이에요.
|
|
30
|
-
* @param {'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.
|
|
30
|
+
* @param {'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.
|
|
31
31
|
* @param {Record<string, Primitive>} params.params 로그에 포함할 추가 매개변수 객체예요.
|
|
32
32
|
*
|
|
33
33
|
* @returns {Promise<void>} 로그 기록이 완료되면 해결되는 Promise예요.
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { AppsInTossModule } from './AppsInTossModule';
|
|
2
|
+
import { isMinVersionSupported } from './isMinVersionSupported';
|
|
3
|
+
|
|
4
|
+
const V2_MIN_VERSION = {
|
|
5
|
+
android: '5.240.0',
|
|
6
|
+
ios: '5.239.0',
|
|
7
|
+
} as const;
|
|
2
8
|
|
|
3
9
|
/**
|
|
4
10
|
* @public
|
|
@@ -6,30 +12,50 @@ import { AppsInTossModule } from './AppsInTossModule';
|
|
|
6
12
|
* @kind function
|
|
7
13
|
* @name getTossShareLink
|
|
8
14
|
* @description
|
|
9
|
-
*
|
|
10
|
-
* 이 링크를 다른 사람과 공유하면 토스 앱이 실행되면서 지정한 경로로 진입해요. 토스앱이 없는 사람은 iOS 일 때는 앱스토어로 이동하고, Android 일 때는 플레이스토어로 이동해요.
|
|
11
|
-
*
|
|
12
|
-
* 경로는 토스 앱 내부 특정 화면을 나타내는 딥링크(deep link) 형식이어야 해요.
|
|
13
|
-
* 예를 들어 `intoss://<앱 이름>`이나 `intoss://<앱 이름>/about?name=test`처럼 작성해요.
|
|
15
|
+
* 사용자가 지정한 경로를 토스 앱에서 열 수 있는 공유 링크를 생성해요.
|
|
14
16
|
*
|
|
15
|
-
*
|
|
17
|
+
* 생성된 링크를 다른 사람과 공유하면:
|
|
18
|
+
* - 토스 앱이 설치되어 있으면: 토스 앱이 실행되면서 지정한 경로로 이동해요.
|
|
19
|
+
* - 토스 앱이 없으면: iOS는 앱스토어로, Android는 플레이스토어로 이동해요.
|
|
16
20
|
*
|
|
17
|
-
* @param path -
|
|
18
|
-
* @
|
|
21
|
+
* @param path - 딥링크 경로예요. `intoss://`로 시작하는 문자열이어야 해요. (예: `intoss://my-app`, `intoss://my-app/detail?id=123`)
|
|
22
|
+
* @param ogImageUrl - (선택) 공유 시 표시될 커스텀 OG 이미지 URL이에요. 최소 버전: Android 5.240.0, iOS 5.239.0
|
|
23
|
+
* @returns {Promise<string>} 생성된 토스 공유 링크
|
|
19
24
|
*
|
|
20
25
|
* @example
|
|
21
26
|
* ```tsx
|
|
22
27
|
* import { share } from '@granite-js/react-native';
|
|
23
28
|
* import { getTossShareLink } from '@apps-in-toss/framework';
|
|
24
29
|
*
|
|
25
|
-
* //
|
|
30
|
+
* // 기본 사용법
|
|
26
31
|
* const tossLink = await getTossShareLink('intoss://my-app');
|
|
27
|
-
*
|
|
28
|
-
* // 생성한 링크를 메시지로 공유해요.
|
|
29
32
|
* await share({ message: tossLink });
|
|
33
|
+
*
|
|
34
|
+
* // 커스텀 OG 이미지와 함께 사용
|
|
35
|
+
* const linkWithImage = await getTossShareLink(
|
|
36
|
+
* 'intoss://my-app/event',
|
|
37
|
+
* 'https://example.com/og-image.png'
|
|
38
|
+
* );
|
|
39
|
+
* await share({ message: linkWithImage });
|
|
30
40
|
* ```
|
|
31
41
|
*/
|
|
32
|
-
export async function getTossShareLink(path: string): Promise<string> {
|
|
42
|
+
export async function getTossShareLink(path: string, ogImageUrl?: string): Promise<string> {
|
|
43
|
+
if (!isMinVersionSupported(V2_MIN_VERSION)) {
|
|
44
|
+
return await getTossShareLinkV1(path);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const params = {
|
|
48
|
+
params: {
|
|
49
|
+
url: path,
|
|
50
|
+
ogImageUrl,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const { shareLink } = await AppsInTossModule.getTossShareLink(params);
|
|
55
|
+
return shareLink;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function getTossShareLinkV1(path: string): Promise<string> {
|
|
33
59
|
const { shareLink } = await AppsInTossModule.getTossShareLink({});
|
|
34
60
|
const shareUrl = new URL(shareLink);
|
|
35
61
|
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { GraniteEventDefinition } from '@granite-js/react-native';
|
|
2
|
-
|
|
3
|
-
export class EntryMessageExitedEvent extends GraniteEventDefinition<undefined, undefined> {
|
|
4
|
-
name = 'entryMessageExited' as const;
|
|
5
|
-
|
|
6
|
-
remove() {}
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
-
listener(_: undefined) {}
|
|
10
|
-
}
|