@apps-in-toss/native-modules 0.0.0-dev.1752115036458 → 0.0.0-dev.1757040677030
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 +36 -13
- package/dist/index.cjs +321 -121
- package/dist/index.d.cts +1189 -419
- package/dist/index.d.ts +1189 -419
- package/dist/index.js +298 -104
- package/package.json +7 -8
- package/src/AppsInTossModule/constants.ts +6 -0
- package/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts +13 -0
- package/src/AppsInTossModule/native-event-emitter/contactsViral.ts +140 -0
- package/src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts +10 -0
- package/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts +60 -0
- package/src/AppsInTossModule/native-event-emitter/index.ts +5 -0
- package/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts +45 -0
- package/src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts +50 -0
- package/src/AppsInTossModule/native-event-emitter/internal/appBridge.spec.ts +135 -0
- package/src/AppsInTossModule/native-event-emitter/internal/appBridge.ts +79 -0
- package/src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts +20 -0
- package/src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts +35 -0
- package/src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts +98 -0
- package/src/AppsInTossModule/native-event-emitter/types.ts +4 -0
- package/src/AppsInTossModule/native-modules/AppsInTossModule.ts +89 -0
- package/src/AppsInTossModule/native-modules/ads/googleAdMob.ts +681 -0
- package/src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts +363 -0
- package/src/AppsInTossModule/native-modules/ads/types.ts +123 -0
- package/src/AppsInTossModule/native-modules/appLogin.ts +29 -0
- package/src/AppsInTossModule/native-modules/checkoutPayment.ts +80 -0
- package/src/AppsInTossModule/native-modules/eventLog.spec.ts +300 -0
- package/src/AppsInTossModule/native-modules/eventLog.ts +77 -0
- package/src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts +88 -0
- package/src/AppsInTossModule/native-modules/fetchContacts.ts +121 -0
- package/src/AppsInTossModule/native-modules/getClipboardText.ts +47 -0
- package/src/AppsInTossModule/native-modules/getCurrentLocation.ts +65 -0
- package/src/AppsInTossModule/native-modules/getDeviceId.ts +33 -0
- package/src/AppsInTossModule/native-modules/getGameCenterGameProfile.ts +68 -0
- package/src/AppsInTossModule/native-modules/getOperationalEnvironment.ts +37 -0
- package/src/AppsInTossModule/native-modules/getPermission.ts +58 -0
- package/src/AppsInTossModule/native-modules/getTossAppVersion.ts +33 -0
- package/src/AppsInTossModule/native-modules/getTossShareLink.ts +39 -0
- package/src/AppsInTossModule/native-modules/iap.ts +213 -0
- package/src/AppsInTossModule/native-modules/index.ts +104 -0
- package/src/AppsInTossModule/native-modules/isMinVersionSupported.spec.ts +190 -0
- package/src/AppsInTossModule/native-modules/isMinVersionSupported.ts +68 -0
- package/src/AppsInTossModule/native-modules/openCamera.ts +81 -0
- package/src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts +44 -0
- package/src/AppsInTossModule/native-modules/openPermissionDialog.ts +54 -0
- package/src/AppsInTossModule/native-modules/requestPermission.ts +63 -0
- package/src/AppsInTossModule/native-modules/saveBase64Data.ts +57 -0
- package/src/AppsInTossModule/native-modules/setClipboardText.ts +39 -0
- package/src/AppsInTossModule/native-modules/setDeviceOrientation.ts +74 -0
- package/src/AppsInTossModule/native-modules/storage.ts +100 -0
- package/src/AppsInTossModule/native-modules/submitGameCenterLeaderBoardScore.ts +74 -0
- package/src/AppsInTossModule/native-modules/tossCore.ts +29 -0
- package/src/BedrockModule/native-modules/core/BedrockCoreModule.ts +8 -0
- package/src/BedrockModule/native-modules/index.ts +4 -0
- package/src/BedrockModule/native-modules/natives/BedrockModule.ts +20 -0
- package/src/BedrockModule/native-modules/natives/closeView.ts +25 -0
- package/src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts +27 -0
- package/src/BedrockModule/native-modules/natives/generateHapticFeedback/types.ts +38 -0
- package/src/BedrockModule/native-modules/natives/getLocale.ts +46 -0
- package/src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts +59 -0
- package/src/BedrockModule/native-modules/natives/getNetworkStatus/types.ts +1 -0
- package/src/BedrockModule/native-modules/natives/getPlatformOS.ts +37 -0
- package/src/BedrockModule/native-modules/natives/getSchemeUri.ts +27 -0
- package/src/BedrockModule/native-modules/natives/index.ts +11 -0
- package/src/BedrockModule/native-modules/natives/openURL.ts +40 -0
- package/src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts +43 -0
- package/src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts +66 -0
- package/src/BedrockModule/native-modules/natives/setSecureScreen.ts +31 -0
- package/src/BedrockModule/native-modules/natives/share.ts +36 -0
- package/src/async-bridges.ts +3 -0
- package/src/event-bridges.ts +2 -0
- package/src/index.ts +16 -0
- package/src/types.ts +108 -0
- package/src/utils/compareVersion.spec.ts +176 -0
- package/src/utils/compareVersion.ts +104 -0
- package/src/utils/generateUUID.ts +5 -0
package/dist/index.d.cts
CHANGED
|
@@ -63,7 +63,7 @@ interface Location {
|
|
|
63
63
|
*/
|
|
64
64
|
timestamp: number;
|
|
65
65
|
/**
|
|
66
|
-
* @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/react-native/reference/
|
|
66
|
+
* @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/react-native/reference/native-modules/Types/LocationCoords.html)을 참고해주세요.
|
|
67
67
|
*/
|
|
68
68
|
coords: LocationCoords;
|
|
69
69
|
}
|
|
@@ -145,7 +145,7 @@ type UpdateLocationEventEmitter = EventEmitterSchema<'updateLocation', [Location
|
|
|
145
145
|
* @param {number} [options.accuracy] 위치 정확도를 설정해요.
|
|
146
146
|
* @param {number} [options.timeInterval] 위치 정보를 업데이트하는 최소 주기로, 단위는 밀리초(ms)예요. 이 값은 위치 업데이트가 발생하는 가장 짧은 간격을 설정하지만, 시스템이나 환경의 영향을 받아 지정한 주기보다 더 긴 간격으로 업데이트될 수 있어요.
|
|
147
147
|
* @param {number} [options.distanceInterval] 위치 변경 거리를 미터(m) 단위로 설정해요.
|
|
148
|
-
* @param {(location: Location) => void} [options.callback] 위치 정보가 변경될 때 호출되는 콜백 함수예요. 자세한 내용은 [Location](/react-native/reference/
|
|
148
|
+
* @param {(location: Location) => void} [options.callback] 위치 정보가 변경될 때 호출되는 콜백 함수예요. 자세한 내용은 [Location](/react-native/reference/native-modules/Types/Location.html)을 참고해주세요.
|
|
149
149
|
*
|
|
150
150
|
* @example
|
|
151
151
|
* ### 위치 정보 변경 감지하기
|
|
@@ -198,6 +198,116 @@ declare function startUpdateLocation(eventParams: {
|
|
|
198
198
|
options: StartUpdateLocationOptions$1;
|
|
199
199
|
}): () => void;
|
|
200
200
|
|
|
201
|
+
/**
|
|
202
|
+
* @public
|
|
203
|
+
* @category 친구초대
|
|
204
|
+
* @name RewardFromContactsViralEvent
|
|
205
|
+
* @description 친구에게 공유하기를 완료했을 때 지급할 리워드 정보를 담는 타입이에요. 이 타입을 사용하면 공유가 완료됐을 때 지급할 리워드 정보를 확인할 수 있어요.
|
|
206
|
+
* @property {'sendViral'} type - 이벤트의 타입이에요. `'sendViral'`은 사용자가 친구에게 공유를 완료했을 때 돌아와요.
|
|
207
|
+
* @property {Object} data - 지급할 리워드 관련 정보를 담고 있어요.
|
|
208
|
+
* @property {number} data.rewardAmount - 지급할 리워드 수량이에요. 앱인토스 콘솔에서 설정한 수량 및 금액 값이에요.
|
|
209
|
+
* @property {string} data.rewardUnit - 리워드의 단위예요. 앱인토스 콘솔에 설정된 리워드 이름인 '하트', '보석' 등이 리워드 단위예요.
|
|
210
|
+
*/
|
|
211
|
+
type RewardFromContactsViralEvent = {
|
|
212
|
+
type: 'sendViral';
|
|
213
|
+
data: {
|
|
214
|
+
rewardAmount: number;
|
|
215
|
+
rewardUnit: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* @public
|
|
220
|
+
* @category 친구초대
|
|
221
|
+
* @name ContactsViralSuccessEvent
|
|
222
|
+
* @description 연락처 공유 모듈이 정상적으로 종료됐을 때 전달되는 이벤트 객체예요. 종료 이유와 함께 리워드 상태 및 남은 친구 수 등 관련 정보를 제공해요.
|
|
223
|
+
* @property {'close'} type - 이벤트의 타입이에요. `'close'`는 공유 모듈이 종료됐을 때 돌아와요.
|
|
224
|
+
* @property {Object} data - 모듈 종료와 관련된 세부 정보를 담고 있어요.
|
|
225
|
+
* @property {'clickBackButton' | 'noReward'} data.closeReason - 모듈이 종료된 이유예요. `'clickBackButton'`은 사용자가 뒤로 가기 버튼을 눌러 종료한 경우이고, `'noReward'`는 받을 수 있는 리워드가 없어서 종료된 경우예요.
|
|
226
|
+
* @property {number} data.sentRewardAmount - 사용자가 받은 전체 리워드 수량이에요.
|
|
227
|
+
* @property {number} data.sendableRewardsCount - 아직 공유할 수 있는 친구 수예요.
|
|
228
|
+
* @property {number} data.sentRewardsCount - 사용자가 공유를 완료한 친구 수예요.
|
|
229
|
+
* @property {string} data.rewardUnit - 리워드의 단위예요. 앱인토스 콘솔에 설정된 리워드 이름인 '하트', '보석' 등이 리워드 단위예요.
|
|
230
|
+
*/
|
|
231
|
+
type ContactsViralSuccessEvent = {
|
|
232
|
+
type: 'close';
|
|
233
|
+
data: {
|
|
234
|
+
closeReason: 'clickBackButton' | 'noReward';
|
|
235
|
+
sentRewardAmount?: number;
|
|
236
|
+
sendableRewardsCount?: number;
|
|
237
|
+
sentRewardsCount: number;
|
|
238
|
+
rewardUnit?: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
type ContactsViralEvent = RewardFromContactsViralEvent | ContactsViralSuccessEvent;
|
|
242
|
+
/**
|
|
243
|
+
* @public
|
|
244
|
+
* @category 친구초대
|
|
245
|
+
* @name ContactsViralOption
|
|
246
|
+
* @description [연락처 공유 기능](/react-native/reference/native-modules/친구초대/contactsViral.html)을 사용할 때 필요한 옵션이에요.
|
|
247
|
+
* @property {string} moduleId - 공유 리워드를 구분하는 UUID 형식의 고유 ID예요. 앱인토스 콘솔의 미니앱 > 공유 리워드 메뉴에서 확인할 수 있어요.
|
|
248
|
+
*/
|
|
249
|
+
type ContactsViralOption = {
|
|
250
|
+
moduleId: string;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* @public
|
|
254
|
+
* @category 친구초대
|
|
255
|
+
* @name ContactsViralParams
|
|
256
|
+
* @description `ContactsViralParams`는 연락처 공유 기능을 사용할 때 전달해야 하는 파라미터 타입이에요. 옵션을 설정하고, 이벤트 및 에러 처리 콜백을 지정할 수 있어요.
|
|
257
|
+
* @property {ContactsViralOption} options - 공유 기능에 사용할 옵션 객체예요.
|
|
258
|
+
* @property {(event: ContactsViralEvent) => void} onEvent - 공유 이벤트가 발생했을 때 실행되는 함수예요. [`RewardFromContactsViralEvent`](/bedrock/reference/native-modules/친구초대/RewardFromContactsViralEvent.html) 또는 [`ContactsViralSuccessEvent`](/react-native/reference/native-modules/친구초대/ContactsViralSuccessEvent.html) 타입의 이벤트 객체가 전달돼요.
|
|
259
|
+
* @property {(error: unknown) => void} onError - 예기치 않은 에러가 발생했을 때 실행되는 함수예요.
|
|
260
|
+
*/
|
|
261
|
+
interface ContactsViralParams {
|
|
262
|
+
options: ContactsViralOption;
|
|
263
|
+
onEvent: (event: ContactsViralEvent) => void;
|
|
264
|
+
onError: (error: unknown) => void;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* @public
|
|
268
|
+
* @category 친구초대
|
|
269
|
+
* @name contactsViral
|
|
270
|
+
* @description 친구에게 공유하고 리워드를 받을 수 있는 기능을 제공해요. 사용자가 친구에게 공유를 완료하면 앱브릿지가 이벤트를 통해 리워드 정보를 전달해요.
|
|
271
|
+
* @param {ContactsViralParams} params - 연락처 공유 기능을 실행할 때 사용하는 파라미터예요. 옵션 설정과 이벤트 핸들러를 포함해요. 자세한 내용은 [ContactsViralParams](/bedrock/reference/native-modules/친구초대/ContactsViralParams.html) 문서를 참고하세요.
|
|
272
|
+
* @returns {() => void} 앱브릿지 cleanup 함수를 반환해요. 공유 기능이 끝나면 반드시 이 함수를 호출해서 리소스를 해제해야 해요.
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ### 친구에게 공유하고 리워드 받기
|
|
276
|
+
*
|
|
277
|
+
* ```tsx
|
|
278
|
+
* import { useCallback } from 'react';
|
|
279
|
+
* import { Button } from 'react-native';
|
|
280
|
+
* import { contactsViral } from '@apps-in-toss/framework';
|
|
281
|
+
*
|
|
282
|
+
* function ContactsViralButton({ moduleId }: { moduleId: string }) {
|
|
283
|
+
* const handleContactsViral = useCallback(() => {
|
|
284
|
+
* try {
|
|
285
|
+
* const cleanup = contactsViral({
|
|
286
|
+
* options: { moduleId: moduleId.trim() },
|
|
287
|
+
* onEvent: (event) => {
|
|
288
|
+
* if (event.type === 'sendViral') {
|
|
289
|
+
* console.log('리워드 지급:', event.data.rewardAmount, event.data.rewardUnit);
|
|
290
|
+
* } else if (event.type === 'close') {
|
|
291
|
+
* console.log('모듈 종료:', event.data.closeReason);
|
|
292
|
+
* }
|
|
293
|
+
* },
|
|
294
|
+
* onError: (error) => {
|
|
295
|
+
* console.error('에러 발생:', error);
|
|
296
|
+
* },
|
|
297
|
+
* });
|
|
298
|
+
*
|
|
299
|
+
* return cleanup;
|
|
300
|
+
* } catch (error) {
|
|
301
|
+
* console.error('실행 중 에러:', error);
|
|
302
|
+
* }
|
|
303
|
+
* }, [moduleId]);
|
|
304
|
+
*
|
|
305
|
+
* return <Button title="친구에게 공유하고 리워드 받기" onPress={handleContactsViral} />;
|
|
306
|
+
* }
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
declare function contactsViral(params: ContactsViralParams): () => void;
|
|
310
|
+
|
|
201
311
|
declare class EntryMessageExitedEvent extends GraniteEventDefinition<undefined, undefined> {
|
|
202
312
|
name: "entryMessageExited";
|
|
203
313
|
remove(): void;
|
|
@@ -242,7 +352,26 @@ declare class AppBridgeCallbackEvent extends GraniteEventDefinition<void, AppBri
|
|
|
242
352
|
private ensureInvokeAppBridgeCallback;
|
|
243
353
|
}
|
|
244
354
|
|
|
245
|
-
|
|
355
|
+
interface VisibilityChangedByTransparentServiceWebOptions {
|
|
356
|
+
callbackId: string;
|
|
357
|
+
}
|
|
358
|
+
declare class VisibilityChangedByTransparentServiceWebEvent extends GraniteEventDefinition<VisibilityChangedByTransparentServiceWebOptions, boolean> {
|
|
359
|
+
name: "onVisibilityChangedByTransparentServiceWeb";
|
|
360
|
+
subscription: EmitterSubscription | null;
|
|
361
|
+
remove(): void;
|
|
362
|
+
listener(options: VisibilityChangedByTransparentServiceWebOptions, onEvent: (isVisible: boolean) => void, onError: (error: unknown) => void): void;
|
|
363
|
+
private isVisibilityChangedByTransparentServiceWebResult;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
declare const appsInTossEvent: GraniteEvent<EntryMessageExitedEvent | UpdateLocationEvent | AppBridgeCallbackEvent | VisibilityChangedByTransparentServiceWebEvent>;
|
|
367
|
+
|
|
368
|
+
declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
|
|
369
|
+
options: {
|
|
370
|
+
callbackId: string;
|
|
371
|
+
};
|
|
372
|
+
onEvent: (isVisible: boolean) => void;
|
|
373
|
+
onError: (error: unknown) => void;
|
|
374
|
+
}): () => void;
|
|
246
375
|
|
|
247
376
|
/**
|
|
248
377
|
* @public
|
|
@@ -293,6 +422,13 @@ type AdImpression = {
|
|
|
293
422
|
type AdShow = {
|
|
294
423
|
type: 'show';
|
|
295
424
|
};
|
|
425
|
+
type AdUserEarnedReward = {
|
|
426
|
+
type: 'userEarnedReward';
|
|
427
|
+
data: {
|
|
428
|
+
unitType: string;
|
|
429
|
+
unitAmount: number;
|
|
430
|
+
};
|
|
431
|
+
};
|
|
296
432
|
interface AdMobHandlerParams<Options = void, Event = AdMobFullScreenEvent> {
|
|
297
433
|
options: Options;
|
|
298
434
|
onEvent: (event: Event) => void;
|
|
@@ -336,7 +472,7 @@ interface AdNetworkResponseInfo {
|
|
|
336
472
|
* @name InterstitialAd
|
|
337
473
|
* @description 전면 광고의 ID와 응답 정보를 담고 있는 객체예요. 광고를 로드한 뒤, 관련 정보를 확인할 때 유용해요.
|
|
338
474
|
* @property {string} adUnitId 광고 ID예요.
|
|
339
|
-
* @property {ResponseInfo} responseInfo 광고 로드 응답 정보예요. 자세한 내용은 [ResponseInfo](/react-native/reference/
|
|
475
|
+
* @property {ResponseInfo} responseInfo 광고 로드 응답 정보예요. 자세한 내용은 [ResponseInfo](/react-native/reference/native-modules/광고/ResponseInfo.html)를 참고하세요.
|
|
340
476
|
*/
|
|
341
477
|
interface InterstitialAd {
|
|
342
478
|
adUnitId: string;
|
|
@@ -348,12 +484,26 @@ interface InterstitialAd {
|
|
|
348
484
|
* @name RewardedAd
|
|
349
485
|
* @description 보상형 광고의 ID와 응답 정보를 담고 있는 객체예요. 광고를 로드한 뒤, 관련 정보를 확인할 때 유용해요.
|
|
350
486
|
* @property {string} adUnitId 광고 ID예요.
|
|
351
|
-
* @property {ResponseInfo} responseInfo 광고 로드 응답 정보예요. 자세한 내용은 [ResponseInfo](/react-native/reference/
|
|
487
|
+
* @property {ResponseInfo} responseInfo 광고 로드 응답 정보예요. 자세한 내용은 [ResponseInfo](/react-native/reference/native-modules/광고/ResponseInfo.html)를 참고하세요.
|
|
352
488
|
*/
|
|
353
489
|
interface RewardedAd {
|
|
354
490
|
adUnitId: string;
|
|
355
491
|
responseInfo: ResponseInfo;
|
|
356
492
|
}
|
|
493
|
+
/**
|
|
494
|
+
* @public
|
|
495
|
+
* @category 광고
|
|
496
|
+
* @name AdMobLoadResult
|
|
497
|
+
* @description 광고의 ID와 응답 정보를 담고 있는 객체예요. 광고를 로드한 뒤, 관련 정보를 확인할 때 유용해요.
|
|
498
|
+
* @property {string} adGroupId 광고 그룹 ID예요.
|
|
499
|
+
* @property {string} adUnitId 광고 ID예요.
|
|
500
|
+
* @property {ResponseInfo} responseInfo 광고 로드 응답 정보예요. 자세한 내용은 [ResponseInfo](/react-native/reference/framework/광고/ResponseInfo.html)를 참고하세요.
|
|
501
|
+
*/
|
|
502
|
+
interface AdMobLoadResult {
|
|
503
|
+
adGroupId: string;
|
|
504
|
+
adUnitId: string;
|
|
505
|
+
responseInfo: ResponseInfo;
|
|
506
|
+
}
|
|
357
507
|
|
|
358
508
|
interface LoadAdMobInterstitialAdOptions {
|
|
359
509
|
/**
|
|
@@ -365,7 +515,7 @@ interface LoadAdMobInterstitialAdOptions {
|
|
|
365
515
|
* @public
|
|
366
516
|
* @category 광고
|
|
367
517
|
* @name LoadAdMobInterstitialAdEvent
|
|
368
|
-
* @description 전면 광고를 불러오는 함수에서 발생하는 이벤트 타입이에요. `loaded` 이벤트가 발생하면 광고를 성공적으로 불러온 거예요. 이때 [InterstitialAd](/react-native/reference/
|
|
518
|
+
* @description 전면 광고를 불러오는 함수에서 발생하는 이벤트 타입이에요. `loaded` 이벤트가 발생하면 광고를 성공적으로 불러온 거예요. 이때 [InterstitialAd](/react-native/reference/native-modules/광고/InterstitialAd.html) 객체가 함께 반환돼요.
|
|
369
519
|
*/
|
|
370
520
|
type LoadAdMobInterstitialAdEvent = AdMobFullScreenEvent | {
|
|
371
521
|
type: 'loaded';
|
|
@@ -382,16 +532,10 @@ type LoadAdMobInterstitialAdParams = AdMobHandlerParams<LoadAdMobInterstitialAdO
|
|
|
382
532
|
* @public
|
|
383
533
|
* @category 광고
|
|
384
534
|
* @name loadAdMobInterstitialAd
|
|
385
|
-
* @
|
|
386
|
-
* @param {LoadAdMobInterstitialAdParams} params 광고를 불러올 때 사용할 설정 값이에요. 광고 ID와 광고의 동작에 대한 콜백을 설정할 수 있어요.
|
|
387
|
-
* @param {LoadAdMobInterstitialAdOptions} params.options 광고를 불러올 때 전달할 옵션 객체예요.
|
|
388
|
-
* @param {string} params.options.adUnitId 광고 단위 ID예요. 발급받은 전면 광고용 ID를 입력해요.
|
|
389
|
-
* @param {(event: LoadAdMobInterstitialAdEvent) => void} [params.onEvent] 광고 관련 이벤트가 발생했을 때 호출돼요. (예시: 광고가 닫히거나 클릭됐을 때). 자세한 이벤트 타입은 [LoadAdMobInterstitialAdEvent](/react-native/reference/framework/광고/LoadAdMobInterstitialAdEvent.html)를 참고하세요.
|
|
390
|
-
* @param {(reason: unknown) => void} [params.onError] 광고를 불러오지 못했을 때 호출돼요. (예시: 네트워크 오류나 지원하지 않는 환경일 때)
|
|
391
|
-
* @property {() => boolean} [isSupported] 현재 실행 중인 앱(예: 토스 앱, 개발용 샌드박스 앱 등)에서 Google AdMob 광고 기능을 지원하는지 확인하는 함수예요. 기능을 사용하기 전에 지원 여부를 확인해야 해요.
|
|
535
|
+
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.loadAppsInTossAdMob}를 사용해주세요.
|
|
392
536
|
*
|
|
393
537
|
* @example
|
|
394
|
-
* ### 버튼 눌러 불러온
|
|
538
|
+
* ### 버튼 눌러 불러온 광고 보여주기 (loadAppsInTossAdMob로 변경 예제)
|
|
395
539
|
* ```tsx
|
|
396
540
|
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
397
541
|
* import { useFocusEffect } from '@granite-js/native/@react-navigation/native';
|
|
@@ -399,20 +543,20 @@ type LoadAdMobInterstitialAdParams = AdMobHandlerParams<LoadAdMobInterstitialAdO
|
|
|
399
543
|
* import { useCallback, useState } from 'react';
|
|
400
544
|
* import { Button, Text, View } from 'react-native';
|
|
401
545
|
*
|
|
402
|
-
* const
|
|
546
|
+
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
403
547
|
*
|
|
404
|
-
* export function
|
|
548
|
+
* export function GoogleAdmobExample() {
|
|
405
549
|
* const [adLoadStatus, setAdLoadStatus] = useState<'not_loaded' | 'loaded' | 'failed'>('not_loaded');
|
|
406
550
|
* const navigation = useNavigation();
|
|
407
551
|
*
|
|
408
552
|
* const loadAd = useCallback(() => {
|
|
409
|
-
* if (GoogleAdMob.
|
|
553
|
+
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
410
554
|
* return;
|
|
411
555
|
* }
|
|
412
556
|
|
|
413
|
-
* const cleanup = GoogleAdMob.
|
|
557
|
+
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
414
558
|
* options: {
|
|
415
|
-
*
|
|
559
|
+
* adGroupId: AD_GROUP_ID,
|
|
416
560
|
* },
|
|
417
561
|
* onEvent: (event) => {
|
|
418
562
|
* switch (event.type) {
|
|
@@ -420,27 +564,6 @@ type LoadAdMobInterstitialAdParams = AdMobHandlerParams<LoadAdMobInterstitialAdO
|
|
|
420
564
|
* console.log('광고 로드 성공', event.data);
|
|
421
565
|
* setAdLoadStatus('loaded');
|
|
422
566
|
* break;
|
|
423
|
-
*
|
|
424
|
-
* case 'clicked':
|
|
425
|
-
* console.log('광고 클릭');
|
|
426
|
-
* break;
|
|
427
|
-
*
|
|
428
|
-
* case 'dismissed':
|
|
429
|
-
* console.log('광고 닫힘');
|
|
430
|
-
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
431
|
-
* break;
|
|
432
|
-
*
|
|
433
|
-
* case 'failedToShow':
|
|
434
|
-
* console.log('광고 보여주기 실패');
|
|
435
|
-
* break;
|
|
436
|
-
*
|
|
437
|
-
* case 'impression':
|
|
438
|
-
* console.log('광고 노출');
|
|
439
|
-
* break;
|
|
440
|
-
*
|
|
441
|
-
* case 'show':
|
|
442
|
-
* console.log('광고 컨텐츠 보여졌음');
|
|
443
|
-
* break;
|
|
444
567
|
* }
|
|
445
568
|
* },
|
|
446
569
|
* onError: (error) => {
|
|
@@ -452,19 +575,45 @@ type LoadAdMobInterstitialAdParams = AdMobHandlerParams<LoadAdMobInterstitialAdO
|
|
|
452
575
|
* }, [navigation]);
|
|
453
576
|
*
|
|
454
577
|
* const showAd = useCallback(() => {
|
|
455
|
-
* if (GoogleAdMob.
|
|
578
|
+
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
456
579
|
* return;
|
|
457
580
|
* }
|
|
458
581
|
*
|
|
459
|
-
* GoogleAdMob.
|
|
582
|
+
* GoogleAdMob.showAppsInTossAdMob({
|
|
460
583
|
* options: {
|
|
461
|
-
*
|
|
584
|
+
* adGroupId: AD_GROUP_ID,
|
|
462
585
|
* },
|
|
463
586
|
* onEvent: (event) => {
|
|
464
587
|
* switch (event.type) {
|
|
465
588
|
* case 'requested':
|
|
466
589
|
* console.log('광고 보여주기 요청 완료');
|
|
467
590
|
* break;
|
|
591
|
+
*
|
|
592
|
+
* case 'clicked':
|
|
593
|
+
* console.log('광고 클릭');
|
|
594
|
+
* break;
|
|
595
|
+
*
|
|
596
|
+
* case 'dismissed':
|
|
597
|
+
* console.log('광고 닫힘');
|
|
598
|
+
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
599
|
+
* break;
|
|
600
|
+
*
|
|
601
|
+
* case 'failedToShow':
|
|
602
|
+
* console.log('광고 보여주기 실패');
|
|
603
|
+
* break;
|
|
604
|
+
*
|
|
605
|
+
* case 'impression':
|
|
606
|
+
* console.log('광고 노출');
|
|
607
|
+
* break;
|
|
608
|
+
*
|
|
609
|
+
* case 'userEarnedReward':
|
|
610
|
+
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
611
|
+
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
612
|
+
* break;
|
|
613
|
+
*
|
|
614
|
+
* case 'show':
|
|
615
|
+
* console.log('광고 컨텐츠 보여졌음');
|
|
616
|
+
* break;
|
|
468
617
|
* }
|
|
469
618
|
* },
|
|
470
619
|
* onError: (error) => {
|
|
@@ -519,16 +668,10 @@ type ShowAdMobInterstitialAdParams = AdMobHandlerParams<ShowAdMobInterstitialAdO
|
|
|
519
668
|
* @public
|
|
520
669
|
* @category 광고
|
|
521
670
|
* @name showAdMobInterstitialAd
|
|
522
|
-
* @
|
|
523
|
-
* @param {ShowAdMobInterstitialAdParams} params 광고를 보여주기 위해 사용할 설정 값이에요. 광고 ID와과 광고의 동작에 대한 콜백을 설정할 수 있어요.
|
|
524
|
-
* @param {ShowAdMobInterstitialAdOptions} params.options 광고를 보여줄 때 전달할 옵션 객체예요.
|
|
525
|
-
* @param {string} params.options.adUnitId 광고 단위 ID예요. `loadAdMobInterstitialAd` 로 불러온 전면 광고용 ID를 입력해요.
|
|
526
|
-
* @param {(event: ShowAdMobInterstitialAdEvent) => void} [params.onEvent] 광고 관련 이벤트가 발생했을 때 호출돼요. (예시: 광고 노출을 요청했을 때). 자세한 이벤트 타입은 [ShowAdMobInterstitialAdEvent](/react-native/reference/framework/광고/ShowAdMobInterstitialAdEvent.html)를 참고하세요.
|
|
527
|
-
* @param {(reason: unknown) => void} [params.onError] 광고를 노출하지 못했을 때 호출돼요. (예시: 네트워크 오류나 지원하지 않는 환경일 때)
|
|
528
|
-
* @property {() => boolean} [isSupported] 현재 실행 중인 앱(예: 토스 앱, 개발용 샌드박스 앱 등)에서 Google AdMob 광고 기능을 지원하는지 확인하는 함수예요. 기능을 사용하기 전에 지원 여부를 확인해야 해요.
|
|
671
|
+
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.showAppsInTossAdMob}를 사용해주세요.
|
|
529
672
|
*
|
|
530
673
|
* @example
|
|
531
|
-
* ### 버튼 눌러 불러온
|
|
674
|
+
* ### 버튼 눌러 불러온 광고 보여주기 (showAppsInTossAdMob로 변경 예제)
|
|
532
675
|
* ```tsx
|
|
533
676
|
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
534
677
|
* import { useFocusEffect } from '@granite-js/native/@react-navigation/native';
|
|
@@ -536,20 +679,20 @@ type ShowAdMobInterstitialAdParams = AdMobHandlerParams<ShowAdMobInterstitialAdO
|
|
|
536
679
|
* import { useCallback, useState } from 'react';
|
|
537
680
|
* import { Button, Text, View } from 'react-native';
|
|
538
681
|
*
|
|
539
|
-
* const
|
|
682
|
+
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
540
683
|
*
|
|
541
|
-
* export function
|
|
684
|
+
* export function GoogleAdmobExample() {
|
|
542
685
|
* const [adLoadStatus, setAdLoadStatus] = useState<'not_loaded' | 'loaded' | 'failed'>('not_loaded');
|
|
543
686
|
* const navigation = useNavigation();
|
|
544
687
|
*
|
|
545
688
|
* const loadAd = useCallback(() => {
|
|
546
|
-
* if (GoogleAdMob.
|
|
689
|
+
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
547
690
|
* return;
|
|
548
691
|
* }
|
|
549
692
|
|
|
550
|
-
* const cleanup = GoogleAdMob.
|
|
693
|
+
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
551
694
|
* options: {
|
|
552
|
-
*
|
|
695
|
+
* adGroupId: AD_GROUP_ID,
|
|
553
696
|
* },
|
|
554
697
|
* onEvent: (event) => {
|
|
555
698
|
* switch (event.type) {
|
|
@@ -557,27 +700,6 @@ type ShowAdMobInterstitialAdParams = AdMobHandlerParams<ShowAdMobInterstitialAdO
|
|
|
557
700
|
* console.log('광고 로드 성공', event.data);
|
|
558
701
|
* setAdLoadStatus('loaded');
|
|
559
702
|
* break;
|
|
560
|
-
*
|
|
561
|
-
* case 'clicked':
|
|
562
|
-
* console.log('광고 클릭');
|
|
563
|
-
* break;
|
|
564
|
-
*
|
|
565
|
-
* case 'dismissed':
|
|
566
|
-
* console.log('광고 닫힘');
|
|
567
|
-
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
568
|
-
* break;
|
|
569
|
-
*
|
|
570
|
-
* case 'failedToShow':
|
|
571
|
-
* console.log('광고 보여주기 실패');
|
|
572
|
-
* break;
|
|
573
|
-
*
|
|
574
|
-
* case 'impression':
|
|
575
|
-
* console.log('광고 노출');
|
|
576
|
-
* break;
|
|
577
|
-
*
|
|
578
|
-
* case 'show':
|
|
579
|
-
* console.log('광고 컨텐츠 보여졌음');
|
|
580
|
-
* break;
|
|
581
703
|
* }
|
|
582
704
|
* },
|
|
583
705
|
* onError: (error) => {
|
|
@@ -589,19 +711,45 @@ type ShowAdMobInterstitialAdParams = AdMobHandlerParams<ShowAdMobInterstitialAdO
|
|
|
589
711
|
* }, [navigation]);
|
|
590
712
|
*
|
|
591
713
|
* const showAd = useCallback(() => {
|
|
592
|
-
* if (GoogleAdMob.
|
|
714
|
+
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
593
715
|
* return;
|
|
594
716
|
* }
|
|
595
717
|
*
|
|
596
|
-
* GoogleAdMob.
|
|
718
|
+
* GoogleAdMob.showAppsInTossAdMob({
|
|
597
719
|
* options: {
|
|
598
|
-
*
|
|
720
|
+
* adGroupId: AD_GROUP_ID,
|
|
599
721
|
* },
|
|
600
722
|
* onEvent: (event) => {
|
|
601
723
|
* switch (event.type) {
|
|
602
724
|
* case 'requested':
|
|
603
725
|
* console.log('광고 보여주기 요청 완료');
|
|
604
726
|
* break;
|
|
727
|
+
*
|
|
728
|
+
* case 'clicked':
|
|
729
|
+
* console.log('광고 클릭');
|
|
730
|
+
* break;
|
|
731
|
+
*
|
|
732
|
+
* case 'dismissed':
|
|
733
|
+
* console.log('광고 닫힘');
|
|
734
|
+
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
735
|
+
* break;
|
|
736
|
+
*
|
|
737
|
+
* case 'failedToShow':
|
|
738
|
+
* console.log('광고 보여주기 실패');
|
|
739
|
+
* break;
|
|
740
|
+
*
|
|
741
|
+
* case 'impression':
|
|
742
|
+
* console.log('광고 노출');
|
|
743
|
+
* break;
|
|
744
|
+
*
|
|
745
|
+
* case 'userEarnedReward':
|
|
746
|
+
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
747
|
+
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
748
|
+
* break;
|
|
749
|
+
*
|
|
750
|
+
* case 'show':
|
|
751
|
+
* console.log('광고 컨텐츠 보여졌음');
|
|
752
|
+
* break;
|
|
605
753
|
* }
|
|
606
754
|
* },
|
|
607
755
|
* onError: (error) => {
|
|
@@ -639,7 +787,7 @@ interface LoadAdMobRewardedAdOptions {
|
|
|
639
787
|
/**
|
|
640
788
|
* @public
|
|
641
789
|
* @category 광고
|
|
642
|
-
* @name
|
|
790
|
+
* @name LoadAdMobRewardedAdEvent
|
|
643
791
|
* @description 보상형 광고를 불러오는 함수에서 발생하는 이벤트 타입이에요. `loaded` 이벤트가 발생하면 광고를 성공적으로 불러온 거예요. 이때 [RewardedAd](/react-native/reference/native-modules/광고/RewardedAd.html) 객체가 함께 반환돼요. `userEarnedReward` 이벤트는 사용자가 광고를 끝까지 시청해, 보상 조건을 충족했을 때 발생해요.
|
|
644
792
|
*/
|
|
645
793
|
type LoadAdMobRewardedAdEvent = AdMobFullScreenEvent | {
|
|
@@ -659,44 +807,62 @@ type LoadAdMobRewardedAdParams = AdMobHandlerParams<LoadAdMobRewardedAdOptions,
|
|
|
659
807
|
* @public
|
|
660
808
|
* @category 광고
|
|
661
809
|
* @name loadAdMobRewardedAd
|
|
662
|
-
* @
|
|
663
|
-
* @param {LoadAdMobRewardedAdParams} params 광고를 불러올 때 사용할 설정 값이에요. 광고 ID와 광고의 동작에 대한 콜백을 설정할 수 있어요.
|
|
664
|
-
* @param {LoadAdMobRewardedAdOptions} params.options 광고를 불러올 때 전달할 옵션 객체예요.
|
|
665
|
-
* @param {string} params.options.adUnitId 광고 단위 ID예요. 발급받은 보상형 광고용 ID를 입력해요.
|
|
666
|
-
* @param {(event: LoadAdMobRewardedAdEvent) => void} [params.onEvent] 광고 관련 이벤트가 발생했을 때 호출돼요. (예시: 광고가 닫히거나 클릭됐을 때). 자세한 이벤트 타입은 [LoadAdMobRewardedAdEvent](/react-native/reference/framework/광고/LoadAdMobRewardedAdEvent.html)를 참고하세요.
|
|
667
|
-
* @param {(reason: unknown) => void} [params.onError] 광고를 불러오지 못했을 때 호출돼요. (예시: 네트워크 오류나 지원하지 않는 환경일 때)
|
|
668
|
-
* @property {() => boolean} [isSupported] 현재 실행 중인 앱(예: 토스 앱, 개발용 샌드박스 앱 등)에서 Google AdMob 광고 기능을 지원하는지 확인하는 함수예요. 기능을 사용하기 전에 지원 여부를 확인해야 해요.
|
|
810
|
+
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.loadAppsInTossAdMob}를 사용해주세요.
|
|
669
811
|
*
|
|
670
812
|
* @example
|
|
671
|
-
*
|
|
672
|
-
* ### 버튼 눌러 불러온 보상형 광고 보여주기
|
|
673
|
-
*
|
|
813
|
+
* ### 버튼 눌러 불러온 광고 보여주기 (loadAppsInTossAdMob로 변경 예제)
|
|
674
814
|
* ```tsx
|
|
675
815
|
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
816
|
+
* import { useFocusEffect } from '@react-native-bedrock/native/@react-navigation/native';
|
|
676
817
|
* import { useCallback, useState } from 'react';
|
|
677
818
|
* import { Button, Text, View } from 'react-native';
|
|
819
|
+
* import { useNavigation } from 'react-native-bedrock';
|
|
678
820
|
*
|
|
679
|
-
* const
|
|
821
|
+
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
680
822
|
*
|
|
681
|
-
* export function
|
|
823
|
+
* export function GoogleAdmobExample() {
|
|
682
824
|
* const [adLoadStatus, setAdLoadStatus] = useState<'not_loaded' | 'loaded' | 'failed'>('not_loaded');
|
|
825
|
+
* const navigation = useNavigation();
|
|
683
826
|
*
|
|
684
827
|
* const loadAd = useCallback(() => {
|
|
685
|
-
* if (GoogleAdMob.
|
|
828
|
+
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
686
829
|
* return;
|
|
687
830
|
* }
|
|
688
|
-
|
|
689
|
-
* const cleanup = GoogleAdMob.
|
|
831
|
+
|
|
832
|
+
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
690
833
|
* options: {
|
|
691
|
-
*
|
|
834
|
+
* adGroupId: AD_GROUP_ID,
|
|
692
835
|
* },
|
|
693
836
|
* onEvent: (event) => {
|
|
694
|
-
* console.log(event.type);
|
|
695
837
|
* switch (event.type) {
|
|
696
838
|
* case 'loaded':
|
|
697
839
|
* console.log('광고 로드 성공', event.data);
|
|
698
840
|
* setAdLoadStatus('loaded');
|
|
699
841
|
* break;
|
|
842
|
+
* }
|
|
843
|
+
* },
|
|
844
|
+
* onError: (error) => {
|
|
845
|
+
* console.error('광고 불러오기 실패', error);
|
|
846
|
+
* },
|
|
847
|
+
* });
|
|
848
|
+
*
|
|
849
|
+
* return cleanup;
|
|
850
|
+
* }, [navigation]);
|
|
851
|
+
*
|
|
852
|
+
* const showAd = useCallback(() => {
|
|
853
|
+
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
854
|
+
* return;
|
|
855
|
+
* }
|
|
856
|
+
*
|
|
857
|
+
* GoogleAdMob.showAppsInTossAdMob({
|
|
858
|
+
* options: {
|
|
859
|
+
* adGroupId: AD_GROUP_ID,
|
|
860
|
+
* },
|
|
861
|
+
* onEvent: (event) => {
|
|
862
|
+
* switch (event.type) {
|
|
863
|
+
* case 'requested':
|
|
864
|
+
* console.log('광고 보여주기 요청 완료');
|
|
865
|
+
* break;
|
|
700
866
|
*
|
|
701
867
|
* case 'clicked':
|
|
702
868
|
* console.log('광고 클릭');
|
|
@@ -704,6 +870,7 @@ type LoadAdMobRewardedAdParams = AdMobHandlerParams<LoadAdMobRewardedAdOptions,
|
|
|
704
870
|
*
|
|
705
871
|
* case 'dismissed':
|
|
706
872
|
* console.log('광고 닫힘');
|
|
873
|
+
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
707
874
|
* break;
|
|
708
875
|
*
|
|
709
876
|
* case 'failedToShow':
|
|
@@ -714,37 +881,13 @@ type LoadAdMobRewardedAdParams = AdMobHandlerParams<LoadAdMobRewardedAdOptions,
|
|
|
714
881
|
* console.log('광고 노출');
|
|
715
882
|
* break;
|
|
716
883
|
*
|
|
717
|
-
* case 'show':
|
|
718
|
-
* console.log('광고 컨텐츠 보여졌음');
|
|
719
|
-
* break;
|
|
720
|
-
*
|
|
721
884
|
* case 'userEarnedReward':
|
|
722
|
-
* console.log('
|
|
885
|
+
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
886
|
+
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
723
887
|
* break;
|
|
724
|
-
* }
|
|
725
|
-
* },
|
|
726
|
-
* onError: (error) => {
|
|
727
|
-
* console.error('광고 불러오기 실패', error);
|
|
728
|
-
* },
|
|
729
|
-
* });
|
|
730
|
-
*
|
|
731
|
-
* return cleanup;
|
|
732
|
-
* }, []);
|
|
733
|
-
*
|
|
734
|
-
* const showAd = useCallback(() => {
|
|
735
|
-
* if (GoogleAdMob.showAdMobRewardedAd.isSupported() !== true) {
|
|
736
|
-
* return;
|
|
737
|
-
* }
|
|
738
888
|
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
* adUnitId: AD_UNIT_ID,
|
|
742
|
-
* },
|
|
743
|
-
* onEvent: (event) => {
|
|
744
|
-
* switch (event.type) {
|
|
745
|
-
* case 'requested':
|
|
746
|
-
* console.log('광고 보여주기 요청 완료');
|
|
747
|
-
* setAdLoadStatus('not_loaded');
|
|
889
|
+
* case 'show':
|
|
890
|
+
* console.log('광고 컨텐츠 보여졌음');
|
|
748
891
|
* break;
|
|
749
892
|
* }
|
|
750
893
|
* },
|
|
@@ -754,6 +897,8 @@ type LoadAdMobRewardedAdParams = AdMobHandlerParams<LoadAdMobRewardedAdOptions,
|
|
|
754
897
|
* });
|
|
755
898
|
* }, []);
|
|
756
899
|
*
|
|
900
|
+
* useFocusEffect(loadAd);
|
|
901
|
+
*
|
|
757
902
|
* return (
|
|
758
903
|
* <View>
|
|
759
904
|
* <Text>
|
|
@@ -762,7 +907,6 @@ type LoadAdMobRewardedAdParams = AdMobHandlerParams<LoadAdMobRewardedAdOptions,
|
|
|
762
907
|
* {adLoadStatus === 'failed' && '광고 로드 실패'}
|
|
763
908
|
* </Text>
|
|
764
909
|
*
|
|
765
|
-
* <Button title="Load Ad" onPress={loadAd} />
|
|
766
910
|
* <Button title="Show Ad" onPress={showAd} disabled={adLoadStatus !== 'loaded'} />
|
|
767
911
|
* </View>
|
|
768
912
|
* );
|
|
@@ -799,43 +943,62 @@ type ShowAdMobRewardedAdParams = AdMobHandlerParams<ShowAdMobRewardedAdOptions,
|
|
|
799
943
|
* @public
|
|
800
944
|
* @category 광고
|
|
801
945
|
* @name showAdMobRewardedAd
|
|
802
|
-
* @
|
|
803
|
-
* @param {ShowAdMobRewardedAdParams} params 광고를 보여주기 위해 사용할 설정 값이에요. 광고 ID와 광고의 동작에 대한 콜백을 설정할 수 있어요.
|
|
804
|
-
* @param {ShowAdMobRewardedAdOptions} params.options 광고를 보여줄 때 전달할 옵션 객체예요.
|
|
805
|
-
* @param {string} params.options.adUnitId 광고 단위 ID예요. `loadAdMobRewardedAd` 로 불러온 보상형 광고용 ID를 입력해요.
|
|
806
|
-
* @param {(event: ShowAdMobRewardedAdEvent) => void} [params.onEvent] 광고 관련 이벤트가 발생했을 때 호출돼요. (예시: 광고 노출을 요청했을 때). 자세한 이벤트 타입은 [ShowAdMobRewardedAdEvent](/react-native/reference/framework/광고/ShowAdMobRewardedAdEvent.html)를 참고하세요.
|
|
807
|
-
* @param {(reason: unknown) => void} [params.onError] 광고를 불러오지 못했을 때 호출돼요. (예시: 네트워크 오류나 지원하지 않는 환경일 때)
|
|
808
|
-
* @property {() => boolean} [isSupported] 현재 실행 중인 앱(예: 토스 앱, 개발용 샌드박스 앱 등)에서 Google AdMob 광고 기능을 지원하는지 확인하는 함수예요. 기능을 사용하기 전에 지원 여부를 확인해야 해요.
|
|
946
|
+
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.showAppsInTossAdMob}를 사용해주세요.
|
|
809
947
|
*
|
|
810
948
|
* @example
|
|
811
|
-
* ### 버튼 눌러 불러온
|
|
812
|
-
*
|
|
949
|
+
* ### 버튼 눌러 불러온 광고 보여주기 (showAppsInTossAdMob로 변경 예제)
|
|
813
950
|
* ```tsx
|
|
814
951
|
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
952
|
+
* import { useFocusEffect } from '@react-native-bedrock/native/@react-navigation/native';
|
|
815
953
|
* import { useCallback, useState } from 'react';
|
|
816
954
|
* import { Button, Text, View } from 'react-native';
|
|
955
|
+
* import { useNavigation } from 'react-native-bedrock';
|
|
817
956
|
*
|
|
818
|
-
* const
|
|
957
|
+
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
819
958
|
*
|
|
820
|
-
* export function
|
|
959
|
+
* export function GoogleAdmobExample() {
|
|
821
960
|
* const [adLoadStatus, setAdLoadStatus] = useState<'not_loaded' | 'loaded' | 'failed'>('not_loaded');
|
|
961
|
+
* const navigation = useNavigation();
|
|
822
962
|
*
|
|
823
963
|
* const loadAd = useCallback(() => {
|
|
824
|
-
* if (GoogleAdMob.
|
|
964
|
+
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
825
965
|
* return;
|
|
826
966
|
* }
|
|
827
|
-
|
|
828
|
-
* const cleanup = GoogleAdMob.
|
|
967
|
+
|
|
968
|
+
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
829
969
|
* options: {
|
|
830
|
-
*
|
|
970
|
+
* adGroupId: AD_GROUP_ID,
|
|
831
971
|
* },
|
|
832
972
|
* onEvent: (event) => {
|
|
833
|
-
* console.log(event.type);
|
|
834
973
|
* switch (event.type) {
|
|
835
974
|
* case 'loaded':
|
|
836
975
|
* console.log('광고 로드 성공', event.data);
|
|
837
976
|
* setAdLoadStatus('loaded');
|
|
838
977
|
* break;
|
|
978
|
+
* }
|
|
979
|
+
* },
|
|
980
|
+
* onError: (error) => {
|
|
981
|
+
* console.error('광고 불러오기 실패', error);
|
|
982
|
+
* },
|
|
983
|
+
* });
|
|
984
|
+
*
|
|
985
|
+
* return cleanup;
|
|
986
|
+
* }, [navigation]);
|
|
987
|
+
*
|
|
988
|
+
* const showAd = useCallback(() => {
|
|
989
|
+
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
990
|
+
* return;
|
|
991
|
+
* }
|
|
992
|
+
*
|
|
993
|
+
* GoogleAdMob.showAppsInTossAdMob({
|
|
994
|
+
* options: {
|
|
995
|
+
* adGroupId: AD_GROUP_ID,
|
|
996
|
+
* },
|
|
997
|
+
* onEvent: (event) => {
|
|
998
|
+
* switch (event.type) {
|
|
999
|
+
* case 'requested':
|
|
1000
|
+
* console.log('광고 보여주기 요청 완료');
|
|
1001
|
+
* break;
|
|
839
1002
|
*
|
|
840
1003
|
* case 'clicked':
|
|
841
1004
|
* console.log('광고 클릭');
|
|
@@ -843,6 +1006,7 @@ type ShowAdMobRewardedAdParams = AdMobHandlerParams<ShowAdMobRewardedAdOptions,
|
|
|
843
1006
|
*
|
|
844
1007
|
* case 'dismissed':
|
|
845
1008
|
* console.log('광고 닫힘');
|
|
1009
|
+
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
846
1010
|
* break;
|
|
847
1011
|
*
|
|
848
1012
|
* case 'failedToShow':
|
|
@@ -853,37 +1017,157 @@ type ShowAdMobRewardedAdParams = AdMobHandlerParams<ShowAdMobRewardedAdOptions,
|
|
|
853
1017
|
* console.log('광고 노출');
|
|
854
1018
|
* break;
|
|
855
1019
|
*
|
|
856
|
-
* case '
|
|
857
|
-
* console.log('광고
|
|
1020
|
+
* case 'userEarnedReward':
|
|
1021
|
+
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
1022
|
+
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
858
1023
|
* break;
|
|
859
1024
|
*
|
|
860
|
-
* case '
|
|
861
|
-
* console.log('
|
|
1025
|
+
* case 'show':
|
|
1026
|
+
* console.log('광고 컨텐츠 보여졌음');
|
|
862
1027
|
* break;
|
|
863
1028
|
* }
|
|
864
1029
|
* },
|
|
865
1030
|
* onError: (error) => {
|
|
866
|
-
* console.error('광고
|
|
1031
|
+
* console.error('광고 보여주기 실패', error);
|
|
867
1032
|
* },
|
|
868
1033
|
* });
|
|
869
|
-
*
|
|
870
|
-
* return cleanup;
|
|
871
1034
|
* }, []);
|
|
872
1035
|
*
|
|
873
|
-
*
|
|
874
|
-
* if (GoogleAdMob.showAdMobRewardedAd.isSupported() !== true) {
|
|
875
|
-
* return;
|
|
876
|
-
* }
|
|
1036
|
+
* useFocusEffect(loadAd);
|
|
877
1037
|
*
|
|
878
|
-
*
|
|
879
|
-
*
|
|
880
|
-
*
|
|
881
|
-
*
|
|
882
|
-
*
|
|
883
|
-
*
|
|
1038
|
+
* return (
|
|
1039
|
+
* <View>
|
|
1040
|
+
* <Text>
|
|
1041
|
+
* {adLoadStatus === 'not_loaded' && '광고 로드 하지 않음 '}
|
|
1042
|
+
* {adLoadStatus === 'loaded' && '광고 로드 완료'}
|
|
1043
|
+
* {adLoadStatus === 'failed' && '광고 로드 실패'}
|
|
1044
|
+
* </Text>
|
|
1045
|
+
*
|
|
1046
|
+
* <Button title="Show Ad" onPress={showAd} disabled={adLoadStatus !== 'loaded'} />
|
|
1047
|
+
* </View>
|
|
1048
|
+
* );
|
|
1049
|
+
* }
|
|
1050
|
+
* ```
|
|
1051
|
+
*/
|
|
1052
|
+
declare function showAdMobRewardedAd(params: ShowAdMobRewardedAdParams): () => void;
|
|
1053
|
+
declare namespace showAdMobRewardedAd {
|
|
1054
|
+
var isSupported: () => boolean;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
interface LoadAdMobOptions {
|
|
1058
|
+
/**
|
|
1059
|
+
* 광고 그룹 단위 ID
|
|
1060
|
+
*/
|
|
1061
|
+
adGroupId: string;
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* @public
|
|
1065
|
+
* @category 광고
|
|
1066
|
+
* @name LoadAdMobEvent
|
|
1067
|
+
* @description 광고를 불러오는 함수에서 발생하는 이벤트 타입이에요. `loaded` 이벤트가 발생하면 광고를 성공적으로 불러온 거예요. 이때 [AdMobLoadResult](/react-native/reference/framework/광고/AdMobLoadResult.html) 객체가 함께 반환돼요.
|
|
1068
|
+
*/
|
|
1069
|
+
type LoadAdMobEvent = {
|
|
1070
|
+
type: 'loaded';
|
|
1071
|
+
data: AdMobLoadResult;
|
|
1072
|
+
};
|
|
1073
|
+
/**
|
|
1074
|
+
* @public
|
|
1075
|
+
* @category 광고
|
|
1076
|
+
* @name LoadAdMobParams
|
|
1077
|
+
* @description 광고를 불러오는 함수에 필요한 옵션 객체예요.
|
|
1078
|
+
*/
|
|
1079
|
+
type LoadAdMobParams = AdMobHandlerParams<LoadAdMobOptions, LoadAdMobEvent>;
|
|
1080
|
+
/**
|
|
1081
|
+
* @public
|
|
1082
|
+
* @category 광고
|
|
1083
|
+
* @name loadAppsInTossAdMob
|
|
1084
|
+
* @description 광고를 미리 불러와서, 광고가 필요한 시점에 바로 보여줄 수 있도록 준비하는 함수예요.
|
|
1085
|
+
* @param {LoadAdMobParams} params 광고를 불러올 때 사용할 설정 값이에요. 광고 그룹 ID와 광고의 동작에 대한 콜백을 설정할 수 있어요.
|
|
1086
|
+
* @param {LoadAdMobOptions} params.options 광고를 불러올 때 전달할 옵션 객체예요.
|
|
1087
|
+
* @param {string} params.options.adGroupId 광고 그룹 단위 ID예요. 콘솔에서 발급받은 ID를 입력해요.
|
|
1088
|
+
* @param {(event: LoadAdMobEvent) => void} [params.onEvent] 광고 관련 이벤트가 발생했을 때 호출돼요. (예시: 광고가 닫히거나 클릭됐을 때). 자세한 이벤트 타입은 [LoadAdMobEvent](/react-native/reference/framework/광고/LoadAdMobEvent.html)를 참고하세요.
|
|
1089
|
+
* @param {(reason: unknown) => void} [params.onError] 광고를 불러오지 못했을 때 호출돼요. (예시: 네트워크 오류나 지원하지 않는 환경일 때)
|
|
1090
|
+
* @property {() => boolean} [isSupported] 현재 실행 중인 앱(예: 토스 앱, 개발용 샌드박스 앱 등)에서 Google AdMob 광고 기능을 지원하는지 확인하는 함수예요. 기능을 사용하기 전에 지원 여부를 확인해야 해요.
|
|
1091
|
+
*
|
|
1092
|
+
* @example
|
|
1093
|
+
* ### 버튼 눌러 불러온 광고 보여주기
|
|
1094
|
+
* ```tsx
|
|
1095
|
+
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
1096
|
+
* import { useFocusEffect } from '@react-native-bedrock/native/@react-navigation/native';
|
|
1097
|
+
* import { useCallback, useState } from 'react';
|
|
1098
|
+
* import { Button, Text, View } from 'react-native';
|
|
1099
|
+
* import { useNavigation } from 'react-native-bedrock';
|
|
1100
|
+
*
|
|
1101
|
+
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
1102
|
+
*
|
|
1103
|
+
* export function GoogleAdmobExample() {
|
|
1104
|
+
* const [adLoadStatus, setAdLoadStatus] = useState<'not_loaded' | 'loaded' | 'failed'>('not_loaded');
|
|
1105
|
+
* const navigation = useNavigation();
|
|
1106
|
+
*
|
|
1107
|
+
* const loadAd = useCallback(() => {
|
|
1108
|
+
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
1109
|
+
* return;
|
|
1110
|
+
* }
|
|
1111
|
+
|
|
1112
|
+
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
1113
|
+
* options: {
|
|
1114
|
+
* adGroupId: AD_GROUP_ID,
|
|
1115
|
+
* },
|
|
1116
|
+
* onEvent: (event) => {
|
|
1117
|
+
* switch (event.type) {
|
|
1118
|
+
* case 'loaded':
|
|
1119
|
+
* console.log('광고 로드 성공', event.data);
|
|
1120
|
+
* setAdLoadStatus('loaded');
|
|
1121
|
+
* break;
|
|
1122
|
+
* }
|
|
1123
|
+
* },
|
|
1124
|
+
* onError: (error) => {
|
|
1125
|
+
* console.error('광고 불러오기 실패', error);
|
|
1126
|
+
* },
|
|
1127
|
+
* });
|
|
1128
|
+
*
|
|
1129
|
+
* return cleanup;
|
|
1130
|
+
* }, [navigation]);
|
|
1131
|
+
*
|
|
1132
|
+
* const showAd = useCallback(() => {
|
|
1133
|
+
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
1134
|
+
* return;
|
|
1135
|
+
* }
|
|
1136
|
+
*
|
|
1137
|
+
* GoogleAdMob.showAppsInTossAdMob({
|
|
1138
|
+
* options: {
|
|
1139
|
+
* adGroupId: AD_GROUP_ID,
|
|
1140
|
+
* },
|
|
1141
|
+
* onEvent: (event) => {
|
|
1142
|
+
* switch (event.type) {
|
|
884
1143
|
* case 'requested':
|
|
885
1144
|
* console.log('광고 보여주기 요청 완료');
|
|
886
|
-
*
|
|
1145
|
+
* break;
|
|
1146
|
+
*
|
|
1147
|
+
* case 'clicked':
|
|
1148
|
+
* console.log('광고 클릭');
|
|
1149
|
+
* break;
|
|
1150
|
+
*
|
|
1151
|
+
* case 'dismissed':
|
|
1152
|
+
* console.log('광고 닫힘');
|
|
1153
|
+
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
1154
|
+
* break;
|
|
1155
|
+
*
|
|
1156
|
+
* case 'failedToShow':
|
|
1157
|
+
* console.log('광고 보여주기 실패');
|
|
1158
|
+
* break;
|
|
1159
|
+
*
|
|
1160
|
+
* case 'impression':
|
|
1161
|
+
* console.log('광고 노출');
|
|
1162
|
+
* break;
|
|
1163
|
+
*
|
|
1164
|
+
* case 'userEarnedReward':
|
|
1165
|
+
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
1166
|
+
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
1167
|
+
* break;
|
|
1168
|
+
*
|
|
1169
|
+
* case 'show':
|
|
1170
|
+
* console.log('광고 컨텐츠 보여졌음');
|
|
887
1171
|
* break;
|
|
888
1172
|
* }
|
|
889
1173
|
* },
|
|
@@ -893,6 +1177,8 @@ type ShowAdMobRewardedAdParams = AdMobHandlerParams<ShowAdMobRewardedAdOptions,
|
|
|
893
1177
|
* });
|
|
894
1178
|
* }, []);
|
|
895
1179
|
*
|
|
1180
|
+
* useFocusEffect(loadAd);
|
|
1181
|
+
*
|
|
896
1182
|
* return (
|
|
897
1183
|
* <View>
|
|
898
1184
|
* <Text>
|
|
@@ -901,15 +1187,156 @@ type ShowAdMobRewardedAdParams = AdMobHandlerParams<ShowAdMobRewardedAdOptions,
|
|
|
901
1187
|
* {adLoadStatus === 'failed' && '광고 로드 실패'}
|
|
902
1188
|
* </Text>
|
|
903
1189
|
*
|
|
904
|
-
* <Button title="Load Ad" onPress={loadAd} />
|
|
905
1190
|
* <Button title="Show Ad" onPress={showAd} disabled={adLoadStatus !== 'loaded'} />
|
|
906
1191
|
* </View>
|
|
907
1192
|
* );
|
|
908
1193
|
* }
|
|
909
1194
|
* ```
|
|
910
1195
|
*/
|
|
911
|
-
declare function
|
|
912
|
-
declare namespace
|
|
1196
|
+
declare function loadAppsInTossAdMob(params: LoadAdMobParams): () => void;
|
|
1197
|
+
declare namespace loadAppsInTossAdMob {
|
|
1198
|
+
var isSupported: () => boolean;
|
|
1199
|
+
}
|
|
1200
|
+
interface ShowAdMobOptions {
|
|
1201
|
+
/**
|
|
1202
|
+
* 광고 그룹 단위 ID
|
|
1203
|
+
*/
|
|
1204
|
+
adGroupId: string;
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* @public
|
|
1208
|
+
* @category 광고
|
|
1209
|
+
* @name ShowAdMobEvent
|
|
1210
|
+
* @description 광고를 보여주는 함수에서 발생하는 이벤트 타입이에요. `requested` 이벤트가 발생하면 광고 노출 요청이 Google AdMob에 성공적으로 전달된 거예요.
|
|
1211
|
+
*/
|
|
1212
|
+
type ShowAdMobEvent = AdMobFullScreenEvent | AdUserEarnedReward | {
|
|
1213
|
+
type: 'requested';
|
|
1214
|
+
};
|
|
1215
|
+
/**
|
|
1216
|
+
* @public
|
|
1217
|
+
* @category 광고
|
|
1218
|
+
* @name ShowAdMobParams
|
|
1219
|
+
* @description 불러온 광고를 보여주는 함수에 필요한 옵션 객체예요.
|
|
1220
|
+
*/
|
|
1221
|
+
type ShowAdMobParams = AdMobHandlerParams<ShowAdMobOptions, ShowAdMobEvent>;
|
|
1222
|
+
/**
|
|
1223
|
+
* @public
|
|
1224
|
+
* @category 광고
|
|
1225
|
+
* @name showAppsInTossAdMob
|
|
1226
|
+
* @description 광고를 사용자에게 노출해요. 이 함수는 `loadAppsInTossAdMob` 로 미리 불러온 광고를 실제로 사용자에게 노출해요.
|
|
1227
|
+
* @param {ShowAdMobParams} params 광고를 보여주기 위해 사용할 설정 값이에요. 광고 그룹 ID와과 광고의 동작에 대한 콜백을 설정할 수 있어요.
|
|
1228
|
+
* @param {ShowAdMobOptions} params.options 광고를 보여줄 때 전달할 옵션 객체예요.
|
|
1229
|
+
* @param {string} params.options.adUnitId 광고 그룹 단위 ID예요. `loadAppsInTossAdMob` 로 불러온 광고용 그룹 ID를 입력해요.
|
|
1230
|
+
* @param {(event: ShowAdMobEvent) => void} [params.onEvent] 광고 관련 이벤트가 발생했을 때 호출돼요. (예시: 광고 노출을 요청했을 때). 자세한 이벤트 타입은 [ShowAdMobEvent](/react-native/reference/framework/광고/ShowAdMobEvent.html)를 참고하세요.
|
|
1231
|
+
* @param {(reason: unknown) => void} [params.onError] 광고를 노출하지 못했을 때 호출돼요. (예시: 네트워크 오류나 지원하지 않는 환경일 때)
|
|
1232
|
+
* @property {() => boolean} [isSupported] 현재 실행 중인 앱(예: 토스 앱, 개발용 샌드박스 앱 등)에서 Google AdMob 광고 기능을 지원하는지 확인하는 함수예요. 기능을 사용하기 전에 지원 여부를 확인해야 해요.
|
|
1233
|
+
*
|
|
1234
|
+
* @example
|
|
1235
|
+
* ### 버튼 눌러 불러온 광고 보여주기
|
|
1236
|
+
* ```tsx
|
|
1237
|
+
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
1238
|
+
* import { useFocusEffect } from '@react-native-bedrock/native/@react-navigation/native';
|
|
1239
|
+
* import { useCallback, useState } from 'react';
|
|
1240
|
+
* import { Button, Text, View } from 'react-native';
|
|
1241
|
+
* import { useNavigation } from 'react-native-bedrock';
|
|
1242
|
+
*
|
|
1243
|
+
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
1244
|
+
*
|
|
1245
|
+
* export function GoogleAdmobExample() {
|
|
1246
|
+
* const [adLoadStatus, setAdLoadStatus] = useState<'not_loaded' | 'loaded' | 'failed'>('not_loaded');
|
|
1247
|
+
* const navigation = useNavigation();
|
|
1248
|
+
*
|
|
1249
|
+
* const loadAd = useCallback(() => {
|
|
1250
|
+
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
1251
|
+
* return;
|
|
1252
|
+
* }
|
|
1253
|
+
|
|
1254
|
+
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
1255
|
+
* options: {
|
|
1256
|
+
* adGroupId: AD_GROUP_ID,
|
|
1257
|
+
* },
|
|
1258
|
+
* onEvent: (event) => {
|
|
1259
|
+
* switch (event.type) {
|
|
1260
|
+
* case 'loaded':
|
|
1261
|
+
* console.log('광고 로드 성공', event.data);
|
|
1262
|
+
* setAdLoadStatus('loaded');
|
|
1263
|
+
* break;
|
|
1264
|
+
* }
|
|
1265
|
+
* },
|
|
1266
|
+
* onError: (error) => {
|
|
1267
|
+
* console.error('광고 불러오기 실패', error);
|
|
1268
|
+
* },
|
|
1269
|
+
* });
|
|
1270
|
+
*
|
|
1271
|
+
* return cleanup;
|
|
1272
|
+
* }, [navigation]);
|
|
1273
|
+
*
|
|
1274
|
+
* const showAd = useCallback(() => {
|
|
1275
|
+
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
1276
|
+
* return;
|
|
1277
|
+
* }
|
|
1278
|
+
*
|
|
1279
|
+
* GoogleAdMob.showAppsInTossAdMob({
|
|
1280
|
+
* options: {
|
|
1281
|
+
* adGroupId: AD_GROUP_ID,
|
|
1282
|
+
* },
|
|
1283
|
+
* onEvent: (event) => {
|
|
1284
|
+
* switch (event.type) {
|
|
1285
|
+
* case 'requested':
|
|
1286
|
+
* console.log('광고 보여주기 요청 완료');
|
|
1287
|
+
* break;
|
|
1288
|
+
*
|
|
1289
|
+
* case 'clicked':
|
|
1290
|
+
* console.log('광고 클릭');
|
|
1291
|
+
* break;
|
|
1292
|
+
*
|
|
1293
|
+
* case 'dismissed':
|
|
1294
|
+
* console.log('광고 닫힘');
|
|
1295
|
+
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
1296
|
+
* break;
|
|
1297
|
+
*
|
|
1298
|
+
* case 'failedToShow':
|
|
1299
|
+
* console.log('광고 보여주기 실패');
|
|
1300
|
+
* break;
|
|
1301
|
+
*
|
|
1302
|
+
* case 'impression':
|
|
1303
|
+
* console.log('광고 노출');
|
|
1304
|
+
* break;
|
|
1305
|
+
*
|
|
1306
|
+
* case 'userEarnedReward':
|
|
1307
|
+
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
1308
|
+
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
1309
|
+
* break;
|
|
1310
|
+
*
|
|
1311
|
+
* case 'show':
|
|
1312
|
+
* console.log('광고 컨텐츠 보여졌음');
|
|
1313
|
+
* break;
|
|
1314
|
+
* }
|
|
1315
|
+
* },
|
|
1316
|
+
* onError: (error) => {
|
|
1317
|
+
* console.error('광고 보여주기 실패', error);
|
|
1318
|
+
* },
|
|
1319
|
+
* });
|
|
1320
|
+
* }, []);
|
|
1321
|
+
*
|
|
1322
|
+
* useFocusEffect(loadAd);
|
|
1323
|
+
*
|
|
1324
|
+
* return (
|
|
1325
|
+
* <View>
|
|
1326
|
+
* <Text>
|
|
1327
|
+
* {adLoadStatus === 'not_loaded' && '광고 로드 하지 않음 '}
|
|
1328
|
+
* {adLoadStatus === 'loaded' && '광고 로드 완료'}
|
|
1329
|
+
* {adLoadStatus === 'failed' && '광고 로드 실패'}
|
|
1330
|
+
* </Text>
|
|
1331
|
+
*
|
|
1332
|
+
* <Button title="Show Ad" onPress={showAd} disabled={adLoadStatus !== 'loaded'} />
|
|
1333
|
+
* </View>
|
|
1334
|
+
* );
|
|
1335
|
+
* }
|
|
1336
|
+
* ```
|
|
1337
|
+
*/
|
|
1338
|
+
declare function showAppsInTossAdMob(params: ShowAdMobParams): () => void;
|
|
1339
|
+
declare namespace showAppsInTossAdMob {
|
|
913
1340
|
var isSupported: () => boolean;
|
|
914
1341
|
}
|
|
915
1342
|
|
|
@@ -1177,7 +1604,7 @@ interface GetCurrentLocationOptions {
|
|
|
1177
1604
|
*
|
|
1178
1605
|
* @param {GetCurrentLocationOptions} options 위치 정보를 가져올 때 사용하는 옵션 객체예요.
|
|
1179
1606
|
* @param {Accuracy} [options.accuracy] 위치 정보의 정확도 수준이에요. 정확도는 `Accuracy` 타입으로 설정돼요.
|
|
1180
|
-
* @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/react-native/reference/
|
|
1607
|
+
* @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/react-native/reference/native-modules/Types/Location.html)을 참고해주세요.
|
|
1181
1608
|
*
|
|
1182
1609
|
* @example
|
|
1183
1610
|
* ### 디바이스의 현재 위치 정보 가져오기
|
|
@@ -1215,46 +1642,288 @@ interface GetCurrentLocationOptions {
|
|
|
1215
1642
|
*/
|
|
1216
1643
|
declare function getCurrentLocation(options: GetCurrentLocationOptions): Promise<Location>;
|
|
1217
1644
|
|
|
1218
|
-
interface OpenCameraOptions {
|
|
1219
|
-
/**
|
|
1220
|
-
* 이미지를 Base64 형식으로 반환할지 여부를 나타내는 불리언 값이에요.
|
|
1221
|
-
*
|
|
1222
|
-
* 기본값: `false`.
|
|
1223
|
-
*/
|
|
1224
|
-
base64?: boolean;
|
|
1225
|
-
/**
|
|
1226
|
-
* 이미지의 최대 너비를 나타내는 숫자 값이에요.
|
|
1227
|
-
*
|
|
1228
|
-
* 기본값: `1024`.
|
|
1229
|
-
*/
|
|
1230
|
-
maxWidth?: number;
|
|
1231
|
-
}
|
|
1232
1645
|
/**
|
|
1233
|
-
* @
|
|
1234
|
-
* @
|
|
1235
|
-
* @
|
|
1236
|
-
*
|
|
1237
|
-
*
|
|
1238
|
-
* @
|
|
1239
|
-
* @
|
|
1240
|
-
* @
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1646
|
+
* @category 게임센터
|
|
1647
|
+
* @name GameCenterGameProfileResponse
|
|
1648
|
+
* @description 토스게임센터 프로필을 가져온 결과 타입이에요.
|
|
1649
|
+
* 앱에 프로필이 없는 경우, `statusCode`가 `'PROFILE_NOT_FOUND'`이고 다른 정보는 없어요.
|
|
1650
|
+
* 프로필이 있는 경우 `statusCode`가 `'SUCCESS'`이고, 닉네임과 프로필 이미지 주소가 함께 제공돼요.
|
|
1651
|
+
* @property {string} statusCode 프로필 조회 결과 상태예요. `'SUCCESS'` 또는 `'PROFILE_NOT_FOUND'` 중 하나예요.
|
|
1652
|
+
* @property {string} [nickname] 프로필 닉네임이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
|
|
1653
|
+
* @property {string} [profileImageUri] 프로필 이미지 URL이에요. `statusCode`가 `'SUCCESS'`일 때만 있어요.
|
|
1654
|
+
*/
|
|
1655
|
+
type GameCenterGameProfileResponse = {
|
|
1656
|
+
statusCode: 'PROFILE_NOT_FOUND';
|
|
1657
|
+
} | {
|
|
1658
|
+
statusCode: 'SUCCESS';
|
|
1659
|
+
nickname: string;
|
|
1660
|
+
profileImageUri: string;
|
|
1661
|
+
};
|
|
1662
|
+
/**
|
|
1663
|
+
* @category 게임센터
|
|
1664
|
+
* @name getGameCenterGameProfile
|
|
1665
|
+
* @description 토스게임센터 프로필 정보를 가져와요.
|
|
1666
|
+
* 사용자가 프로필을 만들지 않았다면 `statusCode`가 `'PROFILE_NOT_FOUND'`인 응답이 반환돼요.
|
|
1667
|
+
* 앱 버전이 최소 지원 버전(안드로이드 5.221.0, iOS 5.221.0)보다 낮으면 `undefined`를 반환해요.
|
|
1668
|
+
* @returns {Promise<GameCenterGameProfileResponse | undefined>} 프로필 정보 또는 `undefined`를 반환해요.
|
|
1244
1669
|
*
|
|
1245
1670
|
* @example
|
|
1246
|
-
* ###
|
|
1247
|
-
*
|
|
1671
|
+
* ### 게임센터 프로필 가져오기
|
|
1248
1672
|
* ```tsx
|
|
1249
|
-
* import
|
|
1250
|
-
* import {
|
|
1251
|
-
* import {
|
|
1673
|
+
* import { getGameCenterGameProfile } from './getGameCenterGameProfile';
|
|
1674
|
+
* import { useState } from 'react';
|
|
1675
|
+
* import { View, Button } from 'react-native';
|
|
1252
1676
|
*
|
|
1253
|
-
*
|
|
1677
|
+
* function GameProfile() {
|
|
1678
|
+
* const [profile, setProfile] = useState<GameCenterGameProfileResponse | null>(null);
|
|
1254
1679
|
*
|
|
1255
|
-
*
|
|
1256
|
-
*
|
|
1257
|
-
*
|
|
1680
|
+
* const handlePress = async () => {
|
|
1681
|
+
* try {
|
|
1682
|
+
* const result = await getGameCenterGameProfile();
|
|
1683
|
+
* if (result) {
|
|
1684
|
+
* setProfile(result);
|
|
1685
|
+
* }
|
|
1686
|
+
* } catch (error) {
|
|
1687
|
+
* console.error('게임센터 프로필 가져오기에 실패했어요.', error);
|
|
1688
|
+
* }
|
|
1689
|
+
* };
|
|
1690
|
+
*
|
|
1691
|
+
* return (
|
|
1692
|
+
* <View>
|
|
1693
|
+
* <Button title="게임센터 프로필 가져오기" onPress={handlePress} />
|
|
1694
|
+
* </View>
|
|
1695
|
+
* );
|
|
1696
|
+
* }
|
|
1697
|
+
* ```
|
|
1698
|
+
*/
|
|
1699
|
+
declare function getGameCenterGameProfile(): Promise<GameCenterGameProfileResponse | undefined>;
|
|
1700
|
+
|
|
1701
|
+
/**
|
|
1702
|
+
* @public
|
|
1703
|
+
* @category 인앱결제
|
|
1704
|
+
* @name IapCreateOneTimePurchaseOrderOptions
|
|
1705
|
+
* @description 인앱결제 1건을 요청할 때 필요한 정보예요.
|
|
1706
|
+
* @property {string} productId - 주문할 상품의 ID예요.
|
|
1707
|
+
*/
|
|
1708
|
+
interface IapCreateOneTimePurchaseOrderOptions {
|
|
1709
|
+
productId: string;
|
|
1710
|
+
}
|
|
1711
|
+
/**
|
|
1712
|
+
* @public
|
|
1713
|
+
* @category 인앱결제
|
|
1714
|
+
* @name IapCreateOneTimePurchaseOrderResult
|
|
1715
|
+
* @description 인앱결제 1건이 완료되면 결제 세부 정보와 상품 정보를 담아 반환해요. 반환된 정보로 결제한 상품의 정보를 화면에 표시할 수 있어요.
|
|
1716
|
+
* @property {string} orderId - 결제 주문 ID이에요. 결제 완료 후 [결제 상태를 조회](https://developers-apps-in-toss.toss.im/api/getIapOrderStatus.html)할 때 사용해요.
|
|
1717
|
+
* @property {string} displayName - 화면에 표시할 상품 이름이에요.
|
|
1718
|
+
* @property {string} displayAmount - 통화 단위가 포함된 가격 정보예요. 예를 들어 `1,000원`으로 가격과 통화가 함께 표시돼요.
|
|
1719
|
+
* @property {number} amount - 상품 가격 숫자 값이에요. 화폐 단위와 쉼표를 제외한 순수 숫자예요. 예를 들어 `1000`으로 표시돼요.
|
|
1720
|
+
* @property {string} currency - [ISO 4217 표준](https://ko.wikipedia.org/wiki/ISO_4217)에 따른 상품 가격 통화 단위예요. 예를 들어 원화는 `KRW`, 달러는 `USD`로 표시돼요.
|
|
1721
|
+
* @property {number} fraction - 가격을 표시할 때 소수점 아래 몇 자리까지 보여줄지 정하는 값이에요. 예를 들어 달러는 소수점 둘째 자리까지 보여줘서 `2`, 원화는 소수점이 필요 없어서 `0`이에요
|
|
1722
|
+
* @property {string | null} miniAppIconUrl - 미니앱 아이콘 이미지의 URL이에요. 아이콘은 앱인토스 콘솔에서 설정한 이미지예요. 콘솔에서 아이콘을 등록하지 않았다면 `null`로 반환돼요.
|
|
1723
|
+
*/
|
|
1724
|
+
interface IapCreateOneTimePurchaseOrderResult {
|
|
1725
|
+
orderId: string;
|
|
1726
|
+
displayName: string;
|
|
1727
|
+
displayAmount: string;
|
|
1728
|
+
amount: number;
|
|
1729
|
+
currency: string;
|
|
1730
|
+
fraction: number;
|
|
1731
|
+
miniAppIconUrl: string | null;
|
|
1732
|
+
}
|
|
1733
|
+
/**
|
|
1734
|
+
* @public
|
|
1735
|
+
* @category 인앱결제
|
|
1736
|
+
* @name iapCreateOneTimePurchaseOrder
|
|
1737
|
+
* @description
|
|
1738
|
+
* 특정 인앱결제 주문서 페이지로 이동해요. 사용자가 상품 구매 버튼을 누르는 상황 등에 사용할 수 있어요. 사용자의 결제는 이동한 페이지에서 진행돼요. 만약 결제 중에 에러가 발생하면 에러 유형에 따라 에러 페이지로 이동해요.
|
|
1739
|
+
* @param {IapCreateOneTimePurchaseOrderOptions} params - 인앱결제를 생성할 때 필요한 정보예요.
|
|
1740
|
+
* @param {string} params.productId - 주문할 상품의 ID예요.
|
|
1741
|
+
* @returns {Promise<IapCreateOneTimePurchaseOrderResult | undefined>} 결제에 성공하면 결제 결과 객체를 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.219.0, iOS 5.219.0)보다 낮으면 인앱결제를 실행할 수 없어서 `undefined`를 반환해요.
|
|
1742
|
+
*
|
|
1743
|
+
* @throw {code: "INVALID_PRODUCT_ID"} - 유효하지 않은 상품 ID이거나, 해당 상품이 존재하지 않을 때 발생해요.
|
|
1744
|
+
* @throw {code: "PAYMENT_PENDING"} - 사용자가 요청한 결제가 아직 승인을 기다리고 있을 때 발생해요.
|
|
1745
|
+
* @throw {code: "NETWORK_ERROR"} - 서버 내부 문제로 요청을 처리할 수 없을 때 발생해요.
|
|
1746
|
+
* @throw {code: "INVALID_USER_ENVIRONMENT"} - 특정 기기, 계정 또는 설정 환경에서 구매할 수 없는 상품일 때 발생해요.
|
|
1747
|
+
* @throw {code: "ITEM_ALREADY_OWNED"} - 사용자가 이미 구매한 상품을 다시 구매하려고 할 때 발생해요.
|
|
1748
|
+
* @throw {code: "APP_MARKET_VERIFICATION_FAILED"} - 사용자가 결제를 완료했지만, 앱스토어에서 사용자 정보 검증에 실패했을 때 발생해요. 사용자가 앱스토어에 문의해서 환불을 요청해야해요.
|
|
1749
|
+
* @throw {code: "TOSS_SERVER_VERIFICATION_FAILED"} - 사용자가 결제를 완료했지만, 서버 전송에 실패해서 결제 정보를 저장할 수 없을 때 발생해요.
|
|
1750
|
+
* @throw {code: "INTERNAL_ERROR"} - 서버 내부 문제로 요청을 처리할 수 없을 때 발생해요.
|
|
1751
|
+
* @throw {code: "KOREAN_ACCOUNT_ONLY"} - iOS 환경에서 사용자의 계정이 한국 계정이 아닐 때 발생해요.
|
|
1752
|
+
* @throw {code: "USER_CANCELED"} - 사용자가 결제를 완료하지 않고 주문서 페이지를 이탈했을 때 발생해요.
|
|
1753
|
+
*
|
|
1754
|
+
* @example
|
|
1755
|
+
* ### 특정 인앱결제 주문서 페이지로 이동하기
|
|
1756
|
+
*
|
|
1757
|
+
* ```tsx
|
|
1758
|
+
* import { IAP } from "@apps-in-toss/web-framework";
|
|
1759
|
+
* import { Button } from "@toss-design-system/react-native";
|
|
1760
|
+
*
|
|
1761
|
+
* interface Props {
|
|
1762
|
+
* productId: string;
|
|
1763
|
+
* }
|
|
1764
|
+
*
|
|
1765
|
+
* function IapCreateOneTimePurchaseOrderButton({ productId }: Props) {
|
|
1766
|
+
* async function handleClick() {
|
|
1767
|
+
* try {
|
|
1768
|
+
* await IAP.createOneTimePurchaseOrder({
|
|
1769
|
+
* productId,
|
|
1770
|
+
* });
|
|
1771
|
+
* console.error("인앱결제에 성공했어요");
|
|
1772
|
+
* } catch (error) {
|
|
1773
|
+
* console.error('인앱결제에 실패했어요:', error);
|
|
1774
|
+
* }
|
|
1775
|
+
* }
|
|
1776
|
+
*
|
|
1777
|
+
* return <Button onClick={handleClick}>구매하기</Button>;
|
|
1778
|
+
* }
|
|
1779
|
+
* ```
|
|
1780
|
+
*/
|
|
1781
|
+
declare function createOneTimePurchaseOrder(params: IapCreateOneTimePurchaseOrderOptions): Promise<IapCreateOneTimePurchaseOrderResult | undefined>;
|
|
1782
|
+
/**
|
|
1783
|
+
* @public
|
|
1784
|
+
* @category 인앱결제
|
|
1785
|
+
* @name IapProductListItem
|
|
1786
|
+
* @description 인앱결제로 구매할 수 있는 상품 하나의 정보를 담은 객체예요. 상품 목록을 화면에 표시할 때 사용해요.
|
|
1787
|
+
* @property {string} sku - 상품의 고유 ID예요. [IAP.createOneTimePurchaseOrder](https://developers-apps-in-toss.toss.im/bedrock/reference/native-modules/%EC%9D%B8%EC%95%B1%20%EA%B2%B0%EC%A0%9C/createOneTimePurchaseOrder.html)를 호출할때 사용하는 `productId`와 동일한 값이에요.
|
|
1788
|
+
* @property {string} displayName - 화면에 표시할 상품 이름이에요. 상품 이름은 앱인토스 콘솔에서 설정한 값이에요.
|
|
1789
|
+
* @property {string} displayAmount - 통화 단위가 포함된 가격 정보예요. 예를 들어 `1,000원`으로 가격과 통화가 함께 표시돼요.
|
|
1790
|
+
* @property {string} iconUrl - 상품 아이콘 이미지의 URL이에요. 아이콘은 앱인토스 콘솔에서 설정한 이미지예요.
|
|
1791
|
+
* @property {string} description - 상품에 대한 설명이에요. 설명은 앱인토스 콘솔에서 설정한 값이에요.
|
|
1792
|
+
*/
|
|
1793
|
+
interface IapProductListItem {
|
|
1794
|
+
sku: string;
|
|
1795
|
+
displayAmount: string;
|
|
1796
|
+
displayName: string;
|
|
1797
|
+
iconUrl: string;
|
|
1798
|
+
description: string;
|
|
1799
|
+
}
|
|
1800
|
+
/**
|
|
1801
|
+
* @public
|
|
1802
|
+
* @category 인앱결제
|
|
1803
|
+
* @name iapGetProductItemList
|
|
1804
|
+
* @description 인앱결제로 구매할 수 있는 상품 목록을 가져와요. 상품 목록 화면에 진입할 때 호출해요.
|
|
1805
|
+
* @returns {Promise<{ products: IapProductListItem[] } | undefined>} 상품 목록을 포함한 객체를 반환해요. 앱 버전이 최소 지원 버전(안드로이드 5.219.0, iOS 5.219.0)보다 낮으면 `undefined`를 반환해요.
|
|
1806
|
+
*
|
|
1807
|
+
* @example
|
|
1808
|
+
* ### 구매 가능한 인앱결제 상품목록 가져오기
|
|
1809
|
+
*
|
|
1810
|
+
* ```tsx
|
|
1811
|
+
* import { IAP, IapProductListItem } from "@apps-in-toss/framework";
|
|
1812
|
+
* import { Button, List, ListRow } from "@toss-design-system/react-native";
|
|
1813
|
+
* import { useEffect, useState } from "react";
|
|
1814
|
+
*
|
|
1815
|
+
* function IapProductList() {
|
|
1816
|
+
* const [products, setProducts] = useState<IapProductListItem[]>([]);
|
|
1817
|
+
*
|
|
1818
|
+
* async function buyIapProduct(productId: string) {
|
|
1819
|
+
* try {
|
|
1820
|
+
* await IAP.createOneTimePurchaseOrder({
|
|
1821
|
+
* productId,
|
|
1822
|
+
* });
|
|
1823
|
+
*
|
|
1824
|
+
* console.error("인앱결제에 성공했어요");
|
|
1825
|
+
* } catch (error) {
|
|
1826
|
+
* console.error("인앱결제에 실패했어요:", error);
|
|
1827
|
+
* }
|
|
1828
|
+
* }
|
|
1829
|
+
*
|
|
1830
|
+
* useEffect(() => {
|
|
1831
|
+
* async function fetchProducts() {
|
|
1832
|
+
* try {
|
|
1833
|
+
* const response = await IAP.getProductItemList();
|
|
1834
|
+
* setProducts(response?.products ?? []);
|
|
1835
|
+
* } catch (error) {
|
|
1836
|
+
* console.error("상품 목록을 가져오는 데 실패했어요:", error);
|
|
1837
|
+
* }
|
|
1838
|
+
* }
|
|
1839
|
+
*
|
|
1840
|
+
* fetchProducts();
|
|
1841
|
+
* }, []);
|
|
1842
|
+
*
|
|
1843
|
+
* return (
|
|
1844
|
+
* <List>
|
|
1845
|
+
* {products.map((product) => (
|
|
1846
|
+
* <ListRow
|
|
1847
|
+
* key={product.sku}
|
|
1848
|
+
* left={
|
|
1849
|
+
* <ListRow.Image type="square" source={{ uri: product.iconUrl }} />
|
|
1850
|
+
* }
|
|
1851
|
+
* right={
|
|
1852
|
+
* <Button size="medium" onPress={() => buyIapProduct(product.sku)}>
|
|
1853
|
+
* 구매하기
|
|
1854
|
+
* </Button>
|
|
1855
|
+
* }
|
|
1856
|
+
* contents={
|
|
1857
|
+
* <ListRow.Texts
|
|
1858
|
+
* type="3RowTypeA"
|
|
1859
|
+
* top={product.displayName}
|
|
1860
|
+
* middle={product.description}
|
|
1861
|
+
* bottom={product.displayAmount}
|
|
1862
|
+
* />
|
|
1863
|
+
* }
|
|
1864
|
+
* />
|
|
1865
|
+
* ))}
|
|
1866
|
+
* </List>
|
|
1867
|
+
* );
|
|
1868
|
+
* }
|
|
1869
|
+
* ```
|
|
1870
|
+
*/
|
|
1871
|
+
declare function getProductItemList(): Promise<{
|
|
1872
|
+
products: IapProductListItem[];
|
|
1873
|
+
} | undefined>;
|
|
1874
|
+
/**
|
|
1875
|
+
* @public
|
|
1876
|
+
* @category 인앱결제
|
|
1877
|
+
* @name IAP
|
|
1878
|
+
* @description 인앱결제 관련 기능을 모은 객체예요. 단건 인앱결제 주문서 이동과 상품 목록 조회 기능을 제공해요.
|
|
1879
|
+
* @property {typeof createOneTimePurchaseOrder} [createOneTimePurchaseOrder] 특정 인앱결제 주문서 페이지로 이동해요. 자세한 내용은 [createOneTimePurchaseOrder](https://developers-apps-in-toss.toss.im/bedrock/reference/native-modules/%EC%9D%B8%EC%95%B1%20%EA%B2%B0%EC%A0%9C/getProductItemList.html) 문서를 참고하세요.
|
|
1880
|
+
* @property {typeof getProductItemList} [getProductItemList] 인앱결제로 구매할 수 있는 상품 목록을 가져와요. 자세한 내용은 [getProductItemList](https://developers-apps-in-toss.toss.im/bedrock/reference/native-modules/%EC%9D%B8%EC%95%B1%20%EA%B2%B0%EC%A0%9C/createOneTimePurchaseOrder.html) 문서를 참고하세요.
|
|
1881
|
+
*/
|
|
1882
|
+
declare const IAP: {
|
|
1883
|
+
createOneTimePurchaseOrder: typeof createOneTimePurchaseOrder;
|
|
1884
|
+
getProductItemList: typeof getProductItemList;
|
|
1885
|
+
};
|
|
1886
|
+
|
|
1887
|
+
interface OpenCameraOptions {
|
|
1888
|
+
/**
|
|
1889
|
+
* 이미지를 Base64 형식으로 반환할지 여부를 나타내는 불리언 값이에요.
|
|
1890
|
+
*
|
|
1891
|
+
* 기본값: `false`.
|
|
1892
|
+
*/
|
|
1893
|
+
base64?: boolean;
|
|
1894
|
+
/**
|
|
1895
|
+
* 이미지의 최대 너비를 나타내는 숫자 값이에요.
|
|
1896
|
+
*
|
|
1897
|
+
* 기본값: `1024`.
|
|
1898
|
+
*/
|
|
1899
|
+
maxWidth?: number;
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* @public
|
|
1903
|
+
* @category 카메라
|
|
1904
|
+
* @name openCamera
|
|
1905
|
+
* @description 카메라를 실행해서 촬영된 이미지를 반환하는 함수예요.
|
|
1906
|
+
* @param {OpenCameraOptions} options - 카메라 실행 시 사용되는 옵션 객체예요.
|
|
1907
|
+
* @param {boolean} [options.base64=false] - 이미지를 Base64 형식으로 반환할지 여부를 나타내는 불리언 값이에요. 기본값은 `false`예요. `true`로 설정하면 `dataUri` 대신 Base64 인코딩된 문자열을 반환해요.
|
|
1908
|
+
* @param {number} [options.maxWidth=1024] - 이미지의 최대 너비를 나타내는 숫자 값이에요. 기본값은 `1024`예요.
|
|
1909
|
+
* @returns {Promise<ImageResponse>}
|
|
1910
|
+
* 촬영된 이미지 정보를 포함한 객체를 반환해요. 반환 객체의 구성은 다음과 같아요:
|
|
1911
|
+
* - `id`: 이미지의 고유 식별자예요.
|
|
1912
|
+
* - `dataUri`: 이미지 데이터를 표현하는 데이터 URI예요.
|
|
1913
|
+
*
|
|
1914
|
+
* @example
|
|
1915
|
+
* ### 카메라 실행 후 촬영된 사진 가져오기
|
|
1916
|
+
*
|
|
1917
|
+
* ```tsx
|
|
1918
|
+
* import React, { useState } from 'react';
|
|
1919
|
+
* import { View, Text, Button, Image } from 'react-native';
|
|
1920
|
+
* import { openCamera } from '@apps-in-toss/framework';
|
|
1921
|
+
*
|
|
1922
|
+
* const base64 = true;
|
|
1923
|
+
*
|
|
1924
|
+
* // 카메라를 실행하고 촬영된 이미지를 화면에 표시하는 컴포넌트
|
|
1925
|
+
* function Camera() {
|
|
1926
|
+
* const [image, setImage] = useState(null);
|
|
1258
1927
|
*
|
|
1259
1928
|
* const handlePress = async () => {
|
|
1260
1929
|
* try {
|
|
@@ -1325,6 +1994,69 @@ interface SaveBase64DataParams {
|
|
|
1325
1994
|
*/
|
|
1326
1995
|
declare function saveBase64Data(params: SaveBase64DataParams): Promise<void>;
|
|
1327
1996
|
|
|
1997
|
+
/**
|
|
1998
|
+
* @public
|
|
1999
|
+
* @category 게임센터
|
|
2000
|
+
* @name SubmitGameCenterLeaderBoardScoreResponse
|
|
2001
|
+
* @description
|
|
2002
|
+
* 토스게임센터 리더보드에 점수를 제출한 결과 정보를 담아서 반환해요. 반환된 정보를 사용해서 점수 제출 결과에 따라 적절한 에러 처리를 할 수 있어요.
|
|
2003
|
+
* @property {'SUCCESS' | 'LEADERBOARD_NOT_FOUND' | 'PROFILE_NOT_FOUND' | 'UNPARSABLE_SCORE'} statusCode
|
|
2004
|
+
* 점수 제출 결과를 나타내는 상태 코드예요.
|
|
2005
|
+
* - `'SUCCESS'`: 점수 제출이 성공했어요.
|
|
2006
|
+
* - `'LEADERBOARD_NOT_FOUND'`: `gameId`에 해당하는 리더보드를 찾을 수 없어요.
|
|
2007
|
+
* - `'PROFILE_NOT_FOUND'`: 사용자의 프로필이 없어요.
|
|
2008
|
+
* - `'UNPARSABLE_SCORE'`: 점수를 해석할 수 없어요. 점수는 실수(float) 형태의 문자열로 전달해야 해요.
|
|
2009
|
+
*/
|
|
2010
|
+
interface SubmitGameCenterLeaderBoardScoreResponse {
|
|
2011
|
+
statusCode: 'SUCCESS' | 'LEADERBOARD_NOT_FOUND' | 'PROFILE_NOT_FOUND' | 'UNPARSABLE_SCORE';
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* @public
|
|
2015
|
+
* @category 게임센터
|
|
2016
|
+
* @name submitGameCenterLeaderBoardScore
|
|
2017
|
+
* @description
|
|
2018
|
+
* 사용자의 게임 점수를 토스게임센터 리더보드에 제출해요. 이 기능으로 사용자의 점수를 공식 리더보드에 기록하고 다른 사용자와 비교할 수 있어요.
|
|
2019
|
+
* @param {string} params.score
|
|
2020
|
+
* 제출할 게임 점수예요. 실수 형태의 숫자를 문자열로 전달해야 해요. 예를들어 `"123.45"` 또는 `"9999"` 예요.
|
|
2021
|
+
* @returns {Promise<SubmitGameCenterLeaderBoardScoreResponse | undefined>}
|
|
2022
|
+
* 점수 제출 결과를 반환해요. 앱 버전이 최소 지원 버전보다 낮으면 아무 동작도 하지 않고 `undefined`를 반환해요.
|
|
2023
|
+
*
|
|
2024
|
+
* @example
|
|
2025
|
+
* ### 게임 점수를 토스게임센터 리더보드에 제출하기
|
|
2026
|
+
* ```tsx
|
|
2027
|
+
* import { Button } from 'react-native';
|
|
2028
|
+
* import { submitGameCenterLeaderBoardScore } from '@apps-in-toss/framework';
|
|
2029
|
+
*
|
|
2030
|
+
* function GameCenterLeaderBoardScoreSubmitButton() {
|
|
2031
|
+
* async function handlePress() {
|
|
2032
|
+
* try {
|
|
2033
|
+
* const result = await submitGameCenterLeaderBoardScore({ score: '123.45' });
|
|
2034
|
+
*
|
|
2035
|
+
* if (!result) {
|
|
2036
|
+
* console.warn('지원하지 않는 앱 버전이에요.');
|
|
2037
|
+
* return;
|
|
2038
|
+
* }
|
|
2039
|
+
*
|
|
2040
|
+
* if (result.statusCode === 'SUCCESS') {
|
|
2041
|
+
* console.log('점수 제출 성공!');
|
|
2042
|
+
* } else {
|
|
2043
|
+
* console.error('점수 제출 실패:', result.statusCode);
|
|
2044
|
+
* }
|
|
2045
|
+
* } catch (error) {
|
|
2046
|
+
* console.error('점수 제출 중 오류가 발생했어요.', error);
|
|
2047
|
+
* }
|
|
2048
|
+
* }
|
|
2049
|
+
*
|
|
2050
|
+
* return (
|
|
2051
|
+
* <Button onPress={handlePress}>점수 제출하기</Button>
|
|
2052
|
+
* );
|
|
2053
|
+
* }
|
|
2054
|
+
* ```
|
|
2055
|
+
*/
|
|
2056
|
+
declare function submitGameCenterLeaderBoardScore(params: {
|
|
2057
|
+
score: string;
|
|
2058
|
+
}): Promise<SubmitGameCenterLeaderBoardScoreResponse | undefined>;
|
|
2059
|
+
|
|
1328
2060
|
type CompatiblePlaceholderArgument = object;
|
|
1329
2061
|
/**
|
|
1330
2062
|
* TurboModule 타입 별칭 사용하는 이유?
|
|
@@ -1396,40 +2128,90 @@ interface Spec extends TurboModule {
|
|
|
1396
2128
|
type: 'portrait' | 'landscape';
|
|
1397
2129
|
}) => Promise<void>;
|
|
1398
2130
|
saveBase64Data: (params: SaveBase64DataParams) => Promise<void>;
|
|
2131
|
+
/** IAP */
|
|
2132
|
+
iapCreateOneTimePurchaseOrder: (params: IapCreateOneTimePurchaseOrderOptions) => Promise<IapCreateOneTimePurchaseOrderResult>;
|
|
2133
|
+
iapGetProductItemList: (arg: CompatiblePlaceholderArgument) => Promise<{
|
|
2134
|
+
products: IapProductListItem[];
|
|
2135
|
+
}>;
|
|
2136
|
+
getGameCenterGameProfile: (params: CompatiblePlaceholderArgument) => Promise<GameCenterGameProfileResponse>;
|
|
2137
|
+
submitGameCenterLeaderBoardScore: (params: {
|
|
2138
|
+
score: string;
|
|
2139
|
+
}) => Promise<SubmitGameCenterLeaderBoardScoreResponse>;
|
|
2140
|
+
contactsViral: (params: ContactsViralParams) => () => void;
|
|
1399
2141
|
}
|
|
1400
2142
|
declare const AppsInTossModuleInstance: any;
|
|
1401
2143
|
declare const AppsInTossModule: Spec;
|
|
1402
2144
|
|
|
1403
2145
|
/**
|
|
1404
2146
|
* @public
|
|
1405
|
-
* @category
|
|
1406
|
-
* @name
|
|
1407
|
-
* @description
|
|
1408
|
-
* @param {Promise<void>} text - 클립보드에 복사할 텍스트예요. 문자열 형식으로 입력해요.
|
|
1409
|
-
*
|
|
2147
|
+
* @category 로그인
|
|
2148
|
+
* @name appLogin
|
|
2149
|
+
* @description 토스 인증으로 로그인해요. 로그인이 완료되면 다시 토스 앱으로 이동해요.
|
|
1410
2150
|
* @example
|
|
1411
|
-
*
|
|
2151
|
+
*
|
|
2152
|
+
* ### 토스 인증을 통해 로그인을 하는 예제
|
|
1412
2153
|
*
|
|
1413
2154
|
* ```tsx
|
|
1414
2155
|
* import { Button } from 'react-native';
|
|
1415
|
-
* import {
|
|
2156
|
+
* import { appLogin } from '@apps-in-toss/framework';
|
|
1416
2157
|
*
|
|
1417
|
-
*
|
|
1418
|
-
*
|
|
1419
|
-
*
|
|
1420
|
-
* try {
|
|
1421
|
-
* await setClipboardText('복사할 텍스트');
|
|
1422
|
-
* console.log('텍스트가 복사됐어요!');
|
|
1423
|
-
* } catch (error) {
|
|
1424
|
-
* console.error('텍스트 복사에 실패했어요:', error);
|
|
1425
|
-
* }
|
|
1426
|
-
* };
|
|
2158
|
+
* function Page() {
|
|
2159
|
+
* const handleLogin = async () => {
|
|
2160
|
+
* const { authorizationCode, referrer } = await appLogin();
|
|
1427
2161
|
*
|
|
1428
|
-
*
|
|
2162
|
+
* // 획득한 인가 코드(`authorizationCode`)와 `referrer`를 서버로 전달해요.
|
|
2163
|
+
* }
|
|
2164
|
+
*
|
|
2165
|
+
* return <Button title="로그인" onPress={handleLogin} />;
|
|
1429
2166
|
* }
|
|
1430
2167
|
* ```
|
|
1431
2168
|
*/
|
|
1432
|
-
declare function
|
|
2169
|
+
declare function appLogin(): Promise<{
|
|
2170
|
+
authorizationCode: string;
|
|
2171
|
+
referrer: 'DEFAULT' | 'SANDBOX';
|
|
2172
|
+
}>;
|
|
2173
|
+
|
|
2174
|
+
interface EventLogParams {
|
|
2175
|
+
log_name: string;
|
|
2176
|
+
log_type: 'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click';
|
|
2177
|
+
params: Record<string, Primitive>;
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* @category 로깅
|
|
2181
|
+
* @kind function
|
|
2182
|
+
* @name eventLog
|
|
2183
|
+
* @description
|
|
2184
|
+
* 이벤트 로그를 기록하는 함수예요.
|
|
2185
|
+
*
|
|
2186
|
+
* 이 함수는 앱 내에서 발생하는 다양한 이벤트를 로깅하는 데 사용돼요. 디버깅, 정보 제공, 경고, 오류 등 다양한 유형의 로그를 기록할 수 있어요. 샌드박스 환경에서는 콘솔에 로그가 출력되고, 실제 환경에서는 로그 시스템에 기록돼요.
|
|
2187
|
+
*
|
|
2188
|
+
* @param {Object} params 로그 기록에 필요한 매개변수 객체예요.
|
|
2189
|
+
* @param {string} params.log_name 로그의 이름이에요.
|
|
2190
|
+
* @param {'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.
|
|
2191
|
+
* @param {Record<string, Primitive>} params.params 로그에 포함할 추가 매개변수 객체예요.
|
|
2192
|
+
*
|
|
2193
|
+
* @returns {Promise<void>} 로그 기록이 완료되면 해결되는 Promise예요.
|
|
2194
|
+
*
|
|
2195
|
+
* @example
|
|
2196
|
+
* ### 이벤트 로그 기록하기
|
|
2197
|
+
*
|
|
2198
|
+
* ```tsx
|
|
2199
|
+
* import { eventLog } from '@apps-in-toss/framework';
|
|
2200
|
+
*
|
|
2201
|
+
* function logUserAction() {
|
|
2202
|
+
* eventLog({
|
|
2203
|
+
* log_name: 'user_action',
|
|
2204
|
+
* log_type: 'info',
|
|
2205
|
+
* params: {
|
|
2206
|
+
* action: 'button_click',
|
|
2207
|
+
* screen: 'main',
|
|
2208
|
+
* userId: 12345
|
|
2209
|
+
* }
|
|
2210
|
+
* });
|
|
2211
|
+
* }
|
|
2212
|
+
* ```
|
|
2213
|
+
*/
|
|
2214
|
+
declare function eventLog(params: EventLogParams): Promise<void>;
|
|
1433
2215
|
|
|
1434
2216
|
/**
|
|
1435
2217
|
* @public
|
|
@@ -1472,32 +2254,33 @@ declare function getClipboardText(): Promise<string>;
|
|
|
1472
2254
|
|
|
1473
2255
|
/**
|
|
1474
2256
|
* @public
|
|
1475
|
-
* @category
|
|
1476
|
-
* @
|
|
1477
|
-
* @
|
|
1478
|
-
* @
|
|
2257
|
+
* @category 환경 확인
|
|
2258
|
+
* @kind function
|
|
2259
|
+
* @name getDeviceId
|
|
2260
|
+
* @description
|
|
2261
|
+
* 사용 중인 기기의 고유 식별자를 문자열로 반환해요.
|
|
1479
2262
|
*
|
|
1480
|
-
*
|
|
2263
|
+
* 이 함수는 현재 사용 중인 기기의 고유 식별자를 문자열로 반환해요. 기기별로 설정이나 데이터를 저장하거나 사용자의 기기를 식별해서 로그를 기록하고 분석하는 데 사용할 수 있어요. 같은 사용자의 여러 기기를 구분하는 데도 유용해요.
|
|
1481
2264
|
*
|
|
1482
|
-
*
|
|
1483
|
-
* import { Button } from 'react-native';
|
|
1484
|
-
* import { appLogin } from '@apps-in-toss/framework';
|
|
2265
|
+
* @returns {string} 기기의 고유 식별자를 나타내는 문자열이에요.
|
|
1485
2266
|
*
|
|
1486
|
-
*
|
|
1487
|
-
*
|
|
1488
|
-
* const { authorizationCode, referrer } = await appLogin();
|
|
2267
|
+
* @example
|
|
2268
|
+
* ### 기기 고유 식별자 가져오기
|
|
1489
2269
|
*
|
|
1490
|
-
*
|
|
1491
|
-
*
|
|
2270
|
+
* ```tsx
|
|
2271
|
+
* import { getDeviceId } from '@apps-in-toss/framework';
|
|
2272
|
+
* import { Text } from 'react-native';
|
|
1492
2273
|
*
|
|
1493
|
-
*
|
|
1494
|
-
*
|
|
1495
|
-
*
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
2274
|
+
* function MyPage() {
|
|
2275
|
+
* const id = getDeviceId();
|
|
2276
|
+
*
|
|
2277
|
+
* return (
|
|
2278
|
+
* <Text>사용자의 기기 고유 식별자: {id}</Text>
|
|
2279
|
+
* );
|
|
2280
|
+
* }
|
|
2281
|
+
* ```
|
|
2282
|
+
*/
|
|
2283
|
+
declare function getDeviceId(): string;
|
|
1501
2284
|
|
|
1502
2285
|
/**
|
|
1503
2286
|
* @public
|
|
@@ -1565,117 +2348,34 @@ declare function getTossAppVersion(): string;
|
|
|
1565
2348
|
|
|
1566
2349
|
/**
|
|
1567
2350
|
* @public
|
|
1568
|
-
* @category
|
|
2351
|
+
* @category 공유
|
|
1569
2352
|
* @kind function
|
|
1570
|
-
* @name
|
|
2353
|
+
* @name getTossShareLink
|
|
1571
2354
|
* @description
|
|
1572
|
-
*
|
|
1573
|
-
*
|
|
1574
|
-
* 이 함수는 현재 사용 중인 기기의 고유 식별자를 문자열로 반환해요. 기기별로 설정이나 데이터를 저장하거나 사용자의 기기를 식별해서 로그를 기록하고 분석하는 데 사용할 수 있어요. 같은 사용자의 여러 기기를 구분하는 데도 유용해요.
|
|
1575
|
-
*
|
|
1576
|
-
* @returns {string} 기기의 고유 식별자를 나타내는 문자열이에요.
|
|
1577
|
-
*
|
|
1578
|
-
* @example
|
|
1579
|
-
* ### 기기 고유 식별자 가져오기
|
|
1580
|
-
*
|
|
1581
|
-
* ```tsx
|
|
1582
|
-
* import { getDeviceId } from '@apps-in-toss/framework';
|
|
1583
|
-
* import { Text } from 'react-native';
|
|
1584
|
-
*
|
|
1585
|
-
* function MyPage() {
|
|
1586
|
-
* const id = getDeviceId();
|
|
1587
|
-
*
|
|
1588
|
-
* return (
|
|
1589
|
-
* <Text>사용자의 기기 고유 식별자: {id}</Text>
|
|
1590
|
-
* );
|
|
1591
|
-
* }
|
|
1592
|
-
* ```
|
|
1593
|
-
*/
|
|
1594
|
-
declare function getDeviceId(): string;
|
|
1595
|
-
|
|
1596
|
-
/**
|
|
1597
|
-
* @public
|
|
1598
|
-
* @category 저장소
|
|
1599
|
-
* @name getItem
|
|
1600
|
-
* @description 모바일 앱의 로컬 저장소에서 문자열 데이터를 가져와요. 주로 앱이 종료되었다가 다시 시작해도 데이터가 유지되어야 하는 경우에 사용해요.
|
|
1601
|
-
* @param {string} key - 가져올 아이템의 키를 입력해요.
|
|
1602
|
-
* @returns {Promise<string | null>} 지정한 키에 저장된 문자열 값을 반환해요. 값이 없으면 `null`을 반환해요.
|
|
1603
|
-
* @example
|
|
1604
|
-
*
|
|
1605
|
-
* ### `my-key`에 저장된 아이템 가져오기
|
|
1606
|
-
* ```ts
|
|
1607
|
-
* const value = await Storage.getItem('my-key');
|
|
1608
|
-
* console.log(value); // 'value'
|
|
1609
|
-
* ```
|
|
1610
|
-
*/
|
|
1611
|
-
declare function getItem(key: string): Promise<string | null>;
|
|
1612
|
-
/**
|
|
1613
|
-
* @public
|
|
1614
|
-
* @category 저장소
|
|
1615
|
-
* @name setItem
|
|
1616
|
-
* @description 모바일 앱의 로컬 저장소에 문자열 데이터를 저장해요. 주로 앱이 종료되었다가 다시 시작해도 데이터가 유지되어야 하는 경우에 사용해요.
|
|
1617
|
-
* @param {string} key - 저장할 아이템의 키를 입력해요.
|
|
1618
|
-
* @param {string} value - 저장할 아이템의 값을 입력해요.
|
|
1619
|
-
* @returns {Promise<void>} 아이템을 성공적으로 저장하면 아무 값도 반환하지 않아요.
|
|
1620
|
-
* @example
|
|
2355
|
+
* `getTossShareLink` 함수는 사용자가 지정한 경로를 토스 앱에서 열 수 있는 공유 링크를 반환해요.
|
|
2356
|
+
* 이 링크를 다른 사람과 공유하면 토스 앱이 실행되면서 지정한 경로로 진입해요. 토스앱이 없는 사람은 iOS 일 때는 앱스토어로 이동하고, Android 일 때는 플레이스토어로 이동해요.
|
|
1621
2357
|
*
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1624
|
-
* import { Storage } from '@apps-in-toss/framework';
|
|
2358
|
+
* 경로는 토스 앱 내부 특정 화면을 나타내는 딥링크(deep link) 형식이어야 해요.
|
|
2359
|
+
* 예를 들어 `intoss://<앱 이름>`이나 `intoss://<앱 이름>/about?name=test`처럼 작성해요.
|
|
1625
2360
|
*
|
|
1626
|
-
*
|
|
1627
|
-
* ```
|
|
1628
|
-
*/
|
|
1629
|
-
declare function setItem(key: string, value: string): Promise<void>;
|
|
1630
|
-
/**
|
|
1631
|
-
* @public
|
|
1632
|
-
* @category 저장소
|
|
1633
|
-
* @name removeItem
|
|
1634
|
-
* @description 모바일 앱의 로컬 저장소에서 특정 키에 해당하는 아이템을 삭제해요.
|
|
1635
|
-
* @param {string} key - 삭제할 아이템의 키를 입력해요.
|
|
1636
|
-
* @returns {Promise<void>} 아이템을 삭제하면 아무 값도 반환하지 않아요.
|
|
1637
|
-
* @example
|
|
2361
|
+
* 이 함수를 사용하면 `deep_link_value`를 포함한 완성된 공유 링크를 만들 수 있어요.
|
|
1638
2362
|
*
|
|
1639
|
-
*
|
|
1640
|
-
*
|
|
1641
|
-
* import { Storage } from '@apps-in-toss/framework';
|
|
2363
|
+
* @param path - 딥링크로 열고 싶은 경로예요. `intoss://`로 시작하는 문자열이어야 해요.
|
|
2364
|
+
* @returns {Promise<string>} `deep_link_value`가 포함된 토스 공유 링크를 반환해요.
|
|
1642
2365
|
*
|
|
1643
|
-
* await Storage.removeItem('my-key');
|
|
1644
|
-
* ```
|
|
1645
|
-
*/
|
|
1646
|
-
declare function removeItem(key: string): Promise<void>;
|
|
1647
|
-
/**
|
|
1648
|
-
* @public
|
|
1649
|
-
* @category 저장소
|
|
1650
|
-
* @name clearItems
|
|
1651
|
-
* @description 모바일 앱의 로컬 저장소의 모든 아이템을 삭제해요.
|
|
1652
|
-
* @returns {Promise<void>} 아이템을 삭제하면 아무 값도 반환하지 않고 저장소가 초기화돼요.
|
|
1653
2366
|
* @example
|
|
2367
|
+
* ```tsx
|
|
2368
|
+
* import { share } from '@granite-js/react-native';
|
|
2369
|
+
* import { getTossShareLink } from '@apps-in-toss/framework';
|
|
1654
2370
|
*
|
|
1655
|
-
*
|
|
1656
|
-
*
|
|
1657
|
-
* import { Storage } from '@apps-in-toss/framework';
|
|
2371
|
+
* // '/' 경로를 딥링크로 포함한 토스 공유 링크를 생성해요.
|
|
2372
|
+
* const tossLink = await getTossShareLink('intoss://my-app');
|
|
1658
2373
|
*
|
|
1659
|
-
*
|
|
2374
|
+
* // 생성한 링크를 메시지로 공유해요.
|
|
2375
|
+
* await share({ message: tossLink });
|
|
1660
2376
|
* ```
|
|
1661
2377
|
*/
|
|
1662
|
-
declare function
|
|
1663
|
-
/**
|
|
1664
|
-
* @public
|
|
1665
|
-
* @category 저장소
|
|
1666
|
-
* @name Storage
|
|
1667
|
-
* @description 네이티브의 저장소를 사용해요.
|
|
1668
|
-
* @property {typeof getItem} [getItem] 모바일 앱의 로컬 저장소에서 아이템을 가져오는 함수예요. 자세한 내용은 [getItem](/react-native/reference/framework/저장소/getItem.html)을 참고하세요.
|
|
1669
|
-
* @property {typeof setItem} [setItem] 모바일 앱의 로컬 저장소에 아이템을 저장하는 함수예요. 자세한 내용은 [setItem](/react-native/reference/framework/저장소/setItem.html)을 참고하셰요.
|
|
1670
|
-
* @property {typeof removeItem} [removeItem] 모바일 앱의 로컬 저장소에서 아이템을 삭제하는 함수예요. 자세한 내용은 [removeItem](/react-native/reference/framework/저장소/removeItem.html)을 참고하세요.
|
|
1671
|
-
* @property {typeof clearItems} [clearItems] 모바일 앱의 로컬 저장소를 초기화하는 함수예요. 자세한 내용은 [clearItems](/react-native/reference/framework/저장소/clearItems.html)을 참고하세요.
|
|
1672
|
-
*/
|
|
1673
|
-
declare const Storage: {
|
|
1674
|
-
getItem: typeof getItem;
|
|
1675
|
-
setItem: typeof setItem;
|
|
1676
|
-
removeItem: typeof removeItem;
|
|
1677
|
-
clearItems: typeof clearItems;
|
|
1678
|
-
};
|
|
2378
|
+
declare function getTossShareLink(path: string): Promise<string>;
|
|
1679
2379
|
|
|
1680
2380
|
/**
|
|
1681
2381
|
* @public
|
|
@@ -1720,78 +2420,36 @@ declare function isMinVersionSupported(minVersions: {
|
|
|
1720
2420
|
ios: `${number}.${number}.${number}` | 'always' | 'never';
|
|
1721
2421
|
}): boolean;
|
|
1722
2422
|
|
|
1723
|
-
interface EventLogParams {
|
|
1724
|
-
log_name: string;
|
|
1725
|
-
log_type: 'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click';
|
|
1726
|
-
params: Record<string, Primitive>;
|
|
1727
|
-
}
|
|
1728
2423
|
/**
|
|
1729
|
-
* @
|
|
1730
|
-
* @
|
|
1731
|
-
* @name
|
|
1732
|
-
* @description
|
|
1733
|
-
*
|
|
1734
|
-
*
|
|
1735
|
-
* 이 함수는 앱 내에서 발생하는 다양한 이벤트를 로깅하는 데 사용돼요. 디버깅, 정보 제공, 경고, 오류 등 다양한 유형의 로그를 기록할 수 있어요. 샌드박스 환경에서는 콘솔에 로그가 출력되고, 실제 환경에서는 로그 시스템에 기록돼요.
|
|
1736
|
-
*
|
|
1737
|
-
* @param {Object} params 로그 기록에 필요한 매개변수 객체예요.
|
|
1738
|
-
* @param {string} params.log_name 로그의 이름이에요.
|
|
1739
|
-
* @param {'debug' | 'info' | 'warn' | 'error' | 'screen' | 'impression' | 'click'} params.log_type 로그의 유형이에요.
|
|
1740
|
-
* @param {Record<string, Primitive>} params.params 로그에 포함할 추가 매개변수 객체예요.
|
|
1741
|
-
*
|
|
1742
|
-
* @returns {Promise<void>} 로그 기록이 완료되면 해결되는 Promise예요.
|
|
2424
|
+
* @public
|
|
2425
|
+
* @category 클립보드
|
|
2426
|
+
* @name setClipboardText
|
|
2427
|
+
* @description 텍스트를 클립보드에 복사해서 사용자가 다른 곳에 붙여 넣기 할 수 있어요.
|
|
2428
|
+
* @param {Promise<void>} text - 클립보드에 복사할 텍스트예요. 문자열 형식으로 입력해요.
|
|
1743
2429
|
*
|
|
1744
2430
|
* @example
|
|
1745
|
-
* ###
|
|
2431
|
+
* ### 텍스트를 클립보드에 복사하기
|
|
1746
2432
|
*
|
|
1747
2433
|
* ```tsx
|
|
1748
|
-
* import {
|
|
2434
|
+
* import { Button } from 'react-native';
|
|
2435
|
+
* import { setClipboardText } from '@apps-in-toss/framework';
|
|
1749
2436
|
*
|
|
1750
|
-
*
|
|
1751
|
-
*
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
1754
|
-
*
|
|
1755
|
-
*
|
|
1756
|
-
*
|
|
1757
|
-
*
|
|
2437
|
+
* // '복사' 버튼을 누르면 "복사할 텍스트"가 클립보드에 복사돼요.
|
|
2438
|
+
* function CopyButton() {
|
|
2439
|
+
* const handleCopy = async () => {
|
|
2440
|
+
* try {
|
|
2441
|
+
* await setClipboardText('복사할 텍스트');
|
|
2442
|
+
* console.log('텍스트가 복사됐어요!');
|
|
2443
|
+
* } catch (error) {
|
|
2444
|
+
* console.error('텍스트 복사에 실패했어요:', error);
|
|
1758
2445
|
* }
|
|
1759
|
-
* }
|
|
1760
|
-
* }
|
|
1761
|
-
* ```
|
|
1762
|
-
*/
|
|
1763
|
-
declare function eventLog(params: EventLogParams): Promise<void>;
|
|
1764
|
-
|
|
1765
|
-
/**
|
|
1766
|
-
* @public
|
|
1767
|
-
* @category 공유
|
|
1768
|
-
* @kind function
|
|
1769
|
-
* @name getTossShareLink
|
|
1770
|
-
* @description
|
|
1771
|
-
* `getTossShareLink` 함수는 사용자가 지정한 경로를 토스 앱에서 열 수 있는 공유 링크를 반환해요.
|
|
1772
|
-
* 이 링크를 다른 사람과 공유하면 토스 앱이 실행되면서 지정한 경로로 진입해요. 토스앱이 없는 사람은 iOS 일 때는 앱스토어로 이동하고, Android 일 때는 플레이스토어로 이동해요.
|
|
1773
|
-
*
|
|
1774
|
-
* 경로는 토스 앱 내부 특정 화면을 나타내는 딥링크(deep link) 형식이어야 해요.
|
|
1775
|
-
* 예를 들어 `intoss://<앱 이름>`이나 `intoss://<앱 이름>/about?name=test`처럼 작성해요.
|
|
1776
|
-
*
|
|
1777
|
-
* 이 함수를 사용하면 `deep_link_value`를 포함한 완성된 공유 링크를 만들 수 있어요.
|
|
1778
|
-
*
|
|
1779
|
-
* @param path - 딥링크로 열고 싶은 경로예요. `intoss://`로 시작하는 문자열이어야 해요.
|
|
1780
|
-
* @returns {Promise<string>} `deep_link_value`가 포함된 토스 공유 링크를 반환해요.
|
|
1781
|
-
*
|
|
1782
|
-
* @example
|
|
1783
|
-
* ```tsx
|
|
1784
|
-
* import { share } from '@granite-js/react-native';
|
|
1785
|
-
* import { getTossShareLink } from '@apps-in-toss/framework';
|
|
1786
|
-
*
|
|
1787
|
-
* // '/' 경로를 딥링크로 포함한 토스 공유 링크를 생성해요.
|
|
1788
|
-
* const tossLink = await getTossShareLink('intoss://my-app');
|
|
2446
|
+
* };
|
|
1789
2447
|
*
|
|
1790
|
-
*
|
|
1791
|
-
*
|
|
2448
|
+
* return <Button title="복사" onPress={handleCopy} />;
|
|
2449
|
+
* }
|
|
1792
2450
|
* ```
|
|
1793
2451
|
*/
|
|
1794
|
-
declare function
|
|
2452
|
+
declare function setClipboardText(text: string): Promise<void>;
|
|
1795
2453
|
|
|
1796
2454
|
/**
|
|
1797
2455
|
* @public
|
|
@@ -1857,12 +2515,120 @@ declare function setDeviceOrientation(options: {
|
|
|
1857
2515
|
type: 'portrait' | 'landscape';
|
|
1858
2516
|
}): Promise<void>;
|
|
1859
2517
|
|
|
2518
|
+
/**
|
|
2519
|
+
* @public
|
|
2520
|
+
* @category 저장소
|
|
2521
|
+
* @name getItem
|
|
2522
|
+
* @description 모바일 앱의 로컬 저장소에서 문자열 데이터를 가져와요. 주로 앱이 종료되었다가 다시 시작해도 데이터가 유지되어야 하는 경우에 사용해요.
|
|
2523
|
+
* @param {string} key - 가져올 아이템의 키를 입력해요.
|
|
2524
|
+
* @returns {Promise<string | null>} 지정한 키에 저장된 문자열 값을 반환해요. 값이 없으면 `null`을 반환해요.
|
|
2525
|
+
* @example
|
|
2526
|
+
*
|
|
2527
|
+
* ### `my-key`에 저장된 아이템 가져오기
|
|
2528
|
+
* ```ts
|
|
2529
|
+
* const value = await Storage.getItem('my-key');
|
|
2530
|
+
* console.log(value); // 'value'
|
|
2531
|
+
* ```
|
|
2532
|
+
*/
|
|
2533
|
+
declare function getItem(key: string): Promise<string | null>;
|
|
2534
|
+
/**
|
|
2535
|
+
* @public
|
|
2536
|
+
* @category 저장소
|
|
2537
|
+
* @name setItem
|
|
2538
|
+
* @description 모바일 앱의 로컬 저장소에 문자열 데이터를 저장해요. 주로 앱이 종료되었다가 다시 시작해도 데이터가 유지되어야 하는 경우에 사용해요.
|
|
2539
|
+
* @param {string} key - 저장할 아이템의 키를 입력해요.
|
|
2540
|
+
* @param {string} value - 저장할 아이템의 값을 입력해요.
|
|
2541
|
+
* @returns {Promise<void>} 아이템을 성공적으로 저장하면 아무 값도 반환하지 않아요.
|
|
2542
|
+
* @example
|
|
2543
|
+
*
|
|
2544
|
+
* ### `my-key`에 아이템 저장하기
|
|
2545
|
+
* ```ts
|
|
2546
|
+
* import { Storage } from '@apps-in-toss/framework';
|
|
2547
|
+
*
|
|
2548
|
+
* await Storage.setItem('my-key', 'value');
|
|
2549
|
+
* ```
|
|
2550
|
+
*/
|
|
2551
|
+
declare function setItem(key: string, value: string): Promise<void>;
|
|
2552
|
+
/**
|
|
2553
|
+
* @public
|
|
2554
|
+
* @category 저장소
|
|
2555
|
+
* @name removeItem
|
|
2556
|
+
* @description 모바일 앱의 로컬 저장소에서 특정 키에 해당하는 아이템을 삭제해요.
|
|
2557
|
+
* @param {string} key - 삭제할 아이템의 키를 입력해요.
|
|
2558
|
+
* @returns {Promise<void>} 아이템을 삭제하면 아무 값도 반환하지 않아요.
|
|
2559
|
+
* @example
|
|
2560
|
+
*
|
|
2561
|
+
* ### `my-key`에 저장된 아이템 삭제하기
|
|
2562
|
+
* ```ts
|
|
2563
|
+
* import { Storage } from '@apps-in-toss/framework';
|
|
2564
|
+
*
|
|
2565
|
+
* await Storage.removeItem('my-key');
|
|
2566
|
+
* ```
|
|
2567
|
+
*/
|
|
2568
|
+
declare function removeItem(key: string): Promise<void>;
|
|
2569
|
+
/**
|
|
2570
|
+
* @public
|
|
2571
|
+
* @category 저장소
|
|
2572
|
+
* @name clearItems
|
|
2573
|
+
* @description 모바일 앱의 로컬 저장소의 모든 아이템을 삭제해요.
|
|
2574
|
+
* @returns {Promise<void>} 아이템을 삭제하면 아무 값도 반환하지 않고 저장소가 초기화돼요.
|
|
2575
|
+
* @example
|
|
2576
|
+
*
|
|
2577
|
+
* ### 저장소 초기화하기
|
|
2578
|
+
* ```ts
|
|
2579
|
+
* import { Storage } from '@apps-in-toss/framework';
|
|
2580
|
+
*
|
|
2581
|
+
* await Storage.clearItems();
|
|
2582
|
+
* ```
|
|
2583
|
+
*/
|
|
2584
|
+
declare function clearItems(): Promise<void>;
|
|
2585
|
+
/**
|
|
2586
|
+
* @public
|
|
2587
|
+
* @category 저장소
|
|
2588
|
+
* @name Storage
|
|
2589
|
+
* @description 네이티브의 저장소를 사용해요.
|
|
2590
|
+
* @property {typeof getItem} [getItem] 모바일 앱의 로컬 저장소에서 아이템을 가져오는 함수예요. 자세한 내용은 [getItem](/react-native/reference/native-modules/저장소/getItem.html)을 참고하세요.
|
|
2591
|
+
* @property {typeof setItem} [setItem] 모바일 앱의 로컬 저장소에 아이템을 저장하는 함수예요. 자세한 내용은 [setItem](/react-native/reference/native-modules/저장소/setItem.html)을 참고하셰요.
|
|
2592
|
+
* @property {typeof removeItem} [removeItem] 모바일 앱의 로컬 저장소에서 아이템을 삭제하는 함수예요. 자세한 내용은 [removeItem](/react-native/reference/native-modules/저장소/removeItem.html)을 참고하세요.
|
|
2593
|
+
* @property {typeof clearItems} [clearItems] 모바일 앱의 로컬 저장소를 초기화하는 함수예요. 자세한 내용은 [clearItems](/react-native/reference/native-modules/저장소/clearItems.html)을 참고하세요.
|
|
2594
|
+
*/
|
|
2595
|
+
declare const Storage: {
|
|
2596
|
+
getItem: typeof getItem;
|
|
2597
|
+
setItem: typeof setItem;
|
|
2598
|
+
removeItem: typeof removeItem;
|
|
2599
|
+
clearItems: typeof clearItems;
|
|
2600
|
+
};
|
|
2601
|
+
|
|
2602
|
+
/**
|
|
2603
|
+
* @public
|
|
2604
|
+
* @category 게임센터
|
|
2605
|
+
* @name openGameCenterLeaderboard
|
|
2606
|
+
* @description 게임센터 리더보드 웹뷰를 열어요.
|
|
2607
|
+
* 앱 버전이 최소 지원 버전(`5.221.0`)보다 낮으면 아무 동작도 하지 않고 `undefined`를 반환해요.
|
|
2608
|
+
* 게임센터를 사용하는 사용자는 반드시 최소 지원 버전 이상이어야 게임을 실행할 수 있어요.
|
|
2609
|
+
* @returns 리더보드 웹뷰를 호출해요. 앱 버전이 낮으면 아무 동작도 하지 않고 `undefined`를 반환해요.
|
|
2610
|
+
*
|
|
2611
|
+
* @example
|
|
2612
|
+
* import { Button } from 'react-native';
|
|
2613
|
+
* import { openGameCenterLeaderboard } from '@apps-in-toss/framework';
|
|
2614
|
+
*
|
|
2615
|
+
* // '리더보드' 버튼을 누르면 게임센터 리더보드 웹뷰가 열려요.
|
|
2616
|
+
* function LeaderboardButton() {
|
|
2617
|
+
* const onPress = () => {
|
|
2618
|
+
* openGameCenterLeaderboard();
|
|
2619
|
+
* };
|
|
2620
|
+
*
|
|
2621
|
+
* return <Button title="리더보드 웹뷰 호출" onPress={onPress} />;
|
|
2622
|
+
* }
|
|
2623
|
+
*/
|
|
2624
|
+
declare function openGameCenterLeaderboard(): Promise<void>;
|
|
2625
|
+
|
|
1860
2626
|
/**
|
|
1861
2627
|
* @public
|
|
1862
2628
|
* @category 토스페이
|
|
1863
2629
|
* @name TossPay
|
|
1864
2630
|
* @description 토스페이 결제 관련 함수를 모아둔 객체예요.
|
|
1865
|
-
* @property {typeof checkoutPayment} [checkoutPayment] 토스페이 결제를 인증하는 함수예요. 자세한 내용은 [checkoutPayment](/react-native/reference/
|
|
2631
|
+
* @property {typeof checkoutPayment} [checkoutPayment] 토스페이 결제를 인증하는 함수예요. 자세한 내용은 [checkoutPayment](/react-native/reference/native-modules/토스페이/checkoutPayment)를 참고하세요.
|
|
1866
2632
|
*/
|
|
1867
2633
|
declare const TossPay: {
|
|
1868
2634
|
checkoutPayment: typeof checkoutPayment;
|
|
@@ -1872,16 +2638,20 @@ declare const TossPay: {
|
|
|
1872
2638
|
* @category 광고
|
|
1873
2639
|
* @name GoogleAdMob
|
|
1874
2640
|
* @description Google AdMob 광고 관련 함수를 모아둔 객체예요.
|
|
1875
|
-
* @property {typeof loadAdMobInterstitialAd} [loadAdMobInterstitialAd] 전면 광고를 로드하는 함수예요. 자세한 내용은 [loadAdMobInterstitialAd](/react-native/reference/
|
|
1876
|
-
* @property {typeof showAdMobInterstitialAd} [showAdMobInterstitialAd] 로드한 전면 광고를 보여주는 함수예요. 자세한 내용은 [showAdMobInterstitialAd](/react-native/reference/
|
|
1877
|
-
* @property {typeof loadAdMobRewardedAd} [loadAdMobRewardedAd] 보상형 광고를 로드하는 함수예요. 자세한 내용은 [loadAdMobRewardedAd](/react-native/reference/
|
|
1878
|
-
* @property {typeof showAdMobRewardedAd} [showAdMobRewardedAd] 로드한 보상형 광고를 보여주는 함수예요. 자세한 내용은 [showAdMobRewardedAd](/react-native/reference/
|
|
2641
|
+
* @property {typeof loadAdMobInterstitialAd} [loadAdMobInterstitialAd] 전면 광고를 로드하는 함수예요. 자세한 내용은 [loadAdMobInterstitialAd](/react-native/reference/native-modules/광고/loadAdMobInterstitialAd.html)를 참고하세요.
|
|
2642
|
+
* @property {typeof showAdMobInterstitialAd} [showAdMobInterstitialAd] 로드한 전면 광고를 보여주는 함수예요. 자세한 내용은 [showAdMobInterstitialAd](/react-native/reference/native-modules/광고/showAdMobInterstitialAd.html)를 참고하세요.
|
|
2643
|
+
* @property {typeof loadAdMobRewardedAd} [loadAdMobRewardedAd] 보상형 광고를 로드하는 함수예요. 자세한 내용은 [loadAdMobRewardedAd](/react-native/reference/native-modules/광고/loadAdMobRewardedAd.html)를 참고하세요.
|
|
2644
|
+
* @property {typeof showAdMobRewardedAd} [showAdMobRewardedAd] 로드한 보상형 광고를 보여주는 함수예요. 자세한 내용은 [showAdMobRewardedAd](/react-native/reference/native-modules/광고/showAdMobRewardedAd.html)를 참고하세요.
|
|
2645
|
+
* @property {typeof loadAppsInTossAdMob} [loadAppsInTossAdMob] 광고를 로드하는 함수예요. 자세한 내용은 [loadAppsInTossAdMob](/react-native/reference/native-modules/광고/loadAppsInTossAdMob.html)를 참고하세요.
|
|
2646
|
+
* @property {typeof showAppsInTossAdMob} [showAppsInTossAdMob] 로드한 광고를 보여주는 함수예요. 자세한 내용은 [showAppsInTossAdMob](/react-native/reference/native-modules/광고/showAppsInTossAdMob.html)를 참고하세요.
|
|
1879
2647
|
*/
|
|
1880
2648
|
declare const GoogleAdMob: {
|
|
1881
2649
|
loadAdMobInterstitialAd: typeof loadAdMobInterstitialAd;
|
|
1882
2650
|
showAdMobInterstitialAd: typeof showAdMobInterstitialAd;
|
|
1883
2651
|
loadAdMobRewardedAd: typeof loadAdMobRewardedAd;
|
|
1884
2652
|
showAdMobRewardedAd: typeof showAdMobRewardedAd;
|
|
2653
|
+
loadAppsInTossAdMob: typeof loadAppsInTossAdMob;
|
|
2654
|
+
showAppsInTossAdMob: typeof showAppsInTossAdMob;
|
|
1885
2655
|
};
|
|
1886
2656
|
|
|
1887
2657
|
/**
|
|
@@ -1897,7 +2667,7 @@ declare const GoogleAdMob: {
|
|
|
1897
2667
|
*
|
|
1898
2668
|
* ```tsx
|
|
1899
2669
|
* import { Button } from 'react-native';
|
|
1900
|
-
* import { closeView } from '
|
|
2670
|
+
* import { closeView } from '@apps-in-toss/native-modules';
|
|
1901
2671
|
*
|
|
1902
2672
|
* function CloseButton() {
|
|
1903
2673
|
* return <Button title="닫기" onPress={closeView} />;
|
|
@@ -1920,7 +2690,7 @@ declare function closeView(): Promise<void>;
|
|
|
1920
2690
|
* ### 현재 사용자의 로케일 정보 가져오기
|
|
1921
2691
|
*
|
|
1922
2692
|
* ```tsx
|
|
1923
|
-
* import { getLocale } from '
|
|
2693
|
+
* import { getLocale } from '@apps-in-toss/native-modules';
|
|
1924
2694
|
* import { Text } from 'react-native';
|
|
1925
2695
|
*
|
|
1926
2696
|
* function MyPage() {
|
|
@@ -1947,7 +2717,7 @@ declare function getLocale(): string;
|
|
|
1947
2717
|
* ### 처음 진입한 스킴 값 가져오기
|
|
1948
2718
|
*
|
|
1949
2719
|
* ```tsx
|
|
1950
|
-
* import { getSchemeUri } from '
|
|
2720
|
+
* import { getSchemeUri } from '@apps-in-toss/native-modules';
|
|
1951
2721
|
* import { Text } from 'react-native';
|
|
1952
2722
|
*
|
|
1953
2723
|
* function MyPage() {
|
|
@@ -1999,7 +2769,7 @@ interface HapticFeedbackOptions {
|
|
|
1999
2769
|
*
|
|
2000
2770
|
* ```tsx
|
|
2001
2771
|
* import { Button } from 'react-native';
|
|
2002
|
-
* import { generateHapticFeedback } from '
|
|
2772
|
+
* import { generateHapticFeedback } from '@apps-in-toss/native-modules';
|
|
2003
2773
|
*
|
|
2004
2774
|
* function GenerateHapticFeedback() {
|
|
2005
2775
|
* return <Button title="햅틱" onPress={() => { generateHapticFeedback( { type: "tickWeak"}) }} />;
|
|
@@ -2026,7 +2796,7 @@ declare function generateHapticFeedback(options: HapticFeedbackOptions): Promise
|
|
|
2026
2796
|
* 아래는 버튼을 클릭하면 메시지를 공유하는 간단한 예제예요.
|
|
2027
2797
|
*
|
|
2028
2798
|
* ```tsx
|
|
2029
|
-
* import { share } from '
|
|
2799
|
+
* import { share } from '@apps-in-toss/native-modules';
|
|
2030
2800
|
* import { Button } from 'react-native';
|
|
2031
2801
|
*
|
|
2032
2802
|
* function MyPage() {
|
|
@@ -2060,7 +2830,7 @@ declare function share(message: {
|
|
|
2060
2830
|
*
|
|
2061
2831
|
* ```tsx
|
|
2062
2832
|
* import { Button } from 'react-native';
|
|
2063
|
-
* import { setSecureScreen } from '
|
|
2833
|
+
* import { setSecureScreen } from '@apps-in-toss/native-modules';
|
|
2064
2834
|
*
|
|
2065
2835
|
* function SetSecureScreen() {
|
|
2066
2836
|
* return <Button title="캡쳐 막기" onPress={async () => {
|
|
@@ -2102,7 +2872,7 @@ declare function setSecureScreen(options: {
|
|
|
2102
2872
|
*
|
|
2103
2873
|
* ```tsx
|
|
2104
2874
|
* import { Button } from 'react-native';
|
|
2105
|
-
* import { setScreenAwakeMode } from '
|
|
2875
|
+
* import { setScreenAwakeMode } from '@apps-in-toss/native-modules';
|
|
2106
2876
|
*
|
|
2107
2877
|
* function SetScreenAwakeMode() {
|
|
2108
2878
|
* return (
|
|
@@ -2121,7 +2891,7 @@ declare function setSecureScreen(options: {
|
|
|
2121
2891
|
*
|
|
2122
2892
|
* ```tsx
|
|
2123
2893
|
* import { useEffect } from 'react';
|
|
2124
|
-
* import { setScreenAwakeMode, cleanUp } from '
|
|
2894
|
+
* import { setScreenAwakeMode, cleanUp } from '@apps-in-toss/native-modules';
|
|
2125
2895
|
*
|
|
2126
2896
|
* function MediaScreen() {
|
|
2127
2897
|
* useEffect(() => {
|
|
@@ -2172,7 +2942,7 @@ type NetworkStatus = 'OFFLINE' | 'WIFI' | '2G' | '3G' | '4G' | '5G' | 'WWAN' | '
|
|
|
2172
2942
|
* ```tsx
|
|
2173
2943
|
* import { useState, useEffect } from 'react';
|
|
2174
2944
|
* import { Text, View } from 'react-native';
|
|
2175
|
-
* import { getNetworkStatus, NetworkStatus } from '
|
|
2945
|
+
* import { getNetworkStatus, NetworkStatus } from '@apps-in-toss/native-modules';
|
|
2176
2946
|
*
|
|
2177
2947
|
* function GetNetworkStatus() {
|
|
2178
2948
|
* const [status, setStatus] = useState<NetworkStatus | ''>('');
|
|
@@ -2216,7 +2986,7 @@ declare function getNetworkStatus(): Promise<NetworkStatus>;
|
|
|
2216
2986
|
*
|
|
2217
2987
|
*
|
|
2218
2988
|
* ```tsx
|
|
2219
|
-
* import { setIosSwipeGestureEnabled } from '
|
|
2989
|
+
* import { setIosSwipeGestureEnabled } from '@apps-in-toss/native-modules';
|
|
2220
2990
|
* import { Button } from 'react-native';
|
|
2221
2991
|
*
|
|
2222
2992
|
* function Page() {
|
|
@@ -2257,7 +3027,7 @@ declare function setIosSwipeGestureEnabled(options: {
|
|
|
2257
3027
|
* ### 외부 URL 열기
|
|
2258
3028
|
*
|
|
2259
3029
|
* ```tsx
|
|
2260
|
-
* import { openURL } from '
|
|
3030
|
+
* import { openURL } from '@apps-in-toss/native-modules';
|
|
2261
3031
|
* import { Button } from 'react-native';
|
|
2262
3032
|
*
|
|
2263
3033
|
* function Page() {
|
|
@@ -2293,7 +3063,7 @@ declare function openURL(url: string): Promise<any>;
|
|
|
2293
3063
|
* ### 현재 실행중인 OS 플랫폼 확인하기
|
|
2294
3064
|
*
|
|
2295
3065
|
* ```tsx
|
|
2296
|
-
* import { getPlatformOS } from '
|
|
3066
|
+
* import { getPlatformOS } from '@apps-in-toss/native-modules';
|
|
2297
3067
|
* import { Text } 'react-native';
|
|
2298
3068
|
*
|
|
2299
3069
|
* function Page() {
|
|
@@ -2349,4 +3119,4 @@ declare const INTERNAL__module: {
|
|
|
2349
3119
|
tossCoreEventLog: typeof tossCoreEventLog;
|
|
2350
3120
|
};
|
|
2351
3121
|
|
|
2352
|
-
export { Accuracy, AppsInTossModule, BedrockCoreModule, BedrockModule, type CheckoutPaymentOptions, type CheckoutPaymentResult, type ContactEntity, type ContactResult, type EventLogParams, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, GoogleAdMob, type HapticFeedbackType, AppsInTossModuleInstance as INTERNAL__AppsInTossModule, INTERNAL__module, type ImageResponse, type LoadAdMobInterstitialAdEvent, type LoadAdMobInterstitialAdOptions, type LoadAdMobRewardedAdEvent, type LoadAdMobRewardedAdOptions, type Location, type LocationCoords, type NetworkStatus, type OpenCameraOptions, type PermissionAccess, type PermissionName, type PermissionStatus, type Primitive, type SaveBase64DataParams, type ShowAdMobInterstitialAdEvent, type ShowAdMobInterstitialAdOptions, type ShowAdMobRewardedAdEvent, type ShowAdMobRewardedAdOptions, type StartUpdateLocationOptions$1 as StartUpdateLocationOptions, type StartUpdateLocationSubscription, Storage, TossPay, type UpdateLocationEventEmitter, appLogin, appsInTossEvent, closeView, eventLog, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getClipboardText, getCurrentLocation, getDeviceId, getLocale, getNetworkStatus, getOperationalEnvironment, getPlatformOS, getSchemeUri, getTossAppVersion, getTossShareLink, isMinVersionSupported, openCamera, openURL, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, startUpdateLocation };
|
|
3122
|
+
export { Accuracy, AppsInTossModule, BedrockCoreModule, BedrockModule, type CheckoutPaymentOptions, type CheckoutPaymentResult, type ContactEntity, type ContactResult, type ContactsViralParams, type EventLogParams, type FetchAlbumPhotosOptions, type GameCenterGameProfileResponse, type GetCurrentLocationOptions, GoogleAdMob, type HapticFeedbackType, IAP, AppsInTossModuleInstance as INTERNAL__AppsInTossModule, INTERNAL__module, type IapCreateOneTimePurchaseOrderOptions, type IapCreateOneTimePurchaseOrderResult, type IapProductListItem, type ImageResponse, type LoadAdMobEvent, type LoadAdMobInterstitialAdEvent, type LoadAdMobInterstitialAdOptions, type LoadAdMobOptions, type LoadAdMobParams, type LoadAdMobRewardedAdEvent, type LoadAdMobRewardedAdOptions, type Location, type LocationCoords, type NetworkStatus, type OpenCameraOptions, type PermissionAccess, type PermissionName, type PermissionStatus, type Primitive, type SaveBase64DataParams, type ShowAdMobEvent, type ShowAdMobInterstitialAdEvent, type ShowAdMobInterstitialAdOptions, type ShowAdMobOptions, type ShowAdMobParams, type ShowAdMobRewardedAdEvent, type ShowAdMobRewardedAdOptions, type StartUpdateLocationOptions$1 as StartUpdateLocationOptions, type StartUpdateLocationSubscription, 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, isMinVersionSupported, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openURL, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, startUpdateLocation, submitGameCenterLeaderBoardScore };
|