@apps-in-toss/native-modules 0.0.0-dev.1758275837494 → 0.0.0-dev.1760943445541
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 +4 -0
- package/dist/index.cjs +114 -44
- package/dist/index.d.cts +159 -6
- package/dist/index.d.ts +159 -6
- package/dist/index.js +99 -30
- package/package.json +5 -5
- package/src/AppsInTossModule/native-modules/AppsInTossModule.ts +8 -1
- package/src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts +37 -26
- package/src/AppsInTossModule/native-modules/appsInTossSignTossCert.ts +48 -0
- package/src/AppsInTossModule/native-modules/iap.ts +136 -6
- package/src/AppsInTossModule/native-modules/index.ts +1 -0
- package/src/async-bridges.ts +1 -0
- package/src/utils/getReferrer.ts +9 -0
package/dist/bridges-meta.json
CHANGED
|
@@ -91,6 +91,10 @@
|
|
|
91
91
|
"identifier": "saveBase64Data",
|
|
92
92
|
"dts": "export interface SaveBase64DataParams {\n\tdata: string;\n\tfileName: string;\n\tmimeType: string;\n}\n/**\n * @public\n * @category 데이터\n * @name saveBase64Data\n * @description 문자열로 인코딩된 Base64 데이터를 지정한 파일 이름과 MIME 타입으로 사용자 기기에 저장해요. 이미지, 텍스트, PDF 등 다양한 형식의 데이터를 저장할 수 있어요.\n * @param {SaveBase64DataParams} params - 저장할 데이터와 파일 정보를 담은 객체예요.\n * @param {string} params.data - Base64 형식으로 인코딩된 데이터 문자열이에요.\n * @param {string} params.fileName - 저장할 파일 이름이에요. 확장자도 같이 붙여줘야해요. 예를 들어, 'example.png'로 저장할 수 있어요.\n * @param {string} params.mimeType - 저장할 파일의 MIME 타입이에요. 예를 들어 'image/png' 로 지정하면 이미지, 'application/pdf'는 PDF 파일이에요. 자세한 내용은 [MIME 문서](https://developer.mozilla.org/ko/docs/Web/HTTP/Guides/MIME_types)를 참고해주세요.\n *\n * @example\n * ### Base64 이미지 데이터를 사용자 기기에 저장하기\n *\n * ```tsx\n * import { Button } from 'react-native';\n * import { saveBase64Data } from '@apps-in-toss/framework';\n *\n * // '저장' 버튼을 누르면 이미지가 사용자 기기에 저장돼요.\n * function SaveButton() {\n * const handleSave = async () => {\n * try {\n * await saveBase64Data({\n * data: 'iVBORw0KGgo...',\n * fileName: 'some-photo.png',\n * mimeType: 'image/png',\n * });\n * } catch (error) {\n * console.error('데이터 저장에 실패했어요:', error);\n * }\n * };\n *\n * return <Button title=\"저장\" onPress={handleSave} />;\n * }\n * ```\n */\nexport declare function saveBase64Data(params: SaveBase64DataParams): Promise<void>;\n\nexport {};\n"
|
|
93
93
|
},
|
|
94
|
+
{
|
|
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"
|
|
97
|
+
},
|
|
94
98
|
{
|
|
95
99
|
"identifier": "getGameCenterGameProfile",
|
|
96
100
|
"dts": "/**\n * @category 게임센터\n * @name GameCenterGameProfileResponse\n * @description 토스게임센터 프로필을 가져온 결과 타입이에요.\n * 앱에 프로필이 없는 경우, `statusCode`가 `'PROFILE_NOT_FOUND'`이고 다른 정보는 없어요.\n * 프로필이 있는 경우 `statusCode`가 `'SUCCESS'`이고, 닉네임과 프로필 이미지 주소가 함께 제공돼요.\n * @property {string} statusCode 프로필 조회 결과 상태예요. `'SUCCESS'` 또는 `'PROFILE_NOT_FOUND'` 중 하나예요.\n * @property {string} [nickname] 프로필 닉네임이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.\n * @property {string} [profileImageUri] 프로필 이미지 URL이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.\n */\nexport type GameCenterGameProfileResponse = {\n\tstatusCode: \"PROFILE_NOT_FOUND\";\n} | {\n\tstatusCode: \"SUCCESS\";\n\tnickname: string;\n\tprofileImageUri: string;\n};\n/**\n * @category 게임센터\n * @name getGameCenterGameProfile\n * @description 토스게임센터 프로필 정보를 가져와요.\n * 사용자가 프로필을 만들지 않았다면 `statusCode`가 `'PROFILE_NOT_FOUND'`인 응답이 반환돼요.\n * 앱 버전이 최소 지원 버전(안드로이드 5.221.0, iOS 5.221.0)보다 낮으면 `undefined`를 반환해요.\n * @returns {Promise<GameCenterGameProfileResponse | undefined>} 프로필 정보 또는 `undefined`를 반환해요.\n *\n * @example\n * ### 게임센터 프로필 가져오기\n * ```tsx\n * import { getGameCenterGameProfile } from './getGameCenterGameProfile';\n * import { useState } from 'react';\n * import { View, Button } from 'react-native';\n *\n * function GameProfile() {\n * const [profile, setProfile] = useState<GameCenterGameProfileResponse | null>(null);\n *\n * const handlePress = async () => {\n * try {\n * const result = await getGameCenterGameProfile();\n * if (result) {\n * setProfile(result);\n * }\n * } catch (error) {\n * console.error('게임센터 프로필 가져오기에 실패했어요.', error);\n * }\n * };\n *\n * return (\n * <View>\n * <Button title=\"게임센터 프로필 가져오기\" onPress={handlePress} />\n * </View>\n * );\n * }\n * ```\n */\nexport declare function getGameCenterGameProfile(): Promise<GameCenterGameProfileResponse | undefined>;\n\nexport {};\n"
|
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
TossPay: () => TossPay,
|
|
34
34
|
appLogin: () => appLogin,
|
|
35
35
|
appsInTossEvent: () => appsInTossEvent,
|
|
36
|
+
appsInTossSignTossCert: () => appsInTossSignTossCert,
|
|
36
37
|
closeView: () => closeView,
|
|
37
38
|
contactsViral: () => contactsViral,
|
|
38
39
|
eventLog: () => eventLog,
|
|
@@ -47,7 +48,7 @@ __export(index_exports, {
|
|
|
47
48
|
getNetworkStatus: () => getNetworkStatus,
|
|
48
49
|
getOperationalEnvironment: () => getOperationalEnvironment,
|
|
49
50
|
getPlatformOS: () => getPlatformOS,
|
|
50
|
-
getSchemeUri: () =>
|
|
51
|
+
getSchemeUri: () => getSchemeUri2,
|
|
51
52
|
getTossAppVersion: () => getTossAppVersion,
|
|
52
53
|
getTossShareLink: () => getTossShareLink,
|
|
53
54
|
iapCreateOneTimePurchaseOrder: () => iapCreateOneTimePurchaseOrder,
|
|
@@ -480,16 +481,33 @@ showAdMobRewardedAd.isSupported = createIsSupported();
|
|
|
480
481
|
|
|
481
482
|
// src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts
|
|
482
483
|
var import_es_toolkit2 = require("es-toolkit");
|
|
484
|
+
|
|
485
|
+
// src/utils/getReferrer.ts
|
|
486
|
+
var import_react_native9 = require("@granite-js/react-native");
|
|
487
|
+
function getReferrer() {
|
|
488
|
+
try {
|
|
489
|
+
return new URL((0, import_react_native9.getSchemeUri)()).searchParams.get("referrer");
|
|
490
|
+
} catch {
|
|
491
|
+
return null;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts
|
|
483
496
|
function loadAppsInTossAdMob(params) {
|
|
484
497
|
if (!loadAppsInTossAdMob.isSupported()) {
|
|
485
498
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
486
499
|
return import_es_toolkit2.noop;
|
|
487
500
|
}
|
|
488
501
|
const { onEvent, onError, options } = params;
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
502
|
+
const referrer = getReferrer();
|
|
503
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
504
|
+
"loadAppsInTossAdmob",
|
|
505
|
+
{ ...options, referrer },
|
|
506
|
+
{
|
|
507
|
+
onSuccess: (result) => onEvent({ type: "loaded", data: result }),
|
|
508
|
+
onError
|
|
509
|
+
}
|
|
510
|
+
);
|
|
493
511
|
return unregisterCallbacks;
|
|
494
512
|
}
|
|
495
513
|
function showAppsInTossAdMob(params) {
|
|
@@ -498,28 +516,33 @@ function showAppsInTossAdMob(params) {
|
|
|
498
516
|
return import_es_toolkit2.noop;
|
|
499
517
|
}
|
|
500
518
|
const { onEvent, onError, options } = params;
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
},
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
519
|
+
const referrer = getReferrer();
|
|
520
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
521
|
+
"showAppsInTossAdmob",
|
|
522
|
+
{ ...options, referrer },
|
|
523
|
+
{
|
|
524
|
+
onAdClicked: () => {
|
|
525
|
+
onEvent({ type: "clicked" });
|
|
526
|
+
},
|
|
527
|
+
onAdDismissed: () => {
|
|
528
|
+
onEvent({ type: "dismissed" });
|
|
529
|
+
},
|
|
530
|
+
onAdFailedToShow: () => {
|
|
531
|
+
onEvent({ type: "failedToShow" });
|
|
532
|
+
},
|
|
533
|
+
onAdImpression: () => {
|
|
534
|
+
onEvent({ type: "impression" });
|
|
535
|
+
},
|
|
536
|
+
onAdShow: () => {
|
|
537
|
+
onEvent({ type: "show" });
|
|
538
|
+
},
|
|
539
|
+
onUserEarnedReward: (data) => {
|
|
540
|
+
onEvent({ type: "userEarnedReward", data });
|
|
541
|
+
},
|
|
542
|
+
onSuccess: () => onEvent({ type: "requested" }),
|
|
543
|
+
onError
|
|
544
|
+
}
|
|
545
|
+
);
|
|
523
546
|
return unregisterCallbacks;
|
|
524
547
|
}
|
|
525
548
|
var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION2 = "5.227.0";
|
|
@@ -749,7 +772,7 @@ function createOneTimePurchaseOrder(params) {
|
|
|
749
772
|
return import_es_toolkit3.noop;
|
|
750
773
|
}
|
|
751
774
|
const isProcessProductGrantSupported = isMinVersionSupported({
|
|
752
|
-
android: "5.
|
|
775
|
+
android: "5.231.1",
|
|
753
776
|
ios: "5.230.0"
|
|
754
777
|
});
|
|
755
778
|
const { options, onEvent, onError } = params;
|
|
@@ -797,9 +820,42 @@ async function getProductItemList() {
|
|
|
797
820
|
}
|
|
798
821
|
return AppsInTossModule.iapGetProductItemList({});
|
|
799
822
|
}
|
|
823
|
+
async function getPendingOrders() {
|
|
824
|
+
const isSupported = isMinVersionSupported({
|
|
825
|
+
android: "5.231.0",
|
|
826
|
+
ios: "5.231.0"
|
|
827
|
+
});
|
|
828
|
+
if (!isSupported) {
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
return AppsInTossModule.getPendingOrders({});
|
|
832
|
+
}
|
|
833
|
+
async function getCompletedOrRefundedOrders(params) {
|
|
834
|
+
const isSupported = isMinVersionSupported({
|
|
835
|
+
android: "5.231.0",
|
|
836
|
+
ios: "5.231.0"
|
|
837
|
+
});
|
|
838
|
+
if (!isSupported) {
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
return AppsInTossModule.getCompletedOrRefundedOrders(params ?? { key: null });
|
|
842
|
+
}
|
|
843
|
+
async function completeProductGrant(params) {
|
|
844
|
+
const isSupported = isMinVersionSupported({
|
|
845
|
+
android: "5.233.0",
|
|
846
|
+
ios: "5.233.0"
|
|
847
|
+
});
|
|
848
|
+
if (!isSupported) {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
return AppsInTossModule.completeProductGrant(params);
|
|
852
|
+
}
|
|
800
853
|
var IAP = {
|
|
801
854
|
createOneTimePurchaseOrder,
|
|
802
|
-
getProductItemList
|
|
855
|
+
getProductItemList,
|
|
856
|
+
getPendingOrders,
|
|
857
|
+
getCompletedOrRefundedOrders,
|
|
858
|
+
completeProductGrant
|
|
803
859
|
};
|
|
804
860
|
|
|
805
861
|
// src/AppsInTossModule/native-modules/saveBase64Data.ts
|
|
@@ -851,7 +907,7 @@ var Storage = {
|
|
|
851
907
|
};
|
|
852
908
|
|
|
853
909
|
// src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts
|
|
854
|
-
var
|
|
910
|
+
var import_react_native10 = require("@granite-js/react-native");
|
|
855
911
|
|
|
856
912
|
// src/AppsInTossModule/constants.ts
|
|
857
913
|
var GAME_CENTER_MIN_VERSION = {
|
|
@@ -871,7 +927,7 @@ async function openGameCenterLeaderboard() {
|
|
|
871
927
|
const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
|
|
872
928
|
url.searchParams.set("appName", appName);
|
|
873
929
|
url.searchParams.set("referrer", `appsintoss.${appName}`);
|
|
874
|
-
return (0,
|
|
930
|
+
return (0, import_react_native10.openURL)(url.toString());
|
|
875
931
|
}
|
|
876
932
|
|
|
877
933
|
// src/AppsInTossModule/native-modules/getGameCenterGameProfile.ts
|
|
@@ -915,6 +971,19 @@ function contactsViral(params) {
|
|
|
915
971
|
return unregisterCallbacks;
|
|
916
972
|
}
|
|
917
973
|
|
|
974
|
+
// src/AppsInTossModule/native-modules/appsInTossSignTossCert.ts
|
|
975
|
+
async function appsInTossSignTossCert(params) {
|
|
976
|
+
const isSupported = isMinVersionSupported({
|
|
977
|
+
android: "5.233.0",
|
|
978
|
+
ios: "5.233.0"
|
|
979
|
+
});
|
|
980
|
+
if (!isSupported) {
|
|
981
|
+
console.warn("appsInTossSignTossCert is not supported in this app version");
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
await AppsInTossModule.appsInTossSignTossCert({ params });
|
|
985
|
+
}
|
|
986
|
+
|
|
918
987
|
// src/AppsInTossModule/native-modules/index.ts
|
|
919
988
|
var TossPay = {
|
|
920
989
|
checkoutPayment
|
|
@@ -944,8 +1013,8 @@ function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
|
944
1013
|
}
|
|
945
1014
|
|
|
946
1015
|
// src/BedrockModule/native-modules/natives/BedrockModule.ts
|
|
947
|
-
var
|
|
948
|
-
var BedrockModule =
|
|
1016
|
+
var import_react_native11 = require("react-native");
|
|
1017
|
+
var BedrockModule = import_react_native11.NativeModules.BedrockModule;
|
|
949
1018
|
|
|
950
1019
|
// src/BedrockModule/native-modules/natives/closeView.ts
|
|
951
1020
|
async function closeView() {
|
|
@@ -953,10 +1022,10 @@ async function closeView() {
|
|
|
953
1022
|
}
|
|
954
1023
|
|
|
955
1024
|
// src/BedrockModule/native-modules/natives/getLocale.ts
|
|
956
|
-
var
|
|
1025
|
+
var import_react_native12 = require("react-native");
|
|
957
1026
|
function getLocale() {
|
|
958
1027
|
const locale = BedrockModule?.DeviceInfo?.locale ?? "ko-KR";
|
|
959
|
-
if (
|
|
1028
|
+
if (import_react_native12.Platform.OS === "android") {
|
|
960
1029
|
return replaceUnderbarToHypen(locale);
|
|
961
1030
|
}
|
|
962
1031
|
return locale;
|
|
@@ -966,7 +1035,7 @@ function replaceUnderbarToHypen(locale) {
|
|
|
966
1035
|
}
|
|
967
1036
|
|
|
968
1037
|
// src/BedrockModule/native-modules/natives/getSchemeUri.ts
|
|
969
|
-
function
|
|
1038
|
+
function getSchemeUri2() {
|
|
970
1039
|
return BedrockModule.schemeUri;
|
|
971
1040
|
}
|
|
972
1041
|
|
|
@@ -1004,24 +1073,24 @@ async function setIosSwipeGestureEnabled(options) {
|
|
|
1004
1073
|
}
|
|
1005
1074
|
|
|
1006
1075
|
// src/BedrockModule/native-modules/natives/openURL.ts
|
|
1007
|
-
var
|
|
1076
|
+
var import_react_native13 = require("react-native");
|
|
1008
1077
|
function openURL2(url) {
|
|
1009
|
-
return
|
|
1078
|
+
return import_react_native13.Linking.openURL(url);
|
|
1010
1079
|
}
|
|
1011
1080
|
|
|
1012
1081
|
// src/BedrockModule/native-modules/natives/getPlatformOS.ts
|
|
1013
|
-
var
|
|
1082
|
+
var import_react_native14 = require("react-native");
|
|
1014
1083
|
function getPlatformOS() {
|
|
1015
|
-
return
|
|
1084
|
+
return import_react_native14.Platform.OS;
|
|
1016
1085
|
}
|
|
1017
1086
|
|
|
1018
1087
|
// src/BedrockModule/native-modules/core/BedrockCoreModule.ts
|
|
1019
|
-
var
|
|
1020
|
-
var BedrockCoreModule =
|
|
1088
|
+
var import_react_native15 = require("react-native");
|
|
1089
|
+
var BedrockCoreModule = import_react_native15.NativeModules.BedrockCoreModule;
|
|
1021
1090
|
|
|
1022
1091
|
// src/AppsInTossModule/native-modules/tossCore.ts
|
|
1023
|
-
var
|
|
1024
|
-
var TossCoreModule =
|
|
1092
|
+
var import_react_native16 = require("react-native");
|
|
1093
|
+
var TossCoreModule = import_react_native16.NativeModules.TossCoreModule;
|
|
1025
1094
|
function tossCoreEventLog(params) {
|
|
1026
1095
|
const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
|
|
1027
1096
|
const isSandbox = getOperationalEnvironment() === "sandbox";
|
|
@@ -1056,6 +1125,7 @@ var INTERNAL__module = {
|
|
|
1056
1125
|
TossPay,
|
|
1057
1126
|
appLogin,
|
|
1058
1127
|
appsInTossEvent,
|
|
1128
|
+
appsInTossSignTossCert,
|
|
1059
1129
|
closeView,
|
|
1060
1130
|
contactsViral,
|
|
1061
1131
|
eventLog,
|
package/dist/index.d.cts
CHANGED
|
@@ -1355,6 +1355,38 @@ interface CheckoutPaymentResult {
|
|
|
1355
1355
|
*/
|
|
1356
1356
|
declare function checkoutPayment(options: CheckoutPaymentOptions): Promise<CheckoutPaymentResult>;
|
|
1357
1357
|
|
|
1358
|
+
interface AppsInTossSignTossCertParams {
|
|
1359
|
+
txId: string;
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* @public
|
|
1363
|
+
* @category 토스인증
|
|
1364
|
+
* @name appsInTossSignTossCert
|
|
1365
|
+
* @description 토스 인증서를 사용해 서명하는 기능을 제공해요. 이 함수를 사용하면 앱인토스에서 제공하는 인증서를 활용해 서명을 할 수 있어요.
|
|
1366
|
+
*
|
|
1367
|
+
* @param {AppsInTossSignTossCertParams} params - 서명에 필요한 파라미터를 포함하는 객체예요.
|
|
1368
|
+
* @param {string} params.txId - 토스인증서를 사용한 본인확인이나 간편인증, 전자서명에서 사용하는 Transaction Id예요.
|
|
1369
|
+
*
|
|
1370
|
+
* @example
|
|
1371
|
+
* ```tsx
|
|
1372
|
+
* import { appsInTossSignTossCert } from '@apps-in-toss/framework';
|
|
1373
|
+
*
|
|
1374
|
+
* // 서명에 필요한 파라미터를 정의해요.
|
|
1375
|
+
* const params = {
|
|
1376
|
+
* txId: "f2e1a6df..."
|
|
1377
|
+
* };
|
|
1378
|
+
*
|
|
1379
|
+
* appsInTossSignTossCert(params)
|
|
1380
|
+
* .then(() => {
|
|
1381
|
+
* console.log('서명 작업이 성공적으로 완료되었어요.');
|
|
1382
|
+
* })
|
|
1383
|
+
* .catch((error) => {
|
|
1384
|
+
* console.error('서명 작업 중 에러가 발생했어요:', error);
|
|
1385
|
+
* });
|
|
1386
|
+
* ```
|
|
1387
|
+
*/
|
|
1388
|
+
declare function appsInTossSignTossCert(params: AppsInTossSignTossCertParams): Promise<void>;
|
|
1389
|
+
|
|
1358
1390
|
/**
|
|
1359
1391
|
* @category 게임센터
|
|
1360
1392
|
* @name GameCenterGameProfileResponse
|
|
@@ -1509,7 +1541,7 @@ declare function requestOneTimePurchase(params: IapRequestOneTimePurchaseOptions
|
|
|
1509
1541
|
*
|
|
1510
1542
|
* ```tsx
|
|
1511
1543
|
* import { IAP } from "@apps-in-toss/web-framework";
|
|
1512
|
-
* import { Button } from "@toss-
|
|
1544
|
+
* import { Button } from "@toss/tds-react-native";
|
|
1513
1545
|
* import { useCallback } from "react";
|
|
1514
1546
|
*
|
|
1515
1547
|
* interface Props {
|
|
@@ -1548,7 +1580,7 @@ declare function createOneTimePurchaseOrder(params: IapCreateOneTimePurchaseOrde
|
|
|
1548
1580
|
* @category 인앱결제
|
|
1549
1581
|
* @name IapProductListItem
|
|
1550
1582
|
* @description 인앱결제로 구매할 수 있는 상품 하나의 정보를 담은 객체예요. 상품 목록을 화면에 표시할 때 사용해요.
|
|
1551
|
-
* @property {string} sku - 상품의 고유 ID예요.
|
|
1583
|
+
* @property {string} sku - 상품의 고유 ID예요.
|
|
1552
1584
|
* @property {string} displayName - 화면에 표시할 상품 이름이에요. 상품 이름은 앱인토스 콘솔에서 설정한 값이에요.
|
|
1553
1585
|
* @property {string} displayAmount - 통화 단위가 포함된 가격 정보예요. 예를 들어 `1,000원`으로 가격과 통화가 함께 표시돼요.
|
|
1554
1586
|
* @property {string} iconUrl - 상품 아이콘 이미지의 URL이에요. 아이콘은 앱인토스 콘솔에서 설정한 이미지예요.
|
|
@@ -1573,7 +1605,7 @@ interface IapProductListItem {
|
|
|
1573
1605
|
*
|
|
1574
1606
|
* ```tsx
|
|
1575
1607
|
* import { IAP, IapProductListItem } from "@apps-in-toss/framework";
|
|
1576
|
-
* import { Button, List, ListRow } from "@toss-
|
|
1608
|
+
* import { Button, List, ListRow } from "@toss/tds-react-native";
|
|
1577
1609
|
* import { useEffect, useState } from "react";
|
|
1578
1610
|
*
|
|
1579
1611
|
* function IapProductList() {
|
|
@@ -1635,17 +1667,123 @@ interface IapProductListItem {
|
|
|
1635
1667
|
declare function getProductItemList(): Promise<{
|
|
1636
1668
|
products: IapProductListItem[];
|
|
1637
1669
|
} | undefined>;
|
|
1670
|
+
/**
|
|
1671
|
+
* @public
|
|
1672
|
+
* @category 인앱결제
|
|
1673
|
+
* @name getPendingOrders
|
|
1674
|
+
* @description 대기 중인 주문 목록을 가져와요. 이 함수를 사용하면 결제가 아직 완료되지 않은 주문 정보를 확인할 수 있어요.
|
|
1675
|
+
* @returns {Promise<{orderIds: string[]}}>} 대기 중인 주문ID 배열을 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.231.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
1676
|
+
*
|
|
1677
|
+
* @example
|
|
1678
|
+
* ### 대기 중인 주문 목록 가져오기
|
|
1679
|
+
* ```typescript
|
|
1680
|
+
* import { IAP } from '@apps-in-toss/framework';
|
|
1681
|
+
*
|
|
1682
|
+
* async function fetchOrders() {
|
|
1683
|
+
* try {
|
|
1684
|
+
* const pendingOrders = await IAP.getPendingOrders();
|
|
1685
|
+
* return pendingOrders;
|
|
1686
|
+
* } catch (error) {
|
|
1687
|
+
* console.error(error);
|
|
1688
|
+
* }
|
|
1689
|
+
* }
|
|
1690
|
+
* ```
|
|
1691
|
+
*/
|
|
1692
|
+
declare function getPendingOrders(): Promise<{
|
|
1693
|
+
orderIds: string[];
|
|
1694
|
+
} | undefined>;
|
|
1695
|
+
/**
|
|
1696
|
+
* @public
|
|
1697
|
+
* @category 인앱결제
|
|
1698
|
+
* @name CompletedOrRefundedOrdersResult
|
|
1699
|
+
* @description 인앱결제로 구매하거나 환불한 주문 목록을 나타내는 객체예요. 페이지네이션 정보를 포함해요.
|
|
1700
|
+
* @property {boolean} hasNext 다음 페이지가 있는지 여부예요. `true`면 더 많은 주문이 남아 있어요.
|
|
1701
|
+
* @property {string | null} [nextKey] 다음 주문 목록을 조회할 때 사용할 키예요. 마지막 페이지라면 `null`이거나 생략될 수 있어요.
|
|
1702
|
+
* @property {Array} orders 주문 정보를 담은 배열이에요. 각 요소는 하나의 주문을 나타내요.
|
|
1703
|
+
* @property {string} orders[].orderId 주문의 고유 ID예요.
|
|
1704
|
+
* @property {string} orders[].sku 주문 상품의 고유 ID예요.
|
|
1705
|
+
* @property {'COMPLETED' | 'REFUNDED'} orders[].status 주문의 상태예요. 'COMPLETED'는 주문이 완료된 상태, 'REFUNDED'는 환불된 상태를 의미해요.
|
|
1706
|
+
* @property {string} orders[].date 주문의 날짜 정보예요. ISO 8601 형식(YYYY-MM-DDTHH:mm:ss)을 사용해요. 예를 들어 "2025-09-22T00:00:00" 형식으로 제공돼요. 주문 상태가 `COMPLETED`라면 주문한 날짜를, `REFUNDED`라면 환불한 날짜를 나타내요.
|
|
1707
|
+
*/
|
|
1708
|
+
interface CompletedOrRefundedOrdersResult {
|
|
1709
|
+
hasNext: boolean;
|
|
1710
|
+
nextKey?: string | null;
|
|
1711
|
+
orders: {
|
|
1712
|
+
orderId: string;
|
|
1713
|
+
sku: string;
|
|
1714
|
+
status: 'COMPLETED' | 'REFUNDED';
|
|
1715
|
+
date: string;
|
|
1716
|
+
}[];
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* @public
|
|
1720
|
+
* @category 인앱결제
|
|
1721
|
+
* @name getCompletedOrRefundedOrders
|
|
1722
|
+
* @description 인앱결제로 구매하거나 환불한 주문 목록을 가져와요.
|
|
1723
|
+
* @returns {Promise<CompletedOrRefundedOrdersResult>} 페이지네이션을 포함한 주문 목록 객체를 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.231.0, iOS 5.231.0)보다 낮으면 `undefined`를 반환해요.
|
|
1724
|
+
*
|
|
1725
|
+
* @example
|
|
1726
|
+
* ```typescript
|
|
1727
|
+
* import { IAP } from "@apps-in-toss/framework";
|
|
1728
|
+
*
|
|
1729
|
+
* async function fetchOrders() {
|
|
1730
|
+
* try {
|
|
1731
|
+
* const response = await IAP.getCompletedOrRefundedOrders();
|
|
1732
|
+
* return response;
|
|
1733
|
+
* } catch (error) {
|
|
1734
|
+
* console.error(error);
|
|
1735
|
+
* }
|
|
1736
|
+
* }
|
|
1737
|
+
* ```
|
|
1738
|
+
*/
|
|
1739
|
+
declare function getCompletedOrRefundedOrders(params?: {
|
|
1740
|
+
key?: string | null;
|
|
1741
|
+
}): Promise<CompletedOrRefundedOrdersResult | undefined>;
|
|
1742
|
+
/**
|
|
1743
|
+
* @public
|
|
1744
|
+
* @category 인앱결제
|
|
1745
|
+
* @name completeProductGrant
|
|
1746
|
+
* @description 상품 지급 처리를 완료했다는 메시지를 앱에 전달해요. 이 함수를 사용하면 결제가 완료된 주문의 상품 지급이 정상적으로 완료되었음을 알릴 수 있어요.
|
|
1747
|
+
* @param {{ params: { orderId: string } }} params 결제가 완료된 주문 정보를 담은 객체예요.
|
|
1748
|
+
* @param {string} params.orderId 주문의 고유 ID예요. 상품 지급을 완료할 주문을 지정할 때 사용해요.
|
|
1749
|
+
* @returns {Promise<boolean>} 상품 지급이 완료됐는지 여부를 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.233.0, iOS 5.233.0)보다 낮으면 `undefined`를 반환해요.
|
|
1750
|
+
*
|
|
1751
|
+
* @example
|
|
1752
|
+
* ### 결제를 성공한 뒤 상품을 지급하는 예시
|
|
1753
|
+
* ```typescript
|
|
1754
|
+
* import { IAP } from '@apps-in-toss/framework';
|
|
1755
|
+
*
|
|
1756
|
+
* async function handleGrantProduct(orderId: string) {
|
|
1757
|
+
* try {
|
|
1758
|
+
* await IAP.completeProductGrant({ params: { orderId } });
|
|
1759
|
+
* } catch (error) {
|
|
1760
|
+
* console.error(error);
|
|
1761
|
+
* }
|
|
1762
|
+
* }
|
|
1763
|
+
* ```
|
|
1764
|
+
*/
|
|
1765
|
+
declare function completeProductGrant(params: {
|
|
1766
|
+
params: {
|
|
1767
|
+
orderId: string;
|
|
1768
|
+
};
|
|
1769
|
+
}): Promise<boolean | undefined>;
|
|
1638
1770
|
/**
|
|
1639
1771
|
* @public
|
|
1640
1772
|
* @category 인앱결제
|
|
1641
1773
|
* @name IAP
|
|
1642
1774
|
* @description 인앱결제 관련 기능을 모은 객체예요. 단건 인앱결제 주문서 이동과 상품 목록 조회 기능을 제공해요.
|
|
1643
|
-
* @property {typeof createOneTimePurchaseOrder} [createOneTimePurchaseOrder] 특정 인앱결제 주문서 페이지로 이동해요. 자세한 내용은 [createOneTimePurchaseOrder](https://developers-apps-in-toss.toss.im/bedrock/reference/
|
|
1644
|
-
* @property {typeof getProductItemList} [getProductItemList] 인앱결제로 구매할 수 있는 상품 목록을 가져와요. 자세한 내용은 [getProductItemList](https://developers-apps-in-toss.toss.im/bedrock/reference/
|
|
1775
|
+
* @property {typeof createOneTimePurchaseOrder} [createOneTimePurchaseOrder] 특정 인앱결제 주문서 페이지로 이동해요. 자세한 내용은 [createOneTimePurchaseOrder](https://developers-apps-in-toss.toss.im/bedrock/reference/framework/%EC%9D%B8%EC%95%B1%20%EA%B2%B0%EC%A0%9C/createOneTimePurchaseOrder.html) 문서를 참고하세요.
|
|
1776
|
+
* @property {typeof getProductItemList} [getProductItemList] 인앱결제로 구매할 수 있는 상품 목록을 가져와요. 자세한 내용은 [getProductItemList](https://developers-apps-in-toss.toss.im/bedrock/reference/framework/%EC%9D%B8%EC%95%B1%20%EA%B2%B0%EC%A0%9C/getProductItemList.html) 문서를 참고하세요.
|
|
1777
|
+
* @property {typeof getPendingOrders} [getPendingOrders] 대기 중인 주문 목록을 가져와요. 자세한 내용은 [getPendingOrders](https://developers-apps-in-toss.toss.im/bedrock/reference/framework/%EC%9D%B8%EC%95%B1%20%EA%B2%B0%EC%A0%9C/getPendingOrders.htm) 문서를 참고하세요.
|
|
1778
|
+
* @property {typeof getCompletedOrRefundedOrders} [getCompletedOrRefundedOrders] 인앱결제로 구매하거나 환불한 주문 목록을 가져와요. 자세한 내용은 [getCompletedOrRefundedOrders](https://developers-apps-in-toss.toss.im/bedrock/reference/framework/%EC%9D%B8%EC%95%B1%20%EA%B2%B0%EC%A0%9C/getCompletedOrRefundedOrders.html) 문서를 참고하세요.
|
|
1779
|
+
* @property {typeof completeProductGrant} [completeProductGrant] 상품 지급 처리를 완료했다는 메시지를 앱에 전달해요. 자세한 내용은 [completeProductGrant](https://developers-apps-in-toss.toss.im/bedrock/reference/framework/%EC%9D%B8%EC%95%B1%20%EA%B2%B0%EC%A0%9C/completeProductGrant.html) 문서를 참고하세요.
|
|
1645
1780
|
*/
|
|
1646
1781
|
declare const IAP: {
|
|
1647
1782
|
createOneTimePurchaseOrder: typeof createOneTimePurchaseOrder;
|
|
1648
1783
|
getProductItemList: typeof getProductItemList;
|
|
1784
|
+
getPendingOrders: typeof getPendingOrders;
|
|
1785
|
+
getCompletedOrRefundedOrders: typeof getCompletedOrRefundedOrders;
|
|
1786
|
+
completeProductGrant: typeof completeProductGrant;
|
|
1649
1787
|
};
|
|
1650
1788
|
|
|
1651
1789
|
interface SaveBase64DataParams {
|
|
@@ -1830,11 +1968,26 @@ interface Spec extends TurboModule {
|
|
|
1830
1968
|
orderId: string;
|
|
1831
1969
|
isProductGranted: boolean;
|
|
1832
1970
|
}) => Promise<void>;
|
|
1971
|
+
getPendingOrders: (params: CompatiblePlaceholderArgument) => Promise<{
|
|
1972
|
+
orderIds: string[];
|
|
1973
|
+
}>;
|
|
1974
|
+
getCompletedOrRefundedOrders: (params: {
|
|
1975
|
+
key?: string | null;
|
|
1976
|
+
}) => Promise<CompletedOrRefundedOrdersResult>;
|
|
1977
|
+
completeProductGrant: (params: {
|
|
1978
|
+
params: {
|
|
1979
|
+
orderId: string;
|
|
1980
|
+
};
|
|
1981
|
+
}) => Promise<boolean>;
|
|
1833
1982
|
getGameCenterGameProfile: (params: CompatiblePlaceholderArgument) => Promise<GameCenterGameProfileResponse>;
|
|
1834
1983
|
submitGameCenterLeaderBoardScore: (params: {
|
|
1835
1984
|
score: string;
|
|
1836
1985
|
}) => Promise<SubmitGameCenterLeaderBoardScoreResponse>;
|
|
1837
1986
|
contactsViral: (params: ContactsViralParams) => () => void;
|
|
1987
|
+
/** 토스인증 */
|
|
1988
|
+
appsInTossSignTossCert: (params: {
|
|
1989
|
+
params: AppsInTossSignTossCertParams;
|
|
1990
|
+
}) => void;
|
|
1838
1991
|
}
|
|
1839
1992
|
declare const AppsInTossModuleInstance: any;
|
|
1840
1993
|
declare const AppsInTossModule: Spec;
|
|
@@ -3248,4 +3401,4 @@ declare const INTERNAL__module: {
|
|
|
3248
3401
|
tossCoreEventLog: typeof tossCoreEventLog;
|
|
3249
3402
|
};
|
|
3250
3403
|
|
|
3251
|
-
export { AppsInTossModule, BedrockCoreModule, BedrockModule, type CheckoutPaymentOptions, type CheckoutPaymentResult, type ContactsViralParams, type EventLogParams, type GameCenterGameProfileResponse, GoogleAdMob, type HapticFeedbackType, IAP, AppsInTossModuleInstance as INTERNAL__AppsInTossModule, INTERNAL__appBridgeHandler, INTERNAL__module, type IapCreateOneTimePurchaseOrderOptions, type IapCreateOneTimePurchaseOrderResult, type IapProductListItem, type LoadAdMobEvent, type LoadAdMobInterstitialAdEvent, type LoadAdMobInterstitialAdOptions, type LoadAdMobOptions, type LoadAdMobParams, type LoadAdMobRewardedAdEvent, type LoadAdMobRewardedAdOptions, type NetworkStatus, type Primitive, type SaveBase64DataParams, type ShowAdMobEvent, type ShowAdMobInterstitialAdEvent, type ShowAdMobInterstitialAdOptions, type ShowAdMobOptions, type ShowAdMobParams, type ShowAdMobRewardedAdEvent, type ShowAdMobRewardedAdOptions, Storage, type SubmitGameCenterLeaderBoardScoreResponse, TossPay, type UpdateLocationEventEmitter, appLogin, appsInTossEvent, closeView, contactsViral, eventLog, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getClipboardText, getCurrentLocation, getDeviceId, getGameCenterGameProfile, getLocale, getNetworkStatus, getOperationalEnvironment, getPlatformOS, getSchemeUri, getTossAppVersion, getTossShareLink, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openURL, processProductGrant, requestOneTimePurchase, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, startUpdateLocation, submitGameCenterLeaderBoardScore };
|
|
3404
|
+
export { AppsInTossModule, type AppsInTossSignTossCertParams, BedrockCoreModule, BedrockModule, type CheckoutPaymentOptions, type CheckoutPaymentResult, type CompletedOrRefundedOrdersResult, type ContactsViralParams, type EventLogParams, type GameCenterGameProfileResponse, GoogleAdMob, type HapticFeedbackType, IAP, AppsInTossModuleInstance as INTERNAL__AppsInTossModule, INTERNAL__appBridgeHandler, INTERNAL__module, type IapCreateOneTimePurchaseOrderOptions, type IapCreateOneTimePurchaseOrderResult, type IapProductListItem, type LoadAdMobEvent, type LoadAdMobInterstitialAdEvent, type LoadAdMobInterstitialAdOptions, type LoadAdMobOptions, type LoadAdMobParams, type LoadAdMobRewardedAdEvent, type LoadAdMobRewardedAdOptions, type NetworkStatus, type Primitive, type SaveBase64DataParams, type ShowAdMobEvent, type ShowAdMobInterstitialAdEvent, type ShowAdMobInterstitialAdOptions, type ShowAdMobOptions, type ShowAdMobParams, type ShowAdMobRewardedAdEvent, type ShowAdMobRewardedAdOptions, Storage, type SubmitGameCenterLeaderBoardScoreResponse, TossPay, type UpdateLocationEventEmitter, appLogin, appsInTossEvent, appsInTossSignTossCert, closeView, contactsViral, eventLog, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getClipboardText, getCurrentLocation, getDeviceId, getGameCenterGameProfile, getLocale, getNetworkStatus, getOperationalEnvironment, getPlatformOS, getSchemeUri, getTossAppVersion, getTossShareLink, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openURL, processProductGrant, requestOneTimePurchase, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, startUpdateLocation, submitGameCenterLeaderBoardScore };
|