@apps-in-toss/native-modules 2.4.5 → 2.4.7

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.
@@ -133,7 +133,7 @@
133
133
  },
134
134
  {
135
135
  "identifier": "requestReview",
136
- "dts": "/**\n * @public\n * @category 리뷰\n * @name getServerTime\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"
136
+ "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"
137
137
  },
138
138
  {
139
139
  "identifier": "getLocale",
package/dist/index.cjs CHANGED
@@ -1074,7 +1074,7 @@ async function requestReview() {
1074
1074
  }
1075
1075
  return safePostMessage("requestMiniAppReview", { title: brandDisplayName });
1076
1076
  }
1077
- requestReview.isSupported = () => MiniAppModule.getConstants().operationalEnvironment === "toss" && isMinVersionSupported(MIN_VERSION);
1077
+ requestReview.isSupported = () => isMinVersionSupported(MIN_VERSION);
1078
1078
 
1079
1079
  // src/MiniAppModule/native-modules/index.ts
1080
1080
  var TossPay = {
package/dist/index.d.cts CHANGED
@@ -112,62 +112,6 @@ declare function checkoutPayment(options: {
112
112
  params: CheckoutPaymentOptions;
113
113
  }): Promise<CheckoutPaymentResult>;
114
114
 
115
- /**
116
- * @category 게임센터
117
- * @name GameCenterGameProfileResponse
118
- * @description 토스게임센터 프로필을 가져온 결과 타입이에요.
119
- * 앱에 프로필이 없는 경우, `statusCode`가 `'PROFILE_NOT_FOUND'`이고 다른 정보는 없어요.
120
- * 프로필이 있는 경우 `statusCode`가 `'SUCCESS'`이고, 닉네임과 프로필 이미지 주소가 함께 제공돼요.
121
- * @property {string} statusCode 프로필 조회 결과 상태예요. `'SUCCESS'` 또는 `'PROFILE_NOT_FOUND'` 중 하나예요.
122
- * @property {string} [nickname] 프로필 닉네임이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
123
- * @property {string} [profileImageUri] 프로필 이미지 URL이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
124
- */
125
- type GameCenterGameProfileResponse = {
126
- statusCode: 'PROFILE_NOT_FOUND';
127
- } | {
128
- statusCode: 'SUCCESS';
129
- nickname: string;
130
- profileImageUri: string;
131
- };
132
- /**
133
- * @category 게임센터
134
- * @name getGameCenterGameProfile
135
- * @description 토스게임센터 프로필 정보를 가져와요.
136
- * 사용자가 프로필을 만들지 않았다면 `statusCode`가 `'PROFILE_NOT_FOUND'`인 응답이 반환돼요.
137
- * 앱 버전이 최소 지원 버전(안드로이드 5.221.0, iOS 5.221.0)보다 낮으면 `undefined`를 반환해요.
138
- * @returns {Promise<GameCenterGameProfileResponse | undefined>} 프로필 정보 또는 `undefined`를 반환해요.
139
- *
140
- * @example
141
- * ### 게임센터 프로필 가져오기
142
- * ```tsx
143
- * import { getGameCenterGameProfile } from './getGameCenterGameProfile';
144
- * import { useState } from 'react';
145
- * import { View, Button } from 'react-native';
146
- *
147
- * function GameProfile() {
148
- * const [profile, setProfile] = useState<GameCenterGameProfileResponse | null>(null);
149
- *
150
- * const handlePress = async () => {
151
- * try {
152
- * const result = await getGameCenterGameProfile();
153
- * if (result) {
154
- * setProfile(result);
155
- * }
156
- * } catch (error) {
157
- * console.error('게임센터 프로필 가져오기에 실패했어요.', error);
158
- * }
159
- * };
160
- *
161
- * return (
162
- * <View>
163
- * <Button title="게임센터 프로필 가져오기" onPress={handlePress} />
164
- * </View>
165
- * );
166
- * }
167
- * ```
168
- */
169
- declare function getGameCenterGameProfile(): Promise<GameCenterGameProfileResponse | undefined>;
170
-
171
115
  interface GetAnonymousKeySuccessResponse {
172
116
  hash: string;
173
117
  type: 'HASH';
@@ -249,6 +193,62 @@ type GetAnonymousKeyResponse = GetAnonymousKeySuccessResponse;
249
193
  */
250
194
  declare function getAnonymousKey(): Promise<GetAnonymousKeySuccessResponse | 'ERROR' | undefined>;
251
195
 
196
+ /**
197
+ * @category 게임센터
198
+ * @name GameCenterGameProfileResponse
199
+ * @description 토스게임센터 프로필을 가져온 결과 타입이에요.
200
+ * 앱에 프로필이 없는 경우, `statusCode`가 `'PROFILE_NOT_FOUND'`이고 다른 정보는 없어요.
201
+ * 프로필이 있는 경우 `statusCode`가 `'SUCCESS'`이고, 닉네임과 프로필 이미지 주소가 함께 제공돼요.
202
+ * @property {string} statusCode 프로필 조회 결과 상태예요. `'SUCCESS'` 또는 `'PROFILE_NOT_FOUND'` 중 하나예요.
203
+ * @property {string} [nickname] 프로필 닉네임이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
204
+ * @property {string} [profileImageUri] 프로필 이미지 URL이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
205
+ */
206
+ type GameCenterGameProfileResponse = {
207
+ statusCode: 'PROFILE_NOT_FOUND';
208
+ } | {
209
+ statusCode: 'SUCCESS';
210
+ nickname: string;
211
+ profileImageUri: string;
212
+ };
213
+ /**
214
+ * @category 게임센터
215
+ * @name getGameCenterGameProfile
216
+ * @description 토스게임센터 프로필 정보를 가져와요.
217
+ * 사용자가 프로필을 만들지 않았다면 `statusCode`가 `'PROFILE_NOT_FOUND'`인 응답이 반환돼요.
218
+ * 앱 버전이 최소 지원 버전(안드로이드 5.221.0, iOS 5.221.0)보다 낮으면 `undefined`를 반환해요.
219
+ * @returns {Promise<GameCenterGameProfileResponse | undefined>} 프로필 정보 또는 `undefined`를 반환해요.
220
+ *
221
+ * @example
222
+ * ### 게임센터 프로필 가져오기
223
+ * ```tsx
224
+ * import { getGameCenterGameProfile } from './getGameCenterGameProfile';
225
+ * import { useState } from 'react';
226
+ * import { View, Button } from 'react-native';
227
+ *
228
+ * function GameProfile() {
229
+ * const [profile, setProfile] = useState<GameCenterGameProfileResponse | null>(null);
230
+ *
231
+ * const handlePress = async () => {
232
+ * try {
233
+ * const result = await getGameCenterGameProfile();
234
+ * if (result) {
235
+ * setProfile(result);
236
+ * }
237
+ * } catch (error) {
238
+ * console.error('게임센터 프로필 가져오기에 실패했어요.', error);
239
+ * }
240
+ * };
241
+ *
242
+ * return (
243
+ * <View>
244
+ * <Button title="게임센터 프로필 가져오기" onPress={handlePress} />
245
+ * </View>
246
+ * );
247
+ * }
248
+ * ```
249
+ */
250
+ declare function getGameCenterGameProfile(): Promise<GameCenterGameProfileResponse | undefined>;
251
+
252
252
  /**
253
253
  * @deprecated 이 타입은 더 이상 사용되지 않습니다. 대신 {@link GetAnonymousKeySuccessResponse}를 사용해주세요.
254
254
  */
@@ -2847,7 +2847,7 @@ declare namespace getServerTime {
2847
2847
  /**
2848
2848
  * @public
2849
2849
  * @category 리뷰
2850
- * @name getServerTime
2850
+ * @name requestReview
2851
2851
  * @description
2852
2852
  * 유저에게 미니앱 리뷰를 요청해요.
2853
2853
  *
package/dist/index.d.ts CHANGED
@@ -112,62 +112,6 @@ declare function checkoutPayment(options: {
112
112
  params: CheckoutPaymentOptions;
113
113
  }): Promise<CheckoutPaymentResult>;
114
114
 
115
- /**
116
- * @category 게임센터
117
- * @name GameCenterGameProfileResponse
118
- * @description 토스게임센터 프로필을 가져온 결과 타입이에요.
119
- * 앱에 프로필이 없는 경우, `statusCode`가 `'PROFILE_NOT_FOUND'`이고 다른 정보는 없어요.
120
- * 프로필이 있는 경우 `statusCode`가 `'SUCCESS'`이고, 닉네임과 프로필 이미지 주소가 함께 제공돼요.
121
- * @property {string} statusCode 프로필 조회 결과 상태예요. `'SUCCESS'` 또는 `'PROFILE_NOT_FOUND'` 중 하나예요.
122
- * @property {string} [nickname] 프로필 닉네임이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
123
- * @property {string} [profileImageUri] 프로필 이미지 URL이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
124
- */
125
- type GameCenterGameProfileResponse = {
126
- statusCode: 'PROFILE_NOT_FOUND';
127
- } | {
128
- statusCode: 'SUCCESS';
129
- nickname: string;
130
- profileImageUri: string;
131
- };
132
- /**
133
- * @category 게임센터
134
- * @name getGameCenterGameProfile
135
- * @description 토스게임센터 프로필 정보를 가져와요.
136
- * 사용자가 프로필을 만들지 않았다면 `statusCode`가 `'PROFILE_NOT_FOUND'`인 응답이 반환돼요.
137
- * 앱 버전이 최소 지원 버전(안드로이드 5.221.0, iOS 5.221.0)보다 낮으면 `undefined`를 반환해요.
138
- * @returns {Promise<GameCenterGameProfileResponse | undefined>} 프로필 정보 또는 `undefined`를 반환해요.
139
- *
140
- * @example
141
- * ### 게임센터 프로필 가져오기
142
- * ```tsx
143
- * import { getGameCenterGameProfile } from './getGameCenterGameProfile';
144
- * import { useState } from 'react';
145
- * import { View, Button } from 'react-native';
146
- *
147
- * function GameProfile() {
148
- * const [profile, setProfile] = useState<GameCenterGameProfileResponse | null>(null);
149
- *
150
- * const handlePress = async () => {
151
- * try {
152
- * const result = await getGameCenterGameProfile();
153
- * if (result) {
154
- * setProfile(result);
155
- * }
156
- * } catch (error) {
157
- * console.error('게임센터 프로필 가져오기에 실패했어요.', error);
158
- * }
159
- * };
160
- *
161
- * return (
162
- * <View>
163
- * <Button title="게임센터 프로필 가져오기" onPress={handlePress} />
164
- * </View>
165
- * );
166
- * }
167
- * ```
168
- */
169
- declare function getGameCenterGameProfile(): Promise<GameCenterGameProfileResponse | undefined>;
170
-
171
115
  interface GetAnonymousKeySuccessResponse {
172
116
  hash: string;
173
117
  type: 'HASH';
@@ -249,6 +193,62 @@ type GetAnonymousKeyResponse = GetAnonymousKeySuccessResponse;
249
193
  */
250
194
  declare function getAnonymousKey(): Promise<GetAnonymousKeySuccessResponse | 'ERROR' | undefined>;
251
195
 
196
+ /**
197
+ * @category 게임센터
198
+ * @name GameCenterGameProfileResponse
199
+ * @description 토스게임센터 프로필을 가져온 결과 타입이에요.
200
+ * 앱에 프로필이 없는 경우, `statusCode`가 `'PROFILE_NOT_FOUND'`이고 다른 정보는 없어요.
201
+ * 프로필이 있는 경우 `statusCode`가 `'SUCCESS'`이고, 닉네임과 프로필 이미지 주소가 함께 제공돼요.
202
+ * @property {string} statusCode 프로필 조회 결과 상태예요. `'SUCCESS'` 또는 `'PROFILE_NOT_FOUND'` 중 하나예요.
203
+ * @property {string} [nickname] 프로필 닉네임이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
204
+ * @property {string} [profileImageUri] 프로필 이미지 URL이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
205
+ */
206
+ type GameCenterGameProfileResponse = {
207
+ statusCode: 'PROFILE_NOT_FOUND';
208
+ } | {
209
+ statusCode: 'SUCCESS';
210
+ nickname: string;
211
+ profileImageUri: string;
212
+ };
213
+ /**
214
+ * @category 게임센터
215
+ * @name getGameCenterGameProfile
216
+ * @description 토스게임센터 프로필 정보를 가져와요.
217
+ * 사용자가 프로필을 만들지 않았다면 `statusCode`가 `'PROFILE_NOT_FOUND'`인 응답이 반환돼요.
218
+ * 앱 버전이 최소 지원 버전(안드로이드 5.221.0, iOS 5.221.0)보다 낮으면 `undefined`를 반환해요.
219
+ * @returns {Promise<GameCenterGameProfileResponse | undefined>} 프로필 정보 또는 `undefined`를 반환해요.
220
+ *
221
+ * @example
222
+ * ### 게임센터 프로필 가져오기
223
+ * ```tsx
224
+ * import { getGameCenterGameProfile } from './getGameCenterGameProfile';
225
+ * import { useState } from 'react';
226
+ * import { View, Button } from 'react-native';
227
+ *
228
+ * function GameProfile() {
229
+ * const [profile, setProfile] = useState<GameCenterGameProfileResponse | null>(null);
230
+ *
231
+ * const handlePress = async () => {
232
+ * try {
233
+ * const result = await getGameCenterGameProfile();
234
+ * if (result) {
235
+ * setProfile(result);
236
+ * }
237
+ * } catch (error) {
238
+ * console.error('게임센터 프로필 가져오기에 실패했어요.', error);
239
+ * }
240
+ * };
241
+ *
242
+ * return (
243
+ * <View>
244
+ * <Button title="게임센터 프로필 가져오기" onPress={handlePress} />
245
+ * </View>
246
+ * );
247
+ * }
248
+ * ```
249
+ */
250
+ declare function getGameCenterGameProfile(): Promise<GameCenterGameProfileResponse | undefined>;
251
+
252
252
  /**
253
253
  * @deprecated 이 타입은 더 이상 사용되지 않습니다. 대신 {@link GetAnonymousKeySuccessResponse}를 사용해주세요.
254
254
  */
@@ -2847,7 +2847,7 @@ declare namespace getServerTime {
2847
2847
  /**
2848
2848
  * @public
2849
2849
  * @category 리뷰
2850
- * @name getServerTime
2850
+ * @name requestReview
2851
2851
  * @description
2852
2852
  * 유저에게 미니앱 리뷰를 요청해요.
2853
2853
  *
package/dist/index.js CHANGED
@@ -993,7 +993,7 @@ async function requestReview() {
993
993
  }
994
994
  return safePostMessage("requestMiniAppReview", { title: brandDisplayName });
995
995
  }
996
- requestReview.isSupported = () => MiniAppModule.getConstants().operationalEnvironment === "toss" && isMinVersionSupported(MIN_VERSION);
996
+ requestReview.isSupported = () => isMinVersionSupported(MIN_VERSION);
997
997
 
998
998
  // src/MiniAppModule/native-modules/index.ts
999
999
  var TossPay = {
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.4.5",
4
+ "version": "2.4.7",
5
5
  "description": "Native Modules for Apps In Toss",
6
6
  "scripts": {
7
7
  "typecheck": "tsc --noEmit",
@@ -29,8 +29,8 @@
29
29
  ],
30
30
  "devDependencies": {
31
31
  "@babel/runtime": "^7",
32
- "@granite-js/native": "1.0.10",
33
- "@granite-js/react-native": "1.0.10",
32
+ "@granite-js/native": "1.0.18",
33
+ "@granite-js/react-native": "1.0.18",
34
34
  "@types/react": "19.2.3",
35
35
  "dts-bundle-generator": "^9.5.1",
36
36
  "esbuild": "0.25.5",
@@ -42,7 +42,7 @@
42
42
  "vitest": "^3.2.4"
43
43
  },
44
44
  "dependencies": {
45
- "@apps-in-toss/types": "2.4.5",
45
+ "@apps-in-toss/types": "2.4.7",
46
46
  "brick-module": "0.5.0",
47
47
  "es-toolkit": "^1.39.3"
48
48
  },
@@ -10,7 +10,7 @@ export type GetUserKeyForGameSuccessResponse = GetAnonymousKeySuccessResponse;
10
10
  */
11
11
  export type GetUserKeyForGameErrorResponse = {
12
12
  type: 'NOT_AVAILABLE';
13
- }
13
+ };
14
14
 
15
15
  /**
16
16
  * @deprecated 이 타입은 더 이상 사용되지 않습니다. 대신 {@link GetAnonymousKeyResponse}를 사용해주세요.
@@ -1,12 +1,12 @@
1
1
  import { isMinVersionSupported } from './isMinVersionSupported';
2
- import { MiniAppModule, safePostMessage } from '../../natives';
2
+ import { safePostMessage } from '../../natives';
3
3
 
4
4
  const MIN_VERSION = { android: '5.253.0', ios: '5.253.0' } as const;
5
5
 
6
6
  /**
7
7
  * @public
8
8
  * @category 리뷰
9
- * @name getServerTime
9
+ * @name requestReview
10
10
  * @description
11
11
  * 유저에게 미니앱 리뷰를 요청해요.
12
12
  *
@@ -27,7 +27,6 @@ export async function requestReview(): Promise<void> {
27
27
 
28
28
  return safePostMessage('requestMiniAppReview', { title: brandDisplayName });
29
29
  }
30
- requestReview.isSupported = () =>
31
- MiniAppModule.getConstants().operationalEnvironment === 'toss' && isMinVersionSupported(MIN_VERSION);
30
+ requestReview.isSupported = () => isMinVersionSupported(MIN_VERSION);
32
31
 
33
32
  declare const global: { __granite: any; __appsInToss: any };
@@ -9,8 +9,8 @@ import type {
9
9
  } from '@apps-in-toss/types';
10
10
  import type { AppsInTossSignTossCertParams } from './native-modules/appsInTossSignTossCert';
11
11
  import type { CheckoutPaymentOptions, CheckoutPaymentResult } from './native-modules/checkoutPayment';
12
- import type { GameCenterGameProfileResponse } from './native-modules/getGameCenterGameProfile';
13
12
  import type { GetAnonymousKeyResponse } from './native-modules/getAnonymousKey';
13
+ import type { GameCenterGameProfileResponse } from './native-modules/getGameCenterGameProfile';
14
14
  import type { GetUserKeyForGameResponse } from './native-modules/getUserKeyForGame';
15
15
  import type { GrantPromotionRewardForGameResponse } from './native-modules/grantPromotionRewardForGame';
16
16
  import type { IapCreateOneTimePurchaseOrderResult, IapSubscriptionInfoResult } from './native-modules/iap';