@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/index.d.ts
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 };
|
package/dist/index.js
CHANGED
|
@@ -408,16 +408,33 @@ showAdMobRewardedAd.isSupported = createIsSupported();
|
|
|
408
408
|
|
|
409
409
|
// src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts
|
|
410
410
|
import { noop as noop2 } from "es-toolkit";
|
|
411
|
+
|
|
412
|
+
// src/utils/getReferrer.ts
|
|
413
|
+
import { getSchemeUri } from "@granite-js/react-native";
|
|
414
|
+
function getReferrer() {
|
|
415
|
+
try {
|
|
416
|
+
return new URL(getSchemeUri()).searchParams.get("referrer");
|
|
417
|
+
} catch {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts
|
|
411
423
|
function loadAppsInTossAdMob(params) {
|
|
412
424
|
if (!loadAppsInTossAdMob.isSupported()) {
|
|
413
425
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
414
426
|
return noop2;
|
|
415
427
|
}
|
|
416
428
|
const { onEvent, onError, options } = params;
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
429
|
+
const referrer = getReferrer();
|
|
430
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
431
|
+
"loadAppsInTossAdmob",
|
|
432
|
+
{ ...options, referrer },
|
|
433
|
+
{
|
|
434
|
+
onSuccess: (result) => onEvent({ type: "loaded", data: result }),
|
|
435
|
+
onError
|
|
436
|
+
}
|
|
437
|
+
);
|
|
421
438
|
return unregisterCallbacks;
|
|
422
439
|
}
|
|
423
440
|
function showAppsInTossAdMob(params) {
|
|
@@ -426,28 +443,33 @@ function showAppsInTossAdMob(params) {
|
|
|
426
443
|
return noop2;
|
|
427
444
|
}
|
|
428
445
|
const { onEvent, onError, options } = params;
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
},
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
446
|
+
const referrer = getReferrer();
|
|
447
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
448
|
+
"showAppsInTossAdmob",
|
|
449
|
+
{ ...options, referrer },
|
|
450
|
+
{
|
|
451
|
+
onAdClicked: () => {
|
|
452
|
+
onEvent({ type: "clicked" });
|
|
453
|
+
},
|
|
454
|
+
onAdDismissed: () => {
|
|
455
|
+
onEvent({ type: "dismissed" });
|
|
456
|
+
},
|
|
457
|
+
onAdFailedToShow: () => {
|
|
458
|
+
onEvent({ type: "failedToShow" });
|
|
459
|
+
},
|
|
460
|
+
onAdImpression: () => {
|
|
461
|
+
onEvent({ type: "impression" });
|
|
462
|
+
},
|
|
463
|
+
onAdShow: () => {
|
|
464
|
+
onEvent({ type: "show" });
|
|
465
|
+
},
|
|
466
|
+
onUserEarnedReward: (data) => {
|
|
467
|
+
onEvent({ type: "userEarnedReward", data });
|
|
468
|
+
},
|
|
469
|
+
onSuccess: () => onEvent({ type: "requested" }),
|
|
470
|
+
onError
|
|
471
|
+
}
|
|
472
|
+
);
|
|
451
473
|
return unregisterCallbacks;
|
|
452
474
|
}
|
|
453
475
|
var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION2 = "5.227.0";
|
|
@@ -677,7 +699,7 @@ function createOneTimePurchaseOrder(params) {
|
|
|
677
699
|
return noop3;
|
|
678
700
|
}
|
|
679
701
|
const isProcessProductGrantSupported = isMinVersionSupported({
|
|
680
|
-
android: "5.
|
|
702
|
+
android: "5.231.1",
|
|
681
703
|
ios: "5.230.0"
|
|
682
704
|
});
|
|
683
705
|
const { options, onEvent, onError } = params;
|
|
@@ -725,9 +747,42 @@ async function getProductItemList() {
|
|
|
725
747
|
}
|
|
726
748
|
return AppsInTossModule.iapGetProductItemList({});
|
|
727
749
|
}
|
|
750
|
+
async function getPendingOrders() {
|
|
751
|
+
const isSupported = isMinVersionSupported({
|
|
752
|
+
android: "5.231.0",
|
|
753
|
+
ios: "5.231.0"
|
|
754
|
+
});
|
|
755
|
+
if (!isSupported) {
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
return AppsInTossModule.getPendingOrders({});
|
|
759
|
+
}
|
|
760
|
+
async function getCompletedOrRefundedOrders(params) {
|
|
761
|
+
const isSupported = isMinVersionSupported({
|
|
762
|
+
android: "5.231.0",
|
|
763
|
+
ios: "5.231.0"
|
|
764
|
+
});
|
|
765
|
+
if (!isSupported) {
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
return AppsInTossModule.getCompletedOrRefundedOrders(params ?? { key: null });
|
|
769
|
+
}
|
|
770
|
+
async function completeProductGrant(params) {
|
|
771
|
+
const isSupported = isMinVersionSupported({
|
|
772
|
+
android: "5.233.0",
|
|
773
|
+
ios: "5.233.0"
|
|
774
|
+
});
|
|
775
|
+
if (!isSupported) {
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
return AppsInTossModule.completeProductGrant(params);
|
|
779
|
+
}
|
|
728
780
|
var IAP = {
|
|
729
781
|
createOneTimePurchaseOrder,
|
|
730
|
-
getProductItemList
|
|
782
|
+
getProductItemList,
|
|
783
|
+
getPendingOrders,
|
|
784
|
+
getCompletedOrRefundedOrders,
|
|
785
|
+
completeProductGrant
|
|
731
786
|
};
|
|
732
787
|
|
|
733
788
|
// src/AppsInTossModule/native-modules/saveBase64Data.ts
|
|
@@ -843,6 +898,19 @@ function contactsViral(params) {
|
|
|
843
898
|
return unregisterCallbacks;
|
|
844
899
|
}
|
|
845
900
|
|
|
901
|
+
// src/AppsInTossModule/native-modules/appsInTossSignTossCert.ts
|
|
902
|
+
async function appsInTossSignTossCert(params) {
|
|
903
|
+
const isSupported = isMinVersionSupported({
|
|
904
|
+
android: "5.233.0",
|
|
905
|
+
ios: "5.233.0"
|
|
906
|
+
});
|
|
907
|
+
if (!isSupported) {
|
|
908
|
+
console.warn("appsInTossSignTossCert is not supported in this app version");
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
await AppsInTossModule.appsInTossSignTossCert({ params });
|
|
912
|
+
}
|
|
913
|
+
|
|
846
914
|
// src/AppsInTossModule/native-modules/index.ts
|
|
847
915
|
var TossPay = {
|
|
848
916
|
checkoutPayment
|
|
@@ -894,7 +962,7 @@ function replaceUnderbarToHypen(locale) {
|
|
|
894
962
|
}
|
|
895
963
|
|
|
896
964
|
// src/BedrockModule/native-modules/natives/getSchemeUri.ts
|
|
897
|
-
function
|
|
965
|
+
function getSchemeUri2() {
|
|
898
966
|
return BedrockModule.schemeUri;
|
|
899
967
|
}
|
|
900
968
|
|
|
@@ -983,6 +1051,7 @@ export {
|
|
|
983
1051
|
TossPay,
|
|
984
1052
|
appLogin,
|
|
985
1053
|
appsInTossEvent,
|
|
1054
|
+
appsInTossSignTossCert,
|
|
986
1055
|
closeView,
|
|
987
1056
|
contactsViral,
|
|
988
1057
|
eventLog,
|
|
@@ -997,7 +1066,7 @@ export {
|
|
|
997
1066
|
getNetworkStatus,
|
|
998
1067
|
getOperationalEnvironment,
|
|
999
1068
|
getPlatformOS,
|
|
1000
|
-
getSchemeUri,
|
|
1069
|
+
getSchemeUri2 as getSchemeUri,
|
|
1001
1070
|
getTossAppVersion,
|
|
1002
1071
|
getTossShareLink,
|
|
1003
1072
|
iapCreateOneTimePurchaseOrder,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/native-modules",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-dev.
|
|
4
|
+
"version": "0.0.0-dev.1760943445541",
|
|
5
5
|
"description": "Native Modules for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/runtime": "^7",
|
|
33
|
-
"@granite-js/native": "0.1.
|
|
34
|
-
"@granite-js/react-native": "0.1.
|
|
33
|
+
"@granite-js/native": "0.1.28",
|
|
34
|
+
"@granite-js/react-native": "0.1.28",
|
|
35
35
|
"@types/react": "18.3.3",
|
|
36
36
|
"dts-bundle-generator": "^9.5.1",
|
|
37
37
|
"esbuild": "0.25.5",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"vitest": "^3.2.4"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@apps-in-toss/types": "^0.0.0-dev.
|
|
46
|
+
"@apps-in-toss/types": "^0.0.0-dev.1760943445541",
|
|
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": "cf764d154652145c36b92690deab07ecc6eff18d"
|
|
58
58
|
}
|
|
@@ -13,9 +13,10 @@ import type {
|
|
|
13
13
|
SetClipboardTextOptions,
|
|
14
14
|
} from '@apps-in-toss/types';
|
|
15
15
|
import { TurboModuleRegistry, type TurboModule as __TurboModule } from 'react-native';
|
|
16
|
+
import type { AppsInTossSignTossCertParams } from './appsInTossSignTossCert';
|
|
16
17
|
import type { CheckoutPaymentOptions, CheckoutPaymentResult } from './checkoutPayment';
|
|
17
18
|
import type { GameCenterGameProfileResponse } from './getGameCenterGameProfile';
|
|
18
|
-
import { IapCreateOneTimePurchaseOrderResult, IapProductListItem } from './iap';
|
|
19
|
+
import { IapCreateOneTimePurchaseOrderResult, IapProductListItem, CompletedOrRefundedOrdersResult } from './iap';
|
|
19
20
|
import type { SaveBase64DataParams } from './saveBase64Data';
|
|
20
21
|
import type { SubmitGameCenterLeaderBoardScoreResponse } from './submitGameCenterLeaderBoardScore';
|
|
21
22
|
import type { ContactsViralParams } from '../native-event-emitter/contactsViral';
|
|
@@ -72,11 +73,17 @@ interface Spec extends __TurboModule {
|
|
|
72
73
|
fallbacks: { onPurchased: (params: { orderId: string }) => void }
|
|
73
74
|
) => () => void;
|
|
74
75
|
processProductGrant: (params: { orderId: string; isProductGranted: boolean }) => Promise<void>;
|
|
76
|
+
getPendingOrders: (params: CompatiblePlaceholderArgument) => Promise<{ orderIds: string[] }>;
|
|
77
|
+
getCompletedOrRefundedOrders: (params: { key?: string | null }) => Promise<CompletedOrRefundedOrdersResult>;
|
|
78
|
+
completeProductGrant: (params: { params: { orderId: string } }) => Promise<boolean>;
|
|
75
79
|
|
|
76
80
|
getGameCenterGameProfile: (params: CompatiblePlaceholderArgument) => Promise<GameCenterGameProfileResponse>;
|
|
77
81
|
submitGameCenterLeaderBoardScore: (params: { score: string }) => Promise<SubmitGameCenterLeaderBoardScoreResponse>;
|
|
78
82
|
|
|
79
83
|
contactsViral: (params: ContactsViralParams) => () => void;
|
|
84
|
+
|
|
85
|
+
/** 토스인증 */
|
|
86
|
+
appsInTossSignTossCert: (params: { params: AppsInTossSignTossCertParams }) => void;
|
|
80
87
|
}
|
|
81
88
|
|
|
82
89
|
const Module = TurboModuleRegistry.getEnforcing<Spec>('AppsInTossModule');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { noop } from 'es-toolkit';
|
|
2
2
|
import type { AdMobFullScreenEvent, AdMobHandlerParams, AdMobLoadResult, AdUserEarnedReward } from './types';
|
|
3
|
+
import { getReferrer } from '../../../utils/getReferrer';
|
|
3
4
|
import { INTERNAL__appBridgeHandler } from '../../native-event-emitter/internal/appBridge';
|
|
4
5
|
import { getOperationalEnvironment } from '../getOperationalEnvironment';
|
|
5
6
|
import { isMinVersionSupported } from '../isMinVersionSupported';
|
|
@@ -155,11 +156,16 @@ export function loadAppsInTossAdMob(params: LoadAdMobParams) {
|
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
const { onEvent, onError, options } = params;
|
|
159
|
+
const referrer = getReferrer();
|
|
158
160
|
|
|
159
|
-
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
162
|
+
'loadAppsInTossAdmob',
|
|
163
|
+
{ ...options, referrer },
|
|
164
|
+
{
|
|
165
|
+
onSuccess: (result) => onEvent({ type: 'loaded', data: result }),
|
|
166
|
+
onError,
|
|
167
|
+
}
|
|
168
|
+
);
|
|
163
169
|
|
|
164
170
|
return unregisterCallbacks;
|
|
165
171
|
}
|
|
@@ -312,29 +318,34 @@ export function showAppsInTossAdMob(params: ShowAdMobParams) {
|
|
|
312
318
|
}
|
|
313
319
|
|
|
314
320
|
const { onEvent, onError, options } = params;
|
|
321
|
+
const referrer = getReferrer();
|
|
315
322
|
|
|
316
|
-
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
323
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
324
|
+
'showAppsInTossAdmob',
|
|
325
|
+
{ ...options, referrer },
|
|
326
|
+
{
|
|
327
|
+
onAdClicked: () => {
|
|
328
|
+
onEvent({ type: 'clicked' });
|
|
329
|
+
},
|
|
330
|
+
onAdDismissed: () => {
|
|
331
|
+
onEvent({ type: 'dismissed' });
|
|
332
|
+
},
|
|
333
|
+
onAdFailedToShow: () => {
|
|
334
|
+
onEvent({ type: 'failedToShow' });
|
|
335
|
+
},
|
|
336
|
+
onAdImpression: () => {
|
|
337
|
+
onEvent({ type: 'impression' });
|
|
338
|
+
},
|
|
339
|
+
onAdShow: () => {
|
|
340
|
+
onEvent({ type: 'show' });
|
|
341
|
+
},
|
|
342
|
+
onUserEarnedReward: (data: { unitType: string; unitAmount: number }) => {
|
|
343
|
+
onEvent({ type: 'userEarnedReward', data });
|
|
344
|
+
},
|
|
345
|
+
onSuccess: () => onEvent({ type: 'requested' }),
|
|
346
|
+
onError,
|
|
347
|
+
}
|
|
348
|
+
);
|
|
338
349
|
|
|
339
350
|
return unregisterCallbacks;
|
|
340
351
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AppsInTossModule } from './AppsInTossModule';
|
|
2
|
+
import { isMinVersionSupported } from './isMinVersionSupported';
|
|
3
|
+
|
|
4
|
+
export interface AppsInTossSignTossCertParams {
|
|
5
|
+
txId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
* @category 토스인증
|
|
11
|
+
* @name appsInTossSignTossCert
|
|
12
|
+
* @description 토스 인증서를 사용해 서명하는 기능을 제공해요. 이 함수를 사용하면 앱인토스에서 제공하는 인증서를 활용해 서명을 할 수 있어요.
|
|
13
|
+
*
|
|
14
|
+
* @param {AppsInTossSignTossCertParams} params - 서명에 필요한 파라미터를 포함하는 객체예요.
|
|
15
|
+
* @param {string} params.txId - 토스인증서를 사용한 본인확인이나 간편인증, 전자서명에서 사용하는 Transaction Id예요.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { appsInTossSignTossCert } from '@apps-in-toss/framework';
|
|
20
|
+
*
|
|
21
|
+
* // 서명에 필요한 파라미터를 정의해요.
|
|
22
|
+
* const params = {
|
|
23
|
+
* txId: "f2e1a6df..."
|
|
24
|
+
* };
|
|
25
|
+
*
|
|
26
|
+
* appsInTossSignTossCert(params)
|
|
27
|
+
* .then(() => {
|
|
28
|
+
* console.log('서명 작업이 성공적으로 완료되었어요.');
|
|
29
|
+
* })
|
|
30
|
+
* .catch((error) => {
|
|
31
|
+
* console.error('서명 작업 중 에러가 발생했어요:', error);
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
export async function appsInTossSignTossCert(params: AppsInTossSignTossCertParams) {
|
|
37
|
+
const isSupported = isMinVersionSupported({
|
|
38
|
+
android: '5.233.0',
|
|
39
|
+
ios: '5.233.0',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (!isSupported) {
|
|
43
|
+
console.warn('appsInTossSignTossCert is not supported in this app version');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
await AppsInTossModule.appsInTossSignTossCert({ params });
|
|
48
|
+
}
|