@apps-in-toss/native-modules 2.9.3 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -151,6 +151,10 @@
151
151
  "identifier": "requestReview",
152
152
  "dts": "/**\n * @public\n * @category 리뷰\n * @name requestReview\n * @description\n * 유저에게 미니앱 리뷰를 요청해요.\n *\n * @property {() => boolean} isSupported 현재 앱 버전이 이 기능을 지원하는지 확인하는 함수예요.\n */\nexport declare function requestReview(): Promise<void>;\nexport declare namespace requestReview {\n\tvar isSupported: () => boolean;\n}\n\nexport {};\n"
153
153
  },
154
+ {
155
+ "identifier": "getDeclaredAgeRange",
156
+ "dts": "export interface DeclaredAgeRange {\n\tstatus: \"SHARING\" | \"DECLINED_SHARING\" | \"UNSUPPORTED_OS\" | \"NOT_AVAILABLE\" | \"INVALID_REQUEST\" | \"FAILED\";\n\tlowerBound?: number;\n\tupperBound?: number;\n\tageRangeDeclaration?: string;\n\tactiveParentalControls: string[];\n\tisEligibleForAgeFeatures?: boolean;\n\terrorCode?: string;\n}\nexport declare function getDeclaredAgeRange(params: {\n\tageGates: number[];\n}): Promise<DeclaredAgeRange>;\nexport declare namespace getDeclaredAgeRange {\n\tvar isSupported: () => boolean;\n}\n\nexport {};\n"
157
+ },
154
158
  {
155
159
  "identifier": "getLocale",
156
160
  "dts": "/**\n * @public\n * @category 언어\n * @kind function\n * @name getLocale\n * @description\n * 사용자의 로케일(locale) 정보를 반환해요. 네이티브 모듈에서 로케일 정보를 가져올 수 없을 때는 기본값으로 'ko-KR'을 반환합니다. 앱의 현지화 및 언어 설정과 관련된 기능을 구현할 때 사용하세요.\n *\n * @returns {string} 사용자의 로케일 정보를 반환해요.\n *\n * @example\n * ### 현재 사용자의 로케일 정보 가져오기\n *\n * ```tsx\n * import { getLocale } from '@apps-in-toss/native-modules';\n * import { Text } from 'react-native';\n *\n * function MyPage() {\n * const locale = getLocale();\n *\n * return (\n * <Text>사용자의 로케일 정보: {locale}</Text>\n * )\n * }\n *\n * ```\n */\nexport declare function getLocale(): string;\n\nexport {};\n"
package/dist/index.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  getClipboardText: () => getClipboardText,
43
43
  getConsentedUserData: () => getConsentedUserData,
44
44
  getCurrentLocation: () => getCurrentLocation,
45
+ getDeclaredAgeRange: () => getDeclaredAgeRange,
45
46
  getDeviceId: () => getDeviceId,
46
47
  getGameCenterGameProfile: () => getGameCenterGameProfile,
47
48
  getGroupId: () => getGroupId,
@@ -1186,6 +1187,22 @@ function requestNotificationAgreement(params) {
1186
1187
  });
1187
1188
  }
1188
1189
 
1190
+ // src/MiniAppModule/native-modules/getDeclaredAgeRange.ts
1191
+ var import_react_native8 = require("react-native");
1192
+ var isSupportedPlatform = import_react_native8.Platform.OS === "ios" && parseInt(import_react_native8.Platform.Version, 10) >= 26;
1193
+ var MIN_IOS_TOSSAPP_VERSION = "5.266.0";
1194
+ var isSupportedTossApp = isMinVersionSupported({ ios: MIN_IOS_TOSSAPP_VERSION, android: "never" });
1195
+ async function getDeclaredAgeRange(params) {
1196
+ if (!isSupportedPlatform) {
1197
+ throw new Error("getDeclaredAgeRange\uB294 iOS 26 \uC774\uC0C1\uC5D0\uC11C\uB9CC \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4.");
1198
+ }
1199
+ if (!isSupportedTossApp) {
1200
+ throw new Error(`getDeclaredAgeRange\uB294 \uD1A0\uC2A4\uC571 ${MIN_IOS_TOSSAPP_VERSION} \uBC84\uC804 \uC774\uC0C1\uC5D0\uC11C\uB9CC \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4.`);
1201
+ }
1202
+ return await MiniAppModule.postMessage("getDeclaredAgeRange", params, {});
1203
+ }
1204
+ getDeclaredAgeRange.isSupported = () => isSupportedPlatform && isSupportedTossApp;
1205
+
1189
1206
  // src/MiniAppModule/native-modules/index.ts
1190
1207
  var TossPay = {
1191
1208
  checkoutPayment,
@@ -1221,10 +1238,10 @@ async function closeView() {
1221
1238
  }
1222
1239
 
1223
1240
  // src/BedrockModule/native-modules/natives/getLocale.ts
1224
- var import_react_native8 = require("react-native");
1241
+ var import_react_native9 = require("react-native");
1225
1242
  function getLocale() {
1226
1243
  const locale = CommonModule2?.getConstants().locale ?? "ko-KR";
1227
- if (import_react_native8.Platform.OS === "android") {
1244
+ if (import_react_native9.Platform.OS === "android") {
1228
1245
  return replaceUnderbarToHypen(locale);
1229
1246
  }
1230
1247
  return locale;
@@ -1272,15 +1289,15 @@ async function setIosSwipeGestureEnabled(options) {
1272
1289
  }
1273
1290
 
1274
1291
  // src/BedrockModule/native-modules/natives/openURL.ts
1275
- var import_react_native9 = require("react-native");
1292
+ var import_react_native10 = require("react-native");
1276
1293
  function openURL2(url) {
1277
- return import_react_native9.Linking.openURL(url);
1294
+ return import_react_native10.Linking.openURL(url);
1278
1295
  }
1279
1296
 
1280
1297
  // src/BedrockModule/native-modules/natives/getPlatformOS.ts
1281
- var import_react_native10 = require("react-native");
1298
+ var import_react_native11 = require("react-native");
1282
1299
  function getPlatformOS() {
1283
- return import_react_native10.Platform.OS;
1300
+ return import_react_native11.Platform.OS;
1284
1301
  }
1285
1302
 
1286
1303
  // src/MiniAppModule/native-modules/tossCore.ts
@@ -1325,6 +1342,7 @@ var INTERNAL__module = {
1325
1342
  getClipboardText,
1326
1343
  getConsentedUserData,
1327
1344
  getCurrentLocation,
1345
+ getDeclaredAgeRange,
1328
1346
  getDeviceId,
1329
1347
  getGameCenterGameProfile,
1330
1348
  getGroupId,
package/dist/index.d.cts CHANGED
@@ -3213,6 +3213,22 @@ declare namespace requestReview {
3213
3213
  var isSupported: () => boolean;
3214
3214
  }
3215
3215
 
3216
+ interface DeclaredAgeRange {
3217
+ status: 'SHARING' | 'DECLINED_SHARING' | 'UNSUPPORTED_OS' | 'NOT_AVAILABLE' | 'INVALID_REQUEST' | 'FAILED';
3218
+ lowerBound?: number;
3219
+ upperBound?: number;
3220
+ ageRangeDeclaration?: string;
3221
+ activeParentalControls: string[];
3222
+ isEligibleForAgeFeatures?: boolean;
3223
+ errorCode?: string;
3224
+ }
3225
+ declare function getDeclaredAgeRange(params: {
3226
+ ageGates: number[];
3227
+ }): Promise<DeclaredAgeRange>;
3228
+ declare namespace getDeclaredAgeRange {
3229
+ var isSupported: () => boolean;
3230
+ }
3231
+
3216
3232
  /**
3217
3233
  * @public
3218
3234
  * @category 토스페이
@@ -3672,4 +3688,4 @@ declare const INTERNAL__module: {
3672
3688
  tossCoreEventLog: typeof tossCoreEventLog;
3673
3689
  };
3674
3690
 
3675
- export { type AlbumItemResponse, type AlbumItemType, type AppsInTossSignTossCertParams, type CheckoutPaymentOptions, type CheckoutPaymentResult, type CompletedOrRefundedOrdersResult, type ConsentedUserData, type ConsumableProductListItem, type ContactsViralParams, type CreateSubscriptionPurchaseOrderOptions, type EventLogParams, type FetchAlbumItemsOptions, type GameCenterGameProfileResponse, type GetAnonymousKeyResponse, type GetAnonymousKeySuccessResponse, type GetConsentedUserDataErrorCode, type GetConsentedUserDataOptions, type GetUserKeyForGameErrorResponse, type GetUserKeyForGameResponse, type GetUserKeyForGameSuccessResponse, GoogleAdMob, type GrantPromotionRewardErrorResponse, type GrantPromotionRewardErrorResult, type GrantPromotionRewardForGameErrorResponse, type GrantPromotionRewardForGameErrorResult, type GrantPromotionRewardForGameResponse, type GrantPromotionRewardForGameSuccessResponse, type GrantPromotionRewardResponse, type GrantPromotionRewardSuccessResponse, type HapticFeedbackType, IAP, INTERNAL__appBridgeHandler, INTERNAL__module, type IapCreateOneTimePurchaseOrderOptions, type IapCreateOneTimePurchaseOrderResult, type IapCreateSubscriptionPurchaseOrderResult, type IapProductListItem, type IapSubscriptionInfoResult, type NetworkStatus, type NonConsumableProductListItem, type NotificationAgreementResult, type OpenPDFViewerParams, type OpenPDFViewerResult, type Primitive, type RequestNotificationAgreementOptions, type RequestTossPayPaysBillingOptions, type RequestTossPayPaysBillingResult, type SaveBase64DataParams, Storage, type SubmitGameCenterLeaderBoardScoreResponse, type SubscriptionProductListItem, TossPay, type UpdateLocationEventEmitter, appLogin, appsInTossEvent, appsInTossSignTossCert, checkoutPayment, closeView, contactsViral, eventLog, fetchAlbumItems, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getClipboardText, getConsentedUserData, getCurrentLocation, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPlatformOS, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, grantPromotionReward, grantPromotionRewardForGame, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPDFViewer, openURL, processProductGrant, requestNotificationAgreement, requestOneTimePurchase, requestReview, requestSubscriptionPurchase, requestTossPayPaysBilling, safePostMessage, safeSyncPostMessage, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, shareWithScheme, startUpdateLocation, submitGameCenterLeaderBoardScore };
3691
+ export { type AlbumItemResponse, type AlbumItemType, type AppsInTossSignTossCertParams, type CheckoutPaymentOptions, type CheckoutPaymentResult, type CompletedOrRefundedOrdersResult, type ConsentedUserData, type ConsumableProductListItem, type ContactsViralParams, type CreateSubscriptionPurchaseOrderOptions, type DeclaredAgeRange, type EventLogParams, type FetchAlbumItemsOptions, type GameCenterGameProfileResponse, type GetAnonymousKeyResponse, type GetAnonymousKeySuccessResponse, type GetConsentedUserDataErrorCode, type GetConsentedUserDataOptions, type GetUserKeyForGameErrorResponse, type GetUserKeyForGameResponse, type GetUserKeyForGameSuccessResponse, GoogleAdMob, type GrantPromotionRewardErrorResponse, type GrantPromotionRewardErrorResult, type GrantPromotionRewardForGameErrorResponse, type GrantPromotionRewardForGameErrorResult, type GrantPromotionRewardForGameResponse, type GrantPromotionRewardForGameSuccessResponse, type GrantPromotionRewardResponse, type GrantPromotionRewardSuccessResponse, type HapticFeedbackType, IAP, INTERNAL__appBridgeHandler, INTERNAL__module, type IapCreateOneTimePurchaseOrderOptions, type IapCreateOneTimePurchaseOrderResult, type IapCreateSubscriptionPurchaseOrderResult, type IapProductListItem, type IapSubscriptionInfoResult, type NetworkStatus, type NonConsumableProductListItem, type NotificationAgreementResult, type OpenPDFViewerParams, type OpenPDFViewerResult, type Primitive, type RequestNotificationAgreementOptions, type RequestTossPayPaysBillingOptions, type RequestTossPayPaysBillingResult, type SaveBase64DataParams, Storage, type SubmitGameCenterLeaderBoardScoreResponse, type SubscriptionProductListItem, TossPay, type UpdateLocationEventEmitter, appLogin, appsInTossEvent, appsInTossSignTossCert, checkoutPayment, closeView, contactsViral, eventLog, fetchAlbumItems, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getClipboardText, getConsentedUserData, getCurrentLocation, getDeclaredAgeRange, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPlatformOS, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, grantPromotionReward, grantPromotionRewardForGame, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPDFViewer, openURL, processProductGrant, requestNotificationAgreement, requestOneTimePurchase, requestReview, requestSubscriptionPurchase, requestTossPayPaysBilling, safePostMessage, safeSyncPostMessage, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, shareWithScheme, startUpdateLocation, submitGameCenterLeaderBoardScore };
package/dist/index.d.ts CHANGED
@@ -3213,6 +3213,22 @@ declare namespace requestReview {
3213
3213
  var isSupported: () => boolean;
3214
3214
  }
3215
3215
 
3216
+ interface DeclaredAgeRange {
3217
+ status: 'SHARING' | 'DECLINED_SHARING' | 'UNSUPPORTED_OS' | 'NOT_AVAILABLE' | 'INVALID_REQUEST' | 'FAILED';
3218
+ lowerBound?: number;
3219
+ upperBound?: number;
3220
+ ageRangeDeclaration?: string;
3221
+ activeParentalControls: string[];
3222
+ isEligibleForAgeFeatures?: boolean;
3223
+ errorCode?: string;
3224
+ }
3225
+ declare function getDeclaredAgeRange(params: {
3226
+ ageGates: number[];
3227
+ }): Promise<DeclaredAgeRange>;
3228
+ declare namespace getDeclaredAgeRange {
3229
+ var isSupported: () => boolean;
3230
+ }
3231
+
3216
3232
  /**
3217
3233
  * @public
3218
3234
  * @category 토스페이
@@ -3672,4 +3688,4 @@ declare const INTERNAL__module: {
3672
3688
  tossCoreEventLog: typeof tossCoreEventLog;
3673
3689
  };
3674
3690
 
3675
- export { type AlbumItemResponse, type AlbumItemType, type AppsInTossSignTossCertParams, type CheckoutPaymentOptions, type CheckoutPaymentResult, type CompletedOrRefundedOrdersResult, type ConsentedUserData, type ConsumableProductListItem, type ContactsViralParams, type CreateSubscriptionPurchaseOrderOptions, type EventLogParams, type FetchAlbumItemsOptions, type GameCenterGameProfileResponse, type GetAnonymousKeyResponse, type GetAnonymousKeySuccessResponse, type GetConsentedUserDataErrorCode, type GetConsentedUserDataOptions, type GetUserKeyForGameErrorResponse, type GetUserKeyForGameResponse, type GetUserKeyForGameSuccessResponse, GoogleAdMob, type GrantPromotionRewardErrorResponse, type GrantPromotionRewardErrorResult, type GrantPromotionRewardForGameErrorResponse, type GrantPromotionRewardForGameErrorResult, type GrantPromotionRewardForGameResponse, type GrantPromotionRewardForGameSuccessResponse, type GrantPromotionRewardResponse, type GrantPromotionRewardSuccessResponse, type HapticFeedbackType, IAP, INTERNAL__appBridgeHandler, INTERNAL__module, type IapCreateOneTimePurchaseOrderOptions, type IapCreateOneTimePurchaseOrderResult, type IapCreateSubscriptionPurchaseOrderResult, type IapProductListItem, type IapSubscriptionInfoResult, type NetworkStatus, type NonConsumableProductListItem, type NotificationAgreementResult, type OpenPDFViewerParams, type OpenPDFViewerResult, type Primitive, type RequestNotificationAgreementOptions, type RequestTossPayPaysBillingOptions, type RequestTossPayPaysBillingResult, type SaveBase64DataParams, Storage, type SubmitGameCenterLeaderBoardScoreResponse, type SubscriptionProductListItem, TossPay, type UpdateLocationEventEmitter, appLogin, appsInTossEvent, appsInTossSignTossCert, checkoutPayment, closeView, contactsViral, eventLog, fetchAlbumItems, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getClipboardText, getConsentedUserData, getCurrentLocation, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPlatformOS, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, grantPromotionReward, grantPromotionRewardForGame, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPDFViewer, openURL, processProductGrant, requestNotificationAgreement, requestOneTimePurchase, requestReview, requestSubscriptionPurchase, requestTossPayPaysBilling, safePostMessage, safeSyncPostMessage, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, shareWithScheme, startUpdateLocation, submitGameCenterLeaderBoardScore };
3691
+ export { type AlbumItemResponse, type AlbumItemType, type AppsInTossSignTossCertParams, type CheckoutPaymentOptions, type CheckoutPaymentResult, type CompletedOrRefundedOrdersResult, type ConsentedUserData, type ConsumableProductListItem, type ContactsViralParams, type CreateSubscriptionPurchaseOrderOptions, type DeclaredAgeRange, type EventLogParams, type FetchAlbumItemsOptions, type GameCenterGameProfileResponse, type GetAnonymousKeyResponse, type GetAnonymousKeySuccessResponse, type GetConsentedUserDataErrorCode, type GetConsentedUserDataOptions, type GetUserKeyForGameErrorResponse, type GetUserKeyForGameResponse, type GetUserKeyForGameSuccessResponse, GoogleAdMob, type GrantPromotionRewardErrorResponse, type GrantPromotionRewardErrorResult, type GrantPromotionRewardForGameErrorResponse, type GrantPromotionRewardForGameErrorResult, type GrantPromotionRewardForGameResponse, type GrantPromotionRewardForGameSuccessResponse, type GrantPromotionRewardResponse, type GrantPromotionRewardSuccessResponse, type HapticFeedbackType, IAP, INTERNAL__appBridgeHandler, INTERNAL__module, type IapCreateOneTimePurchaseOrderOptions, type IapCreateOneTimePurchaseOrderResult, type IapCreateSubscriptionPurchaseOrderResult, type IapProductListItem, type IapSubscriptionInfoResult, type NetworkStatus, type NonConsumableProductListItem, type NotificationAgreementResult, type OpenPDFViewerParams, type OpenPDFViewerResult, type Primitive, type RequestNotificationAgreementOptions, type RequestTossPayPaysBillingOptions, type RequestTossPayPaysBillingResult, type SaveBase64DataParams, Storage, type SubmitGameCenterLeaderBoardScoreResponse, type SubscriptionProductListItem, TossPay, type UpdateLocationEventEmitter, appLogin, appsInTossEvent, appsInTossSignTossCert, checkoutPayment, closeView, contactsViral, eventLog, fetchAlbumItems, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getClipboardText, getConsentedUserData, getCurrentLocation, getDeclaredAgeRange, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPlatformOS, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, grantPromotionReward, grantPromotionRewardForGame, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPDFViewer, openURL, processProductGrant, requestNotificationAgreement, requestOneTimePurchase, requestReview, requestSubscriptionPurchase, requestTossPayPaysBilling, safePostMessage, safeSyncPostMessage, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, shareWithScheme, startUpdateLocation, submitGameCenterLeaderBoardScore };
package/dist/index.js CHANGED
@@ -1099,6 +1099,22 @@ function requestNotificationAgreement(params) {
1099
1099
  });
1100
1100
  }
1101
1101
 
1102
+ // src/MiniAppModule/native-modules/getDeclaredAgeRange.ts
1103
+ import { Platform as Platform2 } from "react-native";
1104
+ var isSupportedPlatform = Platform2.OS === "ios" && parseInt(Platform2.Version, 10) >= 26;
1105
+ var MIN_IOS_TOSSAPP_VERSION = "5.266.0";
1106
+ var isSupportedTossApp = isMinVersionSupported({ ios: MIN_IOS_TOSSAPP_VERSION, android: "never" });
1107
+ async function getDeclaredAgeRange(params) {
1108
+ if (!isSupportedPlatform) {
1109
+ throw new Error("getDeclaredAgeRange\uB294 iOS 26 \uC774\uC0C1\uC5D0\uC11C\uB9CC \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4.");
1110
+ }
1111
+ if (!isSupportedTossApp) {
1112
+ throw new Error(`getDeclaredAgeRange\uB294 \uD1A0\uC2A4\uC571 ${MIN_IOS_TOSSAPP_VERSION} \uBC84\uC804 \uC774\uC0C1\uC5D0\uC11C\uB9CC \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4.`);
1113
+ }
1114
+ return await MiniAppModule.postMessage("getDeclaredAgeRange", params, {});
1115
+ }
1116
+ getDeclaredAgeRange.isSupported = () => isSupportedPlatform && isSupportedTossApp;
1117
+
1102
1118
  // src/MiniAppModule/native-modules/index.ts
1103
1119
  var TossPay = {
1104
1120
  checkoutPayment,
@@ -1134,10 +1150,10 @@ async function closeView() {
1134
1150
  }
1135
1151
 
1136
1152
  // src/BedrockModule/native-modules/natives/getLocale.ts
1137
- import { Platform as Platform2 } from "react-native";
1153
+ import { Platform as Platform3 } from "react-native";
1138
1154
  function getLocale() {
1139
1155
  const locale = CommonModule2?.getConstants().locale ?? "ko-KR";
1140
- if (Platform2.OS === "android") {
1156
+ if (Platform3.OS === "android") {
1141
1157
  return replaceUnderbarToHypen(locale);
1142
1158
  }
1143
1159
  return locale;
@@ -1191,9 +1207,9 @@ function openURL2(url) {
1191
1207
  }
1192
1208
 
1193
1209
  // src/BedrockModule/native-modules/natives/getPlatformOS.ts
1194
- import { Platform as Platform3 } from "react-native";
1210
+ import { Platform as Platform4 } from "react-native";
1195
1211
  function getPlatformOS() {
1196
- return Platform3.OS;
1212
+ return Platform4.OS;
1197
1213
  }
1198
1214
 
1199
1215
  // src/MiniAppModule/native-modules/tossCore.ts
@@ -1237,6 +1253,7 @@ export {
1237
1253
  getClipboardText,
1238
1254
  getConsentedUserData,
1239
1255
  getCurrentLocation,
1256
+ getDeclaredAgeRange,
1240
1257
  getDeviceId,
1241
1258
  getGameCenterGameProfile,
1242
1259
  getGroupId,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/native-modules",
3
3
  "type": "module",
4
- "version": "2.9.3",
4
+ "version": "2.10.1",
5
5
  "description": "Native Modules for Apps In Toss",
6
6
  "scripts": {
7
7
  "typecheck": "tsc --noEmit",
@@ -42,7 +42,7 @@
42
42
  "vitest": "^3.2.4"
43
43
  },
44
44
  "dependencies": {
45
- "@apps-in-toss/types": "2.9.3",
45
+ "@apps-in-toss/types": "2.10.1",
46
46
  "brick-module": "0.5.2",
47
47
  "es-toolkit": "^1.39.3"
48
48
  },
@@ -0,0 +1,30 @@
1
+ import { Platform } from 'react-native';
2
+ import { isMinVersionSupported } from './isMinVersionSupported';
3
+ import { MiniAppModule } from '../../natives';
4
+
5
+ export interface DeclaredAgeRange {
6
+ status: 'SHARING' | 'DECLINED_SHARING' | 'UNSUPPORTED_OS' | 'NOT_AVAILABLE' | 'INVALID_REQUEST' | 'FAILED';
7
+ lowerBound?: number;
8
+ upperBound?: number;
9
+ ageRangeDeclaration?: string;
10
+ activeParentalControls: string[];
11
+ isEligibleForAgeFeatures?: boolean;
12
+ errorCode?: string;
13
+ }
14
+
15
+ const isSupportedPlatform = Platform.OS === 'ios' && parseInt(Platform.Version, 10) >= 26;
16
+ const MIN_IOS_TOSSAPP_VERSION = '5.266.0';
17
+ const isSupportedTossApp = isMinVersionSupported({ ios: MIN_IOS_TOSSAPP_VERSION, android: 'never' });
18
+
19
+ export async function getDeclaredAgeRange(params: { ageGates: number[] }): Promise<DeclaredAgeRange> {
20
+ if (!isSupportedPlatform) {
21
+ throw new Error('getDeclaredAgeRange는 iOS 26 이상에서만 사용 가능합니다.');
22
+ }
23
+
24
+ if (!isSupportedTossApp) {
25
+ throw new Error(`getDeclaredAgeRange는 토스앱 ${MIN_IOS_TOSSAPP_VERSION} 버전 이상에서만 사용 가능합니다.`);
26
+ }
27
+
28
+ return await MiniAppModule.postMessage('getDeclaredAgeRange', params, {});
29
+ }
30
+ getDeclaredAgeRange.isSupported = () => isSupportedPlatform && isSupportedTossApp;
@@ -57,6 +57,7 @@ export * from './getServerTime';
57
57
  export * from './getConsentedUserData';
58
58
  export * from './requestReview';
59
59
  export * from './requestNotificationAgreement';
60
+ export * from './getDeclaredAgeRange';
60
61
 
61
62
  export type {
62
63
  CheckoutPaymentOptions,
@@ -39,3 +39,4 @@ export * from './MiniAppModule/native-modules/getIsTossLoginIntegratedService';
39
39
  export * from './MiniAppModule/native-modules/getServerTime';
40
40
  export * from './MiniAppModule/native-modules/getConsentedUserData';
41
41
  export * from './MiniAppModule/native-modules/requestReview';
42
+ export * from './MiniAppModule/native-modules/getDeclaredAgeRange';