@apps-in-toss/native-modules 1.4.8 → 1.4.9

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.
@@ -111,6 +111,10 @@
111
111
  "identifier": "getUserKeyForGame",
112
112
  "dts": "export interface GetUserKeyForGameSuccessResponse {\n\thash: string;\n\ttype: \"HASH\";\n}\nexport interface GetUserKeyForGameErrorResponse {\n\ttype: \"NOT_AVAILABLE\";\n}\nexport type GetUserKeyForGameResponse = GetUserKeyForGameSuccessResponse | GetUserKeyForGameErrorResponse;\n/**\n * @public\n * @category 게임\n * @name getUserKeyForGame\n * @description\n * 게임 카테고리 미니앱에서 사용자의 고유 키를 가져와요. 이 키를 사용해서 사용자를 식별하고 게임 데이터를 관리할 수 있어요.\n * 게임 카테고리가 아닌 미니앱에서 호출하면 `'INVALID_CATEGORY'`를 반환해요.\n * @returns {Promise<GetUserKeyForGameSuccessResponse | 'INVALID_CATEGORY' | 'ERROR' | undefined>}\n * 사용자 키 조회 결과를 반환해요.\n * - `GetUserKeyForGameSuccessResponse`: 사용자 키 조회에 성공했어요. `{ type: 'HASH', hash: string }` 형태로 반환돼요.\n * - `'INVALID_CATEGORY'`: 게임 카테고리가 아닌 미니앱에서 호출했어요.\n * - `'ERROR'`: 알 수 없는 오류가 발생했어요.\n * - `undefined`: 앱 버전이 최소 지원 버전보다 낮아요.\n *\n * @example\n * ```tsx\n * // react-native\n * import { Button } from 'react-native';\n * import { getUserKeyForGame } from '@apps-in-toss/framework';\n *\n * function GameUserKeyButton() {\n * async function handlePress() {\n * const result = await getUserKeyForGame();\n *\n * if (!result) {\n * console.warn('지원하지 않는 앱 버전이에요.');\n * return;\n * }\n *\n * if (result === 'INVALID_CATEGORY') {\n * console.error('게임 카테고리가 아닌 미니앱이에요.');\n * return;\n * }\n *\n * if (result === 'ERROR') {\n * console.error('사용자 키 조회 중 오류가 발생했어요.');\n * return;\n * }\n *\n * if (result.type === 'HASH') {\n * console.log('사용자 키:', result.hash);\n * // 여기에서 사용자 키를 사용해 게임 데이터를 관리할 수 있어요.\n * }\n * }\n *\n * return (\n * <Button onPress={handlePress} title=\"유저 키 가져오기\" />\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // webview\n * import { getUserKeyForGame } from '@apps-in-toss/web-framework';\n *\n * function GameUserKeyButton() {\n * async function handleClick() {\n * const result = await getUserKeyForGame();\n *\n * if (!result) {\n * console.warn('지원하지 않는 앱 버전이에요.');\n * return;\n * }\n *\n * if (result === 'INVALID_CATEGORY') {\n * console.error('게임 카테고리가 아닌 미니앱이에요.');\n * return;\n * }\n *\n * if (result === 'ERROR') {\n * console.error('사용자 키 조회 중 오류가 발생했어요.');\n * return;\n * }\n *\n * if (result.type === 'HASH') {\n * console.log('사용자 키:', result.hash);\n * // 여기에서 사용자 키를 사용해 게임 데이터를 관리할 수 있어요.\n * }\n * }\n *\n * return (\n * <button onClick={handleClick}>유저 키 가져오기</button>\n * );\n * }\n * ```\n */\nexport declare function getUserKeyForGame(): Promise<GetUserKeyForGameSuccessResponse | \"INVALID_CATEGORY\" | \"ERROR\" | undefined>;\n\nexport {};\n"
113
113
  },
114
+ {
115
+ "identifier": "getIsTossLoginIntegratedService",
116
+ "dts": "/**\n * @public\n * @category 토스 로그인\n * @name getIsTossLoginIntegratedService\n * @description\n * 유저가 토스 로그인을 연동했는지 여부를 확인해요.\n * 기존 토스 로그인 사용자를 찾아서 게임 식별자로 전환하는 마이그레이션을 할 때 사용할 수 있어요.\n * @returns {Promise<boolean | undefined>}\n * 토스 로그인이 연동된 유저인지 여부를 반환해요.\n * - `true`: 토스 로그인이 연동된 유저에요.\n * - `false`: 토스 로그인이 연동되지 않은 유저에요.\n * - `undefined`: 앱 버전이 최소 지원 버전보다 낮아요.\n * @throw {message: \"oauth2ClientId 설정이 필요합니다.\"} - 토스 로그인을 사용하지 않는 미니앱에서 호출했을 때 발생해요.\n * @example\n * ```tsx\n * // react-native\n * import { Button } from 'react-native';\n * import { getIsTossLoginIntegratedService } from '@apps-in-toss/framework';\n *\n * function GetIsTossLoginIntegratedServiceButton() {\n * async function handlePress() {\n * try {\n * const result = await getIsTossLoginIntegratedService();\n *\n * if (result === undefined) {\n * console.warn('지원하지 않는 앱 버전이에요.');\n * return;\n * }\n * if (result === true) {\n * console.log('토스 로그인이 연동된 유저에요.');\n * // 여기에서 토스 로그인 연동 유저에 대한 처리를 할 수 있어요.\n * }\n * if (result === false) {\n * console.log('토스 로그인이 연동되지 않은 유저에요.');\n * // 여기에서 토스 로그인 연동 유저가 아닌 경우에 대한 처리를 할 수 있어요.\n * }\n * } catch (error) {\n * console.error(error);\n * }\n * }\n *\n * return (\n * <Button onPress={handlePress} title=\"토스 로그인 통합 서비스 여부 확인\" />\n * );\n * }\n * ```\n */\nexport declare function getIsTossLoginIntegratedService(): Promise<boolean | undefined>;\n\nexport {};\n"
117
+ },
114
118
  {
115
119
  "identifier": "grantPromotionRewardForGame",
116
120
  "dts": "export interface GrantPromotionRewardForGameSuccessResponse {\n\tkey: string;\n}\nexport interface GrantPromotionRewardForGameErrorResponse {\n\tcode: string;\n\t[key: string]: any;\n}\nexport interface GrantPromotionRewardForGameErrorResult {\n\terrorCode: string;\n\tmessage: string;\n}\nexport type GrantPromotionRewardForGameResponse = GrantPromotionRewardForGameSuccessResponse | GrantPromotionRewardForGameErrorResponse;\nexport type GrantPromotionRewardForGameResult = GrantPromotionRewardForGameResponse | GrantPromotionRewardForGameErrorResult | \"ERROR\" | undefined;\n/**\n * @public\n * @category 게임\n * @name grantPromotionRewardForGame\n * @description\n * 이 함수를 사용하면 게임 카테고리 미니앱에서 프로모션 코드를 사용해서 유저에게 리워드를 지급할 수 있어요.\n * 게임 카테고리가 아닌 미니앱에서 호출할 수 없어요.\n * @param {{ params: { promotionCode: string; amount: number } }} params - 포인트를 지급하기 위해 필요한 정보예요.\n * @param {string} params.promotionCode - 프로모션 코드예요.\n * @param {number} params.amount - 지급할 포인트 금액이에요.\n * @returns {Promise<{ key: string } | { errorCode: string; message: string } | 'ERROR' | undefined>}\n * 포인트 지급 결과를 반환해요.\n * - `{ key: string }`: 포인트 지급에 성공했어요. key는 리워드 키를 의미해요.\n * - `{ errorCode: string, message: string }`: 포인트 지급에 실패했어요. 에러 코드는 다음과 같아요.\n * - `\"40000\"`: 게임이 아닌 미니앱에서 호출했을 때\n * - `\"4100\"`: 프로모션 정보를 찾을 수 없을 때\n * - `\"4104\"`: 프로모션이 중지되었을 때\n * - `\"4105\"`: 프로모션이 종료되었을 때\n * - `\"4108\"`: 프로모션이 승인되지 않았을 때\n * - `\"4109\"`: 프로모션이 실행중이 아닐 때\n * - `\"4110\"`: 리워드를 지급/회수할 수 없을 때\n * - `\"4112\"`: 프로모션 머니가 부족할 때\n * - `\"4113\"`: 이미 지급/회수된 내역일 때\n * - `\"4114\"`: 프로모션에 설정된 1회 지급 금액을 초과할 때\n * - `'ERROR'`: 알 수 없는 오류가 발생했어요.\n * - `undefined`: 앱 버전이 최소 지원 버전보다 낮아요.\n * @example\n * ```tsx\n * // react-native\n * import { Button } from 'react-native';\n * import { grantPromotionRewardForGame } from '@apps-in-toss/framework';\n *\n * function GrantRewardButton() {\n * async function handlePress() {\n * const result = await grantPromotionRewardForGame({\n * params: {\n * promotionCode: 'GAME_EVENT_2024',\n * amount: 1000,\n * },\n * });\n *\n * if (!result) {\n * console.warn('지원하지 않는 앱 버전이에요.');\n * return;\n * }\n *\n * if (result === 'ERROR') {\n * console.error('포인트 지급 중 알 수 없는 오류가 발생했어요.');\n * return;\n * }\n *\n * if ('key' in result) {\n * console.log('포인트 지급 성공!', result.key);\n * } else if ('errorCode' in result) {\n * console.error('포인트 지급 실패:', result.errorCode, result.message);\n * }\n * }\n *\n * return <Button onPress={handlePress} title=\"포인트 지급하기\" />;\n * }\n * ```\n *\n * @example\n * ```tsx\n * // webview\n * import { grantPromotionRewardForGame } from '@apps-in-toss/web-framework';\n *\n * function GrantRewardButton() {\n * async function handleClick() {\n * const result = await grantPromotionRewardForGame({\n * params: {\n * promotionCode: 'GAME_EVENT_2024',\n * amount: 1000,\n * },\n * });\n *\n * if (!result) {\n * console.warn('지원하지 않는 앱 버전이에요.');\n * return;\n * }\n *\n * if (result === 'ERROR') {\n * console.error('포인트 지급 중 알 수 없는 오류가 발생했어요.');\n * return;\n * }\n *\n * if ('key' in result) {\n * console.log('포인트 지급 성공!', result.key);\n * } else if ('errorCode' in result) {\n * console.error('포인트 지급 실패:', result.errorCode, result.message);\n * }\n * }\n *\n * return (\n * <button onClick={handleClick}>포인트 지급하기</button>\n * );\n * }\n * ```\n */\nexport declare function grantPromotionRewardForGame({ params, }: {\n\tparams: {\n\t\tpromotionCode: string;\n\t\tamount: number;\n\t};\n}): Promise<GrantPromotionRewardForGameResult>;\n\nexport {};\n"
package/dist/index.cjs CHANGED
@@ -44,6 +44,7 @@ __export(index_exports, {
44
44
  getCurrentLocation: () => getCurrentLocation,
45
45
  getDeviceId: () => getDeviceId,
46
46
  getGameCenterGameProfile: () => getGameCenterGameProfile,
47
+ getIsTossLoginIntegratedService: () => getIsTossLoginIntegratedService,
47
48
  getLocale: () => getLocale,
48
49
  getNetworkStatus: () => getNetworkStatus,
49
50
  getOperationalEnvironment: () => getOperationalEnvironment,
@@ -924,6 +925,10 @@ var GAME_PROMOTION_REWARD_MIN_VERSION = {
924
925
  android: "5.232.0",
925
926
  ios: "5.232.0"
926
927
  };
928
+ var GET_IS_TOSS_LOGIN_INTEGRATED_SERVICE_MIN_VERSION = {
929
+ android: "5.237.0",
930
+ ios: "5.237.0"
931
+ };
927
932
 
928
933
  // src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts
929
934
  async function openGameCenterLeaderboard() {
@@ -1006,6 +1011,16 @@ async function grantPromotionRewardForGame({
1006
1011
  }
1007
1012
  }
1008
1013
 
1014
+ // src/AppsInTossModule/native-modules/getIsTossLoginIntegratedService.ts
1015
+ async function getIsTossLoginIntegratedService() {
1016
+ const isSupported = isMinVersionSupported(GET_IS_TOSS_LOGIN_INTEGRATED_SERVICE_MIN_VERSION);
1017
+ if (!isSupported) {
1018
+ return;
1019
+ }
1020
+ const response = await AppsInTossModule.getIsTossLoginIntegratedService({});
1021
+ return response;
1022
+ }
1023
+
1009
1024
  // src/AppsInTossModule/native-event-emitter/contactsViral.ts
1010
1025
  function contactsViral(params) {
1011
1026
  const isSupported = isMinVersionSupported({
@@ -1194,6 +1209,7 @@ var INTERNAL__module = {
1194
1209
  getCurrentLocation,
1195
1210
  getDeviceId,
1196
1211
  getGameCenterGameProfile,
1212
+ getIsTossLoginIntegratedService,
1197
1213
  getLocale,
1198
1214
  getNetworkStatus,
1199
1215
  getOperationalEnvironment,
package/dist/index.d.cts CHANGED
@@ -2205,6 +2205,7 @@ interface Spec extends TurboModule {
2205
2205
  }) => Promise<boolean>;
2206
2206
  getGameCenterGameProfile: (params: CompatiblePlaceholderArgument) => Promise<GameCenterGameProfileResponse>;
2207
2207
  getUserKeyForGame: (params: CompatiblePlaceholderArgument) => Promise<GetUserKeyForGameResponse>;
2208
+ getIsTossLoginIntegratedService: (params: CompatiblePlaceholderArgument) => Promise<boolean>;
2208
2209
  grantPromotionRewardForGame: (params: {
2209
2210
  params: {
2210
2211
  promotionCode: string;
@@ -3136,6 +3137,55 @@ declare const Storage: {
3136
3137
  */
3137
3138
  declare function openGameCenterLeaderboard(): Promise<void>;
3138
3139
 
3140
+ /**
3141
+ * @public
3142
+ * @category 토스 로그인
3143
+ * @name getIsTossLoginIntegratedService
3144
+ * @description
3145
+ * 유저가 토스 로그인을 연동했는지 여부를 확인해요.
3146
+ * 기존 토스 로그인 사용자를 찾아서 게임 식별자로 전환하는 마이그레이션을 할 때 사용할 수 있어요.
3147
+ * @returns {Promise<boolean | undefined>}
3148
+ * 토스 로그인이 연동된 유저인지 여부를 반환해요.
3149
+ * - `true`: 토스 로그인이 연동된 유저에요.
3150
+ * - `false`: 토스 로그인이 연동되지 않은 유저에요.
3151
+ * - `undefined`: 앱 버전이 최소 지원 버전보다 낮아요.
3152
+ * @throw {message: "oauth2ClientId 설정이 필요합니다."} - 토스 로그인을 사용하지 않는 미니앱에서 호출했을 때 발생해요.
3153
+ * @example
3154
+ * ```tsx
3155
+ * // react-native
3156
+ * import { Button } from 'react-native';
3157
+ * import { getIsTossLoginIntegratedService } from '@apps-in-toss/framework';
3158
+ *
3159
+ * function GetIsTossLoginIntegratedServiceButton() {
3160
+ * async function handlePress() {
3161
+ * try {
3162
+ * const result = await getIsTossLoginIntegratedService();
3163
+ *
3164
+ * if (result === undefined) {
3165
+ * console.warn('지원하지 않는 앱 버전이에요.');
3166
+ * return;
3167
+ * }
3168
+ * if (result === true) {
3169
+ * console.log('토스 로그인이 연동된 유저에요.');
3170
+ * // 여기에서 토스 로그인 연동 유저에 대한 처리를 할 수 있어요.
3171
+ * }
3172
+ * if (result === false) {
3173
+ * console.log('토스 로그인이 연동되지 않은 유저에요.');
3174
+ * // 여기에서 토스 로그인 연동 유저가 아닌 경우에 대한 처리를 할 수 있어요.
3175
+ * }
3176
+ * } catch (error) {
3177
+ * console.error(error);
3178
+ * }
3179
+ * }
3180
+ *
3181
+ * return (
3182
+ * <Button onPress={handlePress} title="토스 로그인 통합 서비스 여부 확인" />
3183
+ * );
3184
+ * }
3185
+ * ```
3186
+ */
3187
+ declare function getIsTossLoginIntegratedService(): Promise<boolean | undefined>;
3188
+
3139
3189
  /**
3140
3190
  * @public
3141
3191
  * @category 토스페이
@@ -3632,4 +3682,4 @@ declare const INTERNAL__module: {
3632
3682
  tossCoreEventLog: typeof tossCoreEventLog;
3633
3683
  };
3634
3684
 
3635
- export { AppsInTossModule, type AppsInTossSignTossCertParams, BedrockCoreModule, BedrockModule, type CheckoutPaymentOptions, type CheckoutPaymentResult, type CompletedOrRefundedOrdersResult, type ContactsViralParams, type EventLogParams, type GameCenterGameProfileResponse, type GetUserKeyForGameErrorResponse, type GetUserKeyForGameResponse, type GetUserKeyForGameSuccessResponse, GoogleAdMob, type GrantPromotionRewardForGameErrorResponse, type GrantPromotionRewardForGameErrorResult, type GrantPromotionRewardForGameResponse, type GrantPromotionRewardForGameSuccessResponse, 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, getUserKeyForGame, grantPromotionRewardForGame, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openURL, processProductGrant, requestOneTimePurchase, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, startUpdateLocation, submitGameCenterLeaderBoardScore };
3685
+ export { AppsInTossModule, type AppsInTossSignTossCertParams, BedrockCoreModule, BedrockModule, type CheckoutPaymentOptions, type CheckoutPaymentResult, type CompletedOrRefundedOrdersResult, type ContactsViralParams, type EventLogParams, type GameCenterGameProfileResponse, type GetUserKeyForGameErrorResponse, type GetUserKeyForGameResponse, type GetUserKeyForGameSuccessResponse, GoogleAdMob, type GrantPromotionRewardForGameErrorResponse, type GrantPromotionRewardForGameErrorResult, type GrantPromotionRewardForGameResponse, type GrantPromotionRewardForGameSuccessResponse, 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, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPlatformOS, getSchemeUri, getTossAppVersion, getTossShareLink, getUserKeyForGame, grantPromotionRewardForGame, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openURL, processProductGrant, requestOneTimePurchase, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, startUpdateLocation, submitGameCenterLeaderBoardScore };
package/dist/index.d.ts CHANGED
@@ -2205,6 +2205,7 @@ interface Spec extends TurboModule {
2205
2205
  }) => Promise<boolean>;
2206
2206
  getGameCenterGameProfile: (params: CompatiblePlaceholderArgument) => Promise<GameCenterGameProfileResponse>;
2207
2207
  getUserKeyForGame: (params: CompatiblePlaceholderArgument) => Promise<GetUserKeyForGameResponse>;
2208
+ getIsTossLoginIntegratedService: (params: CompatiblePlaceholderArgument) => Promise<boolean>;
2208
2209
  grantPromotionRewardForGame: (params: {
2209
2210
  params: {
2210
2211
  promotionCode: string;
@@ -3136,6 +3137,55 @@ declare const Storage: {
3136
3137
  */
3137
3138
  declare function openGameCenterLeaderboard(): Promise<void>;
3138
3139
 
3140
+ /**
3141
+ * @public
3142
+ * @category 토스 로그인
3143
+ * @name getIsTossLoginIntegratedService
3144
+ * @description
3145
+ * 유저가 토스 로그인을 연동했는지 여부를 확인해요.
3146
+ * 기존 토스 로그인 사용자를 찾아서 게임 식별자로 전환하는 마이그레이션을 할 때 사용할 수 있어요.
3147
+ * @returns {Promise<boolean | undefined>}
3148
+ * 토스 로그인이 연동된 유저인지 여부를 반환해요.
3149
+ * - `true`: 토스 로그인이 연동된 유저에요.
3150
+ * - `false`: 토스 로그인이 연동되지 않은 유저에요.
3151
+ * - `undefined`: 앱 버전이 최소 지원 버전보다 낮아요.
3152
+ * @throw {message: "oauth2ClientId 설정이 필요합니다."} - 토스 로그인을 사용하지 않는 미니앱에서 호출했을 때 발생해요.
3153
+ * @example
3154
+ * ```tsx
3155
+ * // react-native
3156
+ * import { Button } from 'react-native';
3157
+ * import { getIsTossLoginIntegratedService } from '@apps-in-toss/framework';
3158
+ *
3159
+ * function GetIsTossLoginIntegratedServiceButton() {
3160
+ * async function handlePress() {
3161
+ * try {
3162
+ * const result = await getIsTossLoginIntegratedService();
3163
+ *
3164
+ * if (result === undefined) {
3165
+ * console.warn('지원하지 않는 앱 버전이에요.');
3166
+ * return;
3167
+ * }
3168
+ * if (result === true) {
3169
+ * console.log('토스 로그인이 연동된 유저에요.');
3170
+ * // 여기에서 토스 로그인 연동 유저에 대한 처리를 할 수 있어요.
3171
+ * }
3172
+ * if (result === false) {
3173
+ * console.log('토스 로그인이 연동되지 않은 유저에요.');
3174
+ * // 여기에서 토스 로그인 연동 유저가 아닌 경우에 대한 처리를 할 수 있어요.
3175
+ * }
3176
+ * } catch (error) {
3177
+ * console.error(error);
3178
+ * }
3179
+ * }
3180
+ *
3181
+ * return (
3182
+ * <Button onPress={handlePress} title="토스 로그인 통합 서비스 여부 확인" />
3183
+ * );
3184
+ * }
3185
+ * ```
3186
+ */
3187
+ declare function getIsTossLoginIntegratedService(): Promise<boolean | undefined>;
3188
+
3139
3189
  /**
3140
3190
  * @public
3141
3191
  * @category 토스페이
@@ -3632,4 +3682,4 @@ declare const INTERNAL__module: {
3632
3682
  tossCoreEventLog: typeof tossCoreEventLog;
3633
3683
  };
3634
3684
 
3635
- export { AppsInTossModule, type AppsInTossSignTossCertParams, BedrockCoreModule, BedrockModule, type CheckoutPaymentOptions, type CheckoutPaymentResult, type CompletedOrRefundedOrdersResult, type ContactsViralParams, type EventLogParams, type GameCenterGameProfileResponse, type GetUserKeyForGameErrorResponse, type GetUserKeyForGameResponse, type GetUserKeyForGameSuccessResponse, GoogleAdMob, type GrantPromotionRewardForGameErrorResponse, type GrantPromotionRewardForGameErrorResult, type GrantPromotionRewardForGameResponse, type GrantPromotionRewardForGameSuccessResponse, 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, getUserKeyForGame, grantPromotionRewardForGame, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openURL, processProductGrant, requestOneTimePurchase, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, startUpdateLocation, submitGameCenterLeaderBoardScore };
3685
+ export { AppsInTossModule, type AppsInTossSignTossCertParams, BedrockCoreModule, BedrockModule, type CheckoutPaymentOptions, type CheckoutPaymentResult, type CompletedOrRefundedOrdersResult, type ContactsViralParams, type EventLogParams, type GameCenterGameProfileResponse, type GetUserKeyForGameErrorResponse, type GetUserKeyForGameResponse, type GetUserKeyForGameSuccessResponse, GoogleAdMob, type GrantPromotionRewardForGameErrorResponse, type GrantPromotionRewardForGameErrorResult, type GrantPromotionRewardForGameResponse, type GrantPromotionRewardForGameSuccessResponse, 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, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPlatformOS, getSchemeUri, getTossAppVersion, getTossShareLink, getUserKeyForGame, grantPromotionRewardForGame, iapCreateOneTimePurchaseOrder, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openURL, processProductGrant, requestOneTimePurchase, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, startUpdateLocation, submitGameCenterLeaderBoardScore };
package/dist/index.js CHANGED
@@ -849,6 +849,10 @@ var GAME_PROMOTION_REWARD_MIN_VERSION = {
849
849
  android: "5.232.0",
850
850
  ios: "5.232.0"
851
851
  };
852
+ var GET_IS_TOSS_LOGIN_INTEGRATED_SERVICE_MIN_VERSION = {
853
+ android: "5.237.0",
854
+ ios: "5.237.0"
855
+ };
852
856
 
853
857
  // src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts
854
858
  async function openGameCenterLeaderboard() {
@@ -931,6 +935,16 @@ async function grantPromotionRewardForGame({
931
935
  }
932
936
  }
933
937
 
938
+ // src/AppsInTossModule/native-modules/getIsTossLoginIntegratedService.ts
939
+ async function getIsTossLoginIntegratedService() {
940
+ const isSupported = isMinVersionSupported(GET_IS_TOSS_LOGIN_INTEGRATED_SERVICE_MIN_VERSION);
941
+ if (!isSupported) {
942
+ return;
943
+ }
944
+ const response = await AppsInTossModule.getIsTossLoginIntegratedService({});
945
+ return response;
946
+ }
947
+
934
948
  // src/AppsInTossModule/native-event-emitter/contactsViral.ts
935
949
  function contactsViral(params) {
936
950
  const isSupported = isMinVersionSupported({
@@ -1118,6 +1132,7 @@ export {
1118
1132
  getCurrentLocation,
1119
1133
  getDeviceId,
1120
1134
  getGameCenterGameProfile,
1135
+ getIsTossLoginIntegratedService,
1121
1136
  getLocale,
1122
1137
  getNetworkStatus,
1123
1138
  getOperationalEnvironment,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/native-modules",
3
3
  "type": "module",
4
- "version": "1.4.8",
4
+ "version": "1.4.9",
5
5
  "description": "Native Modules for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -43,7 +43,7 @@
43
43
  "vitest": "^3.2.4"
44
44
  },
45
45
  "dependencies": {
46
- "@apps-in-toss/types": "^1.4.8",
46
+ "@apps-in-toss/types": "^1.4.9",
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": "cc855970b30e1ce9098bd639b48212b8e21c0722"
57
+ "gitHead": "307a579255dee27168c116256a56c4955ecaf51c"
58
58
  }
@@ -14,3 +14,8 @@ export const GAME_PROMOTION_REWARD_MIN_VERSION = {
14
14
  android: '5.232.0',
15
15
  ios: '5.232.0',
16
16
  } as const;
17
+
18
+ export const GET_IS_TOSS_LOGIN_INTEGRATED_SERVICE_MIN_VERSION = {
19
+ android: '5.237.0',
20
+ ios: '5.237.0',
21
+ } as const;
@@ -83,6 +83,7 @@ interface Spec extends __TurboModule {
83
83
 
84
84
  getGameCenterGameProfile: (params: CompatiblePlaceholderArgument) => Promise<GameCenterGameProfileResponse>;
85
85
  getUserKeyForGame: (params: CompatiblePlaceholderArgument) => Promise<GetUserKeyForGameResponse>;
86
+ getIsTossLoginIntegratedService: (params: CompatiblePlaceholderArgument) => Promise<boolean>;
86
87
  grantPromotionRewardForGame: (params: {
87
88
  params: { promotionCode: string; amount: number };
88
89
  }) => Promise<GrantPromotionRewardForGameResponse>;
@@ -0,0 +1,61 @@
1
+ import { AppsInTossModule } from './AppsInTossModule';
2
+ import { isMinVersionSupported } from './isMinVersionSupported';
3
+ import { GET_IS_TOSS_LOGIN_INTEGRATED_SERVICE_MIN_VERSION } from '../constants';
4
+
5
+ /**
6
+ * @public
7
+ * @category 토스 로그인
8
+ * @name getIsTossLoginIntegratedService
9
+ * @description
10
+ * 유저가 토스 로그인을 연동했는지 여부를 확인해요.
11
+ * 기존 토스 로그인 사용자를 찾아서 게임 식별자로 전환하는 마이그레이션을 할 때 사용할 수 있어요.
12
+ * @returns {Promise<boolean | undefined>}
13
+ * 토스 로그인이 연동된 유저인지 여부를 반환해요.
14
+ * - `true`: 토스 로그인이 연동된 유저에요.
15
+ * - `false`: 토스 로그인이 연동되지 않은 유저에요.
16
+ * - `undefined`: 앱 버전이 최소 지원 버전보다 낮아요.
17
+ * @throw {message: "oauth2ClientId 설정이 필요합니다."} - 토스 로그인을 사용하지 않는 미니앱에서 호출했을 때 발생해요.
18
+ * @example
19
+ * ```tsx
20
+ * // react-native
21
+ * import { Button } from 'react-native';
22
+ * import { getIsTossLoginIntegratedService } from '@apps-in-toss/framework';
23
+ *
24
+ * function GetIsTossLoginIntegratedServiceButton() {
25
+ * async function handlePress() {
26
+ * try {
27
+ * const result = await getIsTossLoginIntegratedService();
28
+ *
29
+ * if (result === undefined) {
30
+ * console.warn('지원하지 않는 앱 버전이에요.');
31
+ * return;
32
+ * }
33
+ * if (result === true) {
34
+ * console.log('토스 로그인이 연동된 유저에요.');
35
+ * // 여기에서 토스 로그인 연동 유저에 대한 처리를 할 수 있어요.
36
+ * }
37
+ * if (result === false) {
38
+ * console.log('토스 로그인이 연동되지 않은 유저에요.');
39
+ * // 여기에서 토스 로그인 연동 유저가 아닌 경우에 대한 처리를 할 수 있어요.
40
+ * }
41
+ * } catch (error) {
42
+ * console.error(error);
43
+ * }
44
+ * }
45
+ *
46
+ * return (
47
+ * <Button onPress={handlePress} title="토스 로그인 통합 서비스 여부 확인" />
48
+ * );
49
+ * }
50
+ * ```
51
+ */
52
+ export async function getIsTossLoginIntegratedService(): Promise<boolean | undefined> {
53
+ const isSupported = isMinVersionSupported(GET_IS_TOSS_LOGIN_INTEGRATED_SERVICE_MIN_VERSION);
54
+
55
+ if (!isSupported) {
56
+ return;
57
+ }
58
+
59
+ const response = await AppsInTossModule.getIsTossLoginIntegratedService({});
60
+ return response;
61
+ }
@@ -55,6 +55,7 @@ export * from './getGameCenterGameProfile';
55
55
  export * from './submitGameCenterLeaderBoardScore';
56
56
  export * from './getUserKeyForGame';
57
57
  export * from './grantPromotionRewardForGame';
58
+ export * from './getIsTossLoginIntegratedService';
58
59
  export * from '../native-event-emitter/contactsViral';
59
60
  export * from './appsInTossSignTossCert';
60
61
 
@@ -29,4 +29,5 @@ export * from './AppsInTossModule/native-modules/getGameCenterGameProfile';
29
29
  export * from './AppsInTossModule/native-modules/openGameCenterLeaderboard';
30
30
  export * from './AppsInTossModule/native-modules/submitGameCenterLeaderBoardScore';
31
31
  export * from './AppsInTossModule/native-modules/getUserKeyForGame';
32
+ export * from './AppsInTossModule/native-modules/getIsTossLoginIntegratedService';
32
33
  export * from './AppsInTossModule/native-modules/grantPromotionRewardForGame';