@apps-in-toss/web-bridge 1.7.0 → 1.8.0
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/CHANGELOG.md +10 -0
- package/{built → dist}/index.cjs +19 -265
- package/{built → dist}/index.d.cts +14 -270
- package/{built → dist}/index.d.ts +14 -270
- package/{built → dist}/index.js +60 -306
- package/package.json +12 -12
- /package/{built → dist}/appLogin.d.ts +0 -0
- /package/{built → dist}/appsInTossSignTossCert.d.ts +0 -0
- /package/{built → dist}/bridge.d.ts +0 -0
- /package/{built → dist}/bridge.js +0 -0
- /package/{built → dist}/checkoutPayment.d.ts +0 -0
- /package/{built → dist}/closeView.d.ts +0 -0
- /package/{built → dist}/contactsViral.d.ts +0 -0
- /package/{built → dist}/eventLog.d.ts +0 -0
- /package/{built → dist}/fetchAlbumPhotos.d.ts +0 -0
- /package/{built → dist}/fetchContacts.d.ts +0 -0
- /package/{built → dist}/generateHapticFeedback.d.ts +0 -0
- /package/{built → dist}/getClipboardText.d.ts +0 -0
- /package/{built → dist}/getCurrentLocation.d.ts +0 -0
- /package/{built → dist}/getDeviceId.d.ts +0 -0
- /package/{built → dist}/getGameCenterGameProfile.d.ts +0 -0
- /package/{built → dist}/getIsTossLoginIntegratedService.d.ts +0 -0
- /package/{built → dist}/getLocale.d.ts +0 -0
- /package/{built → dist}/getNetworkStatus.d.ts +0 -0
- /package/{built → dist}/getOperationalEnvironment.d.ts +0 -0
- /package/{built → dist}/getPermission.d.ts +0 -0
- /package/{built → dist}/getPlatformOS.d.ts +0 -0
- /package/{built → dist}/getSchemeUri.d.ts +0 -0
- /package/{built → dist}/getTossAppVersion.d.ts +0 -0
- /package/{built → dist}/getTossShareLink.d.ts +0 -0
- /package/{built → dist}/getUserKeyForGame.d.ts +0 -0
- /package/{built → dist}/grantPromotionRewardForGame.d.ts +0 -0
- /package/{built → dist}/onVisibilityChangedByTransparentServiceWeb.d.ts +0 -0
- /package/{built → dist}/openCamera.d.ts +0 -0
- /package/{built → dist}/openGameCenterLeaderboard.d.ts +0 -0
- /package/{built → dist}/openPermissionDialog.d.ts +0 -0
- /package/{built → dist}/openURL.d.ts +0 -0
- /package/{built → dist}/requestPermission.d.ts +0 -0
- /package/{built → dist}/saveBase64Data.d.ts +0 -0
- /package/{built → dist}/setClipboardText.d.ts +0 -0
- /package/{built → dist}/setDeviceOrientation.d.ts +0 -0
- /package/{built → dist}/setIosSwipeGestureEnabled.d.ts +0 -0
- /package/{built → dist}/setScreenAwakeMode.d.ts +0 -0
- /package/{built → dist}/setSecureScreen.d.ts +0 -0
- /package/{built → dist}/share.d.ts +0 -0
- /package/{built → dist}/startUpdateLocation.d.ts +0 -0
- /package/{built → dist}/submitGameCenterLeaderBoardScore.d.ts +0 -0
- /package/{built → dist}/types.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @apps-in-toss/web-bridge
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
[[AIT-3762]: GoogleAdMob 로딩 여부 확인하는 브릿지 추가](https://github.toss.bz/toss/apps-in-toss-sdk/pull/18)
|
|
8
|
+
|
|
9
|
+
구글 광고가 로딩되었는지 확인하는 isAdMobLoaded를 추가합니다.
|
|
10
|
+
|
|
11
|
+
## 1.7.1
|
|
12
|
+
|
|
3
13
|
## 1.7.0
|
|
4
14
|
|
|
5
15
|
## 1.6.2
|
package/{built → dist}/index.cjs
RENAMED
|
@@ -377,12 +377,9 @@ var IAP = {
|
|
|
377
377
|
|
|
378
378
|
// src/getSafeAreaInsets.ts
|
|
379
379
|
var import_bridge_core4 = require("@apps-in-toss/bridge-core");
|
|
380
|
-
var
|
|
381
|
-
var getSafeAreaTop = (0, import_bridge_core4.createConstantBridge)("getSafeAreaTop");
|
|
382
|
-
var getSafeAreaLeft = (0, import_bridge_core4.createConstantBridge)("getSafeAreaLeft");
|
|
383
|
-
var getSafeAreaRight = (0, import_bridge_core4.createConstantBridge)("getSafeAreaRight");
|
|
380
|
+
var _getSafeAreaInsets = (0, import_bridge_core4.createConstantBridge)("getSafeAreaInsets");
|
|
384
381
|
function getSafeAreaInsets() {
|
|
385
|
-
return
|
|
382
|
+
return _getSafeAreaInsets();
|
|
386
383
|
}
|
|
387
384
|
|
|
388
385
|
// src/safeAreaInsets.ts
|
|
@@ -394,272 +391,15 @@ function subscribeSafeAreaInsets({ onEvent }) {
|
|
|
394
391
|
}
|
|
395
392
|
});
|
|
396
393
|
}
|
|
394
|
+
var _getSafeAreaInsets2 = (0, import_bridge_core5.createConstantBridge)("getSafeAreaInsets");
|
|
397
395
|
var SafeAreaInsets = {
|
|
398
|
-
get:
|
|
396
|
+
get: _getSafeAreaInsets2,
|
|
399
397
|
subscribe: subscribeSafeAreaInsets
|
|
400
398
|
};
|
|
401
399
|
|
|
402
400
|
// src/googleAdMob.ts
|
|
403
401
|
var import_bridge_core6 = require("@apps-in-toss/bridge-core");
|
|
404
402
|
var GoogleAdMob = {
|
|
405
|
-
/**
|
|
406
|
-
* @public
|
|
407
|
-
* @category 광고
|
|
408
|
-
* @name loadAdMobInterstitialAd
|
|
409
|
-
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.loadAppsInTossAdMob}를 사용해주세요.
|
|
410
|
-
*
|
|
411
|
-
* @example
|
|
412
|
-
* ### 뷰 진입 시 광고 불러오기 (loadAppsInTossAdMob로 변경 예제)
|
|
413
|
-
* ```tsx
|
|
414
|
-
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
415
|
-
* import { useEffect } from 'react';
|
|
416
|
-
* import { View, Text } from 'react-native';
|
|
417
|
-
*
|
|
418
|
-
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
419
|
-
*
|
|
420
|
-
* function Page() {
|
|
421
|
-
* useEffect(() => {
|
|
422
|
-
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
423
|
-
* return;
|
|
424
|
-
* }
|
|
425
|
-
*
|
|
426
|
-
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
427
|
-
* options: {
|
|
428
|
-
* adGroupId: AD_GROUP_ID,
|
|
429
|
-
* },
|
|
430
|
-
* onEvent: (event) => {
|
|
431
|
-
* switch (event.type) {
|
|
432
|
-
* case 'loaded':
|
|
433
|
-
* console.log('광고 로드 성공', event.data);
|
|
434
|
-
* break;
|
|
435
|
-
* }
|
|
436
|
-
* },
|
|
437
|
-
* onError: (error) => {
|
|
438
|
-
* console.error('광고 불러오기 실패', error);
|
|
439
|
-
* },
|
|
440
|
-
* });
|
|
441
|
-
*
|
|
442
|
-
* return cleanup;
|
|
443
|
-
* }, []);
|
|
444
|
-
*
|
|
445
|
-
* return (
|
|
446
|
-
* <View>
|
|
447
|
-
* <Text>Page</Text>
|
|
448
|
-
* </View>
|
|
449
|
-
* );
|
|
450
|
-
* }
|
|
451
|
-
* ```
|
|
452
|
-
*/
|
|
453
|
-
loadAdMobInterstitialAd: Object.assign(
|
|
454
|
-
(0, import_bridge_core6.createEventBridge)("loadAdMobInterstitialAd"),
|
|
455
|
-
{
|
|
456
|
-
isSupported: (0, import_bridge_core6.createConstantBridge)("loadAdMobInterstitialAd_isSupported")
|
|
457
|
-
}
|
|
458
|
-
),
|
|
459
|
-
/**
|
|
460
|
-
* @public
|
|
461
|
-
* @category 광고
|
|
462
|
-
* @name showAdMobInterstitialAd
|
|
463
|
-
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.showAppsInTossAdMob}를 사용해주세요.
|
|
464
|
-
*
|
|
465
|
-
* @example
|
|
466
|
-
* ### 버튼 눌러 불러온 광고 보여주기 (showAppsInTossAdMob로 대체 사용)
|
|
467
|
-
* ```tsx
|
|
468
|
-
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
469
|
-
* import { View, Text, Button } from 'react-native';
|
|
470
|
-
*
|
|
471
|
-
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
472
|
-
*
|
|
473
|
-
* function Page() {
|
|
474
|
-
* const handlePress = () => {
|
|
475
|
-
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
476
|
-
* return;
|
|
477
|
-
* }
|
|
478
|
-
*
|
|
479
|
-
* GoogleAdMob.showAppsInTossAdMob({
|
|
480
|
-
* options: {
|
|
481
|
-
* adGroupId: AD_GROUP_ID,
|
|
482
|
-
* },
|
|
483
|
-
* onEvent: (event) => {
|
|
484
|
-
* switch (event.type) {
|
|
485
|
-
* case 'requested':
|
|
486
|
-
* console.log('광고 보여주기 요청 완료');
|
|
487
|
-
* break;
|
|
488
|
-
*
|
|
489
|
-
* case 'clicked':
|
|
490
|
-
* console.log('광고 클릭');
|
|
491
|
-
* break;
|
|
492
|
-
*
|
|
493
|
-
* case 'dismissed':
|
|
494
|
-
* console.log('광고 닫힘');
|
|
495
|
-
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
496
|
-
* break;
|
|
497
|
-
*
|
|
498
|
-
* case 'failedToShow':
|
|
499
|
-
* console.log('광고 보여주기 실패');
|
|
500
|
-
* break;
|
|
501
|
-
*
|
|
502
|
-
* case 'impression':
|
|
503
|
-
* console.log('광고 노출');
|
|
504
|
-
* break;
|
|
505
|
-
*
|
|
506
|
-
* case 'userEarnedReward':
|
|
507
|
-
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
508
|
-
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
509
|
-
* break;
|
|
510
|
-
*
|
|
511
|
-
* case 'show':
|
|
512
|
-
* console.log('광고 컨텐츠 보여졌음');
|
|
513
|
-
* break;
|
|
514
|
-
* }
|
|
515
|
-
* },
|
|
516
|
-
* onError: (error) => {
|
|
517
|
-
* console.error('광고 보여주기 실패', error);
|
|
518
|
-
* },
|
|
519
|
-
* });
|
|
520
|
-
* }
|
|
521
|
-
*
|
|
522
|
-
* return (
|
|
523
|
-
* <Button onPress={handlePress} title="광고 보기" />
|
|
524
|
-
* );
|
|
525
|
-
* }
|
|
526
|
-
* ```
|
|
527
|
-
*/
|
|
528
|
-
showAdMobInterstitialAd: Object.assign(
|
|
529
|
-
(0, import_bridge_core6.createEventBridge)("showAdMobInterstitialAd"),
|
|
530
|
-
{
|
|
531
|
-
isSupported: (0, import_bridge_core6.createConstantBridge)("showAdMobInterstitialAd_isSupported")
|
|
532
|
-
}
|
|
533
|
-
),
|
|
534
|
-
/**
|
|
535
|
-
* @public
|
|
536
|
-
* @category 광고
|
|
537
|
-
* @name loadAdMobRewardedAd
|
|
538
|
-
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.loadAppsInTossAdMob}를 사용해주세요.
|
|
539
|
-
*
|
|
540
|
-
* @example
|
|
541
|
-
* ### 뷰 진입 시 광고 불러오기 (loadAppsInTossAdMob로 변경 예제)
|
|
542
|
-
* ```tsx
|
|
543
|
-
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
544
|
-
* import { useEffect } from 'react';
|
|
545
|
-
* import { View, Text } from 'react-native';
|
|
546
|
-
*
|
|
547
|
-
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
548
|
-
*
|
|
549
|
-
* function Page() {
|
|
550
|
-
* useEffect(() => {
|
|
551
|
-
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
552
|
-
* return;
|
|
553
|
-
* }
|
|
554
|
-
*
|
|
555
|
-
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
556
|
-
* options: {
|
|
557
|
-
* adGroupId: AD_GROUP_ID,
|
|
558
|
-
* },
|
|
559
|
-
* onEvent: (event) => {
|
|
560
|
-
* switch (event.type) {
|
|
561
|
-
* case 'loaded':
|
|
562
|
-
* console.log('광고 로드 성공', event.data);
|
|
563
|
-
* break;
|
|
564
|
-
* }
|
|
565
|
-
* },
|
|
566
|
-
* onError: (error) => {
|
|
567
|
-
* console.error('광고 불러오기 실패', error);
|
|
568
|
-
* },
|
|
569
|
-
* });
|
|
570
|
-
*
|
|
571
|
-
* return cleanup;
|
|
572
|
-
* }, []);
|
|
573
|
-
*
|
|
574
|
-
* return (
|
|
575
|
-
* <View>
|
|
576
|
-
* <Text>Page</Text>
|
|
577
|
-
* </View>
|
|
578
|
-
* );
|
|
579
|
-
* }
|
|
580
|
-
* ```
|
|
581
|
-
*/
|
|
582
|
-
loadAdMobRewardedAd: Object.assign(
|
|
583
|
-
(0, import_bridge_core6.createEventBridge)("loadAdMobRewardedAd"),
|
|
584
|
-
{
|
|
585
|
-
isSupported: (0, import_bridge_core6.createConstantBridge)("loadAdMobRewardedAd_isSupported")
|
|
586
|
-
}
|
|
587
|
-
),
|
|
588
|
-
/**
|
|
589
|
-
* @public
|
|
590
|
-
* @category 광고
|
|
591
|
-
* @name showAdMobRewardedAd
|
|
592
|
-
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.showAppsInTossAdMob}를 사용해주세요.
|
|
593
|
-
*
|
|
594
|
-
* @example
|
|
595
|
-
* ### 버튼 눌러 불러온 광고 보여주기 (showAppsInTossAdMob로 대체 사용)
|
|
596
|
-
* ```tsx
|
|
597
|
-
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
598
|
-
* import { View, Text, Button } from 'react-native';
|
|
599
|
-
*
|
|
600
|
-
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
601
|
-
*
|
|
602
|
-
* function Page() {
|
|
603
|
-
* const handlePress = () => {
|
|
604
|
-
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
605
|
-
* return;
|
|
606
|
-
* }
|
|
607
|
-
*
|
|
608
|
-
* GoogleAdMob.showAppsInTossAdMob({
|
|
609
|
-
* options: {
|
|
610
|
-
* adGroupId: AD_GROUP_ID,
|
|
611
|
-
* },
|
|
612
|
-
* onEvent: (event) => {
|
|
613
|
-
* switch (event.type) {
|
|
614
|
-
* case 'requested':
|
|
615
|
-
* console.log('광고 보여주기 요청 완료');
|
|
616
|
-
* break;
|
|
617
|
-
*
|
|
618
|
-
* case 'clicked':
|
|
619
|
-
* console.log('광고 클릭');
|
|
620
|
-
* break;
|
|
621
|
-
*
|
|
622
|
-
* case 'dismissed':
|
|
623
|
-
* console.log('광고 닫힘');
|
|
624
|
-
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
625
|
-
* break;
|
|
626
|
-
*
|
|
627
|
-
* case 'failedToShow':
|
|
628
|
-
* console.log('광고 보여주기 실패');
|
|
629
|
-
* break;
|
|
630
|
-
*
|
|
631
|
-
* case 'impression':
|
|
632
|
-
* console.log('광고 노출');
|
|
633
|
-
* break;
|
|
634
|
-
*
|
|
635
|
-
* case 'userEarnedReward':
|
|
636
|
-
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
637
|
-
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
638
|
-
* break;
|
|
639
|
-
*
|
|
640
|
-
* case 'show':
|
|
641
|
-
* console.log('광고 컨텐츠 보여졌음');
|
|
642
|
-
* break;
|
|
643
|
-
* }
|
|
644
|
-
* },
|
|
645
|
-
* onError: (error) => {
|
|
646
|
-
* console.error('광고 보여주기 실패', error);
|
|
647
|
-
* },
|
|
648
|
-
* });
|
|
649
|
-
* }
|
|
650
|
-
*
|
|
651
|
-
* return (
|
|
652
|
-
* <Button onPress={handlePress} title="광고 보기" />
|
|
653
|
-
* );
|
|
654
|
-
* }
|
|
655
|
-
* ```
|
|
656
|
-
*/
|
|
657
|
-
showAdMobRewardedAd: Object.assign(
|
|
658
|
-
(0, import_bridge_core6.createEventBridge)("showAdMobRewardedAd"),
|
|
659
|
-
{
|
|
660
|
-
isSupported: (0, import_bridge_core6.createConstantBridge)("showAdMobRewardedAd_isSupported")
|
|
661
|
-
}
|
|
662
|
-
),
|
|
663
403
|
/**
|
|
664
404
|
* @public
|
|
665
405
|
* @category 광고
|
|
@@ -794,7 +534,21 @@ var GoogleAdMob = {
|
|
|
794
534
|
*/
|
|
795
535
|
showAppsInTossAdMob: Object.assign((0, import_bridge_core6.createEventBridge)("showAppsInTossAdMob"), {
|
|
796
536
|
isSupported: (0, import_bridge_core6.createConstantBridge)("showAppsInTossAdMob_isSupported")
|
|
797
|
-
})
|
|
537
|
+
}),
|
|
538
|
+
/**
|
|
539
|
+
* @public
|
|
540
|
+
* @category 광고
|
|
541
|
+
* @name showAppsInTossAdMob
|
|
542
|
+
* @description 이 함수는 `loadAppsInTossAdMob` 로 광고가 잘 불러와졌는지 확인해요.
|
|
543
|
+
* @param {string} params.adUnitId 광고 그룹 단위 ID예요.
|
|
544
|
+
* @property {() => boolean} [isSupported] 현재 실행 중인 앱(예: 토스 앱, 개발용 샌드박스 앱 등)에서 `isAppsInTossAdMobLoaded` 를 지원하는지 확인하는 함수예요. 기능을 사용하기 전에 지원 여부를 확인해야 해요.
|
|
545
|
+
*/
|
|
546
|
+
isAppsInTossAdMobLoaded: Object.assign(
|
|
547
|
+
(0, import_bridge_core6.createAsyncBridge)("isAppsInTossAdMobLoaded"),
|
|
548
|
+
{
|
|
549
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("isAppsInTossAdMobLoaded_isSupported")
|
|
550
|
+
}
|
|
551
|
+
)
|
|
798
552
|
};
|
|
799
553
|
|
|
800
554
|
// src/graniteEvent.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './bridge';
|
|
2
2
|
export * from '@apps-in-toss/bridge-core';
|
|
3
|
-
import {
|
|
3
|
+
import { LoadAdMobEvent, LoadAdMobOptions, ShowAdMobEvent, ShowAdMobOptions, IsAdMobLoadedOptions, LoadFullScreenAdEvent, LoadFullScreenAdOptions, ShowFullScreenAdEvent, ShowFullScreenAdOptions } from '@apps-in-toss/framework';
|
|
4
4
|
import * as _apps_in_toss_types from '@apps-in-toss/types';
|
|
5
5
|
import { FetchAlbumPhotos, FetchContacts, GetCurrentLocation, OpenCamera, SetClipboardText, GetClipboardText, StartUpdateLocationEventParams } from '@apps-in-toss/types';
|
|
6
6
|
export * from '@apps-in-toss/types';
|
|
@@ -310,12 +310,7 @@ declare const IAP: {
|
|
|
310
310
|
*
|
|
311
311
|
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link SafeAreaInsets.get}를 사용해주세요.
|
|
312
312
|
*/
|
|
313
|
-
declare function getSafeAreaInsets():
|
|
314
|
-
top: number;
|
|
315
|
-
bottom: number;
|
|
316
|
-
left: number;
|
|
317
|
-
right: number;
|
|
318
|
-
};
|
|
313
|
+
declare function getSafeAreaInsets(): number;
|
|
319
314
|
|
|
320
315
|
/**
|
|
321
316
|
* @public
|
|
@@ -351,273 +346,11 @@ interface SafeAreaInsets$1 {
|
|
|
351
346
|
right: number;
|
|
352
347
|
}
|
|
353
348
|
declare const SafeAreaInsets$1: {
|
|
354
|
-
get:
|
|
349
|
+
get: () => SafeAreaInsets$1;
|
|
355
350
|
subscribe: typeof subscribeSafeAreaInsets;
|
|
356
351
|
};
|
|
357
352
|
|
|
358
353
|
declare const GoogleAdMob: {
|
|
359
|
-
/**
|
|
360
|
-
* @public
|
|
361
|
-
* @category 광고
|
|
362
|
-
* @name loadAdMobInterstitialAd
|
|
363
|
-
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.loadAppsInTossAdMob}를 사용해주세요.
|
|
364
|
-
*
|
|
365
|
-
* @example
|
|
366
|
-
* ### 뷰 진입 시 광고 불러오기 (loadAppsInTossAdMob로 변경 예제)
|
|
367
|
-
* ```tsx
|
|
368
|
-
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
369
|
-
* import { useEffect } from 'react';
|
|
370
|
-
* import { View, Text } from 'react-native';
|
|
371
|
-
*
|
|
372
|
-
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
373
|
-
*
|
|
374
|
-
* function Page() {
|
|
375
|
-
* useEffect(() => {
|
|
376
|
-
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
377
|
-
* return;
|
|
378
|
-
* }
|
|
379
|
-
*
|
|
380
|
-
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
381
|
-
* options: {
|
|
382
|
-
* adGroupId: AD_GROUP_ID,
|
|
383
|
-
* },
|
|
384
|
-
* onEvent: (event) => {
|
|
385
|
-
* switch (event.type) {
|
|
386
|
-
* case 'loaded':
|
|
387
|
-
* console.log('광고 로드 성공', event.data);
|
|
388
|
-
* break;
|
|
389
|
-
* }
|
|
390
|
-
* },
|
|
391
|
-
* onError: (error) => {
|
|
392
|
-
* console.error('광고 불러오기 실패', error);
|
|
393
|
-
* },
|
|
394
|
-
* });
|
|
395
|
-
*
|
|
396
|
-
* return cleanup;
|
|
397
|
-
* }, []);
|
|
398
|
-
*
|
|
399
|
-
* return (
|
|
400
|
-
* <View>
|
|
401
|
-
* <Text>Page</Text>
|
|
402
|
-
* </View>
|
|
403
|
-
* );
|
|
404
|
-
* }
|
|
405
|
-
* ```
|
|
406
|
-
*/
|
|
407
|
-
loadAdMobInterstitialAd: ((args: {
|
|
408
|
-
onEvent: (data: LoadAdMobInterstitialAdEvent) => void;
|
|
409
|
-
onError: (error: Error) => void;
|
|
410
|
-
options?: LoadAdMobInterstitialAdOptions | undefined;
|
|
411
|
-
}) => () => void) & {
|
|
412
|
-
isSupported: () => boolean;
|
|
413
|
-
};
|
|
414
|
-
/**
|
|
415
|
-
* @public
|
|
416
|
-
* @category 광고
|
|
417
|
-
* @name showAdMobInterstitialAd
|
|
418
|
-
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.showAppsInTossAdMob}를 사용해주세요.
|
|
419
|
-
*
|
|
420
|
-
* @example
|
|
421
|
-
* ### 버튼 눌러 불러온 광고 보여주기 (showAppsInTossAdMob로 대체 사용)
|
|
422
|
-
* ```tsx
|
|
423
|
-
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
424
|
-
* import { View, Text, Button } from 'react-native';
|
|
425
|
-
*
|
|
426
|
-
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
427
|
-
*
|
|
428
|
-
* function Page() {
|
|
429
|
-
* const handlePress = () => {
|
|
430
|
-
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
431
|
-
* return;
|
|
432
|
-
* }
|
|
433
|
-
*
|
|
434
|
-
* GoogleAdMob.showAppsInTossAdMob({
|
|
435
|
-
* options: {
|
|
436
|
-
* adGroupId: AD_GROUP_ID,
|
|
437
|
-
* },
|
|
438
|
-
* onEvent: (event) => {
|
|
439
|
-
* switch (event.type) {
|
|
440
|
-
* case 'requested':
|
|
441
|
-
* console.log('광고 보여주기 요청 완료');
|
|
442
|
-
* break;
|
|
443
|
-
*
|
|
444
|
-
* case 'clicked':
|
|
445
|
-
* console.log('광고 클릭');
|
|
446
|
-
* break;
|
|
447
|
-
*
|
|
448
|
-
* case 'dismissed':
|
|
449
|
-
* console.log('광고 닫힘');
|
|
450
|
-
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
451
|
-
* break;
|
|
452
|
-
*
|
|
453
|
-
* case 'failedToShow':
|
|
454
|
-
* console.log('광고 보여주기 실패');
|
|
455
|
-
* break;
|
|
456
|
-
*
|
|
457
|
-
* case 'impression':
|
|
458
|
-
* console.log('광고 노출');
|
|
459
|
-
* break;
|
|
460
|
-
*
|
|
461
|
-
* case 'userEarnedReward':
|
|
462
|
-
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
463
|
-
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
464
|
-
* break;
|
|
465
|
-
*
|
|
466
|
-
* case 'show':
|
|
467
|
-
* console.log('광고 컨텐츠 보여졌음');
|
|
468
|
-
* break;
|
|
469
|
-
* }
|
|
470
|
-
* },
|
|
471
|
-
* onError: (error) => {
|
|
472
|
-
* console.error('광고 보여주기 실패', error);
|
|
473
|
-
* },
|
|
474
|
-
* });
|
|
475
|
-
* }
|
|
476
|
-
*
|
|
477
|
-
* return (
|
|
478
|
-
* <Button onPress={handlePress} title="광고 보기" />
|
|
479
|
-
* );
|
|
480
|
-
* }
|
|
481
|
-
* ```
|
|
482
|
-
*/
|
|
483
|
-
showAdMobInterstitialAd: ((args: {
|
|
484
|
-
onEvent: (data: ShowAdMobInterstitialAdEvent) => void;
|
|
485
|
-
onError: (error: Error) => void;
|
|
486
|
-
options?: ShowAdMobInterstitialAdOptions | undefined;
|
|
487
|
-
}) => () => void) & {
|
|
488
|
-
isSupported: () => boolean;
|
|
489
|
-
};
|
|
490
|
-
/**
|
|
491
|
-
* @public
|
|
492
|
-
* @category 광고
|
|
493
|
-
* @name loadAdMobRewardedAd
|
|
494
|
-
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.loadAppsInTossAdMob}를 사용해주세요.
|
|
495
|
-
*
|
|
496
|
-
* @example
|
|
497
|
-
* ### 뷰 진입 시 광고 불러오기 (loadAppsInTossAdMob로 변경 예제)
|
|
498
|
-
* ```tsx
|
|
499
|
-
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
500
|
-
* import { useEffect } from 'react';
|
|
501
|
-
* import { View, Text } from 'react-native';
|
|
502
|
-
*
|
|
503
|
-
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
504
|
-
*
|
|
505
|
-
* function Page() {
|
|
506
|
-
* useEffect(() => {
|
|
507
|
-
* if (GoogleAdMob.loadAppsInTossAdMob.isSupported() !== true) {
|
|
508
|
-
* return;
|
|
509
|
-
* }
|
|
510
|
-
*
|
|
511
|
-
* const cleanup = GoogleAdMob.loadAppsInTossAdMob({
|
|
512
|
-
* options: {
|
|
513
|
-
* adGroupId: AD_GROUP_ID,
|
|
514
|
-
* },
|
|
515
|
-
* onEvent: (event) => {
|
|
516
|
-
* switch (event.type) {
|
|
517
|
-
* case 'loaded':
|
|
518
|
-
* console.log('광고 로드 성공', event.data);
|
|
519
|
-
* break;
|
|
520
|
-
* }
|
|
521
|
-
* },
|
|
522
|
-
* onError: (error) => {
|
|
523
|
-
* console.error('광고 불러오기 실패', error);
|
|
524
|
-
* },
|
|
525
|
-
* });
|
|
526
|
-
*
|
|
527
|
-
* return cleanup;
|
|
528
|
-
* }, []);
|
|
529
|
-
*
|
|
530
|
-
* return (
|
|
531
|
-
* <View>
|
|
532
|
-
* <Text>Page</Text>
|
|
533
|
-
* </View>
|
|
534
|
-
* );
|
|
535
|
-
* }
|
|
536
|
-
* ```
|
|
537
|
-
*/
|
|
538
|
-
loadAdMobRewardedAd: ((args: {
|
|
539
|
-
onEvent: (data: LoadAdMobRewardedAdEvent) => void;
|
|
540
|
-
onError: (error: Error) => void;
|
|
541
|
-
options?: LoadAdMobRewardedAdOptions | undefined;
|
|
542
|
-
}) => () => void) & {
|
|
543
|
-
isSupported: () => boolean;
|
|
544
|
-
};
|
|
545
|
-
/**
|
|
546
|
-
* @public
|
|
547
|
-
* @category 광고
|
|
548
|
-
* @name showAdMobRewardedAd
|
|
549
|
-
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link GoogleAdMob.showAppsInTossAdMob}를 사용해주세요.
|
|
550
|
-
*
|
|
551
|
-
* @example
|
|
552
|
-
* ### 버튼 눌러 불러온 광고 보여주기 (showAppsInTossAdMob로 대체 사용)
|
|
553
|
-
* ```tsx
|
|
554
|
-
* import { GoogleAdMob } from '@apps-in-toss/framework';
|
|
555
|
-
* import { View, Text, Button } from 'react-native';
|
|
556
|
-
*
|
|
557
|
-
* const AD_GROUP_ID = '<AD_GROUP_ID>';
|
|
558
|
-
*
|
|
559
|
-
* function Page() {
|
|
560
|
-
* const handlePress = () => {
|
|
561
|
-
* if (GoogleAdMob.showAppsInTossAdMob.isSupported() !== true) {
|
|
562
|
-
* return;
|
|
563
|
-
* }
|
|
564
|
-
*
|
|
565
|
-
* GoogleAdMob.showAppsInTossAdMob({
|
|
566
|
-
* options: {
|
|
567
|
-
* adGroupId: AD_GROUP_ID,
|
|
568
|
-
* },
|
|
569
|
-
* onEvent: (event) => {
|
|
570
|
-
* switch (event.type) {
|
|
571
|
-
* case 'requested':
|
|
572
|
-
* console.log('광고 보여주기 요청 완료');
|
|
573
|
-
* break;
|
|
574
|
-
*
|
|
575
|
-
* case 'clicked':
|
|
576
|
-
* console.log('광고 클릭');
|
|
577
|
-
* break;
|
|
578
|
-
*
|
|
579
|
-
* case 'dismissed':
|
|
580
|
-
* console.log('광고 닫힘');
|
|
581
|
-
* navigation.navigate('/examples/google-admob-interstitial-ad-landing');
|
|
582
|
-
* break;
|
|
583
|
-
*
|
|
584
|
-
* case 'failedToShow':
|
|
585
|
-
* console.log('광고 보여주기 실패');
|
|
586
|
-
* break;
|
|
587
|
-
*
|
|
588
|
-
* case 'impression':
|
|
589
|
-
* console.log('광고 노출');
|
|
590
|
-
* break;
|
|
591
|
-
*
|
|
592
|
-
* case 'userEarnedReward':
|
|
593
|
-
* console.log('광고 보상 획득 unitType:', event.data.unitType);
|
|
594
|
-
* console.log('광고 보상 획득 unitAmount:', event.data.unitAmount);
|
|
595
|
-
* break;
|
|
596
|
-
*
|
|
597
|
-
* case 'show':
|
|
598
|
-
* console.log('광고 컨텐츠 보여졌음');
|
|
599
|
-
* break;
|
|
600
|
-
* }
|
|
601
|
-
* },
|
|
602
|
-
* onError: (error) => {
|
|
603
|
-
* console.error('광고 보여주기 실패', error);
|
|
604
|
-
* },
|
|
605
|
-
* });
|
|
606
|
-
* }
|
|
607
|
-
*
|
|
608
|
-
* return (
|
|
609
|
-
* <Button onPress={handlePress} title="광고 보기" />
|
|
610
|
-
* );
|
|
611
|
-
* }
|
|
612
|
-
* ```
|
|
613
|
-
*/
|
|
614
|
-
showAdMobRewardedAd: ((args: {
|
|
615
|
-
onEvent: (data: ShowAdMobRewardedAdEvent) => void;
|
|
616
|
-
onError: (error: Error) => void;
|
|
617
|
-
options?: ShowAdMobRewardedAdOptions | undefined;
|
|
618
|
-
}) => () => void) & {
|
|
619
|
-
isSupported: () => boolean;
|
|
620
|
-
};
|
|
621
354
|
/**
|
|
622
355
|
* @public
|
|
623
356
|
* @category 광고
|
|
@@ -761,6 +494,17 @@ declare const GoogleAdMob: {
|
|
|
761
494
|
}) => () => void) & {
|
|
762
495
|
isSupported: () => boolean;
|
|
763
496
|
};
|
|
497
|
+
/**
|
|
498
|
+
* @public
|
|
499
|
+
* @category 광고
|
|
500
|
+
* @name showAppsInTossAdMob
|
|
501
|
+
* @description 이 함수는 `loadAppsInTossAdMob` 로 광고가 잘 불러와졌는지 확인해요.
|
|
502
|
+
* @param {string} params.adUnitId 광고 그룹 단위 ID예요.
|
|
503
|
+
* @property {() => boolean} [isSupported] 현재 실행 중인 앱(예: 토스 앱, 개발용 샌드박스 앱 등)에서 `isAppsInTossAdMobLoaded` 를 지원하는지 확인하는 함수예요. 기능을 사용하기 전에 지원 여부를 확인해야 해요.
|
|
504
|
+
*/
|
|
505
|
+
isAppsInTossAdMobLoaded: ((args_0: IsAdMobLoadedOptions) => Promise<boolean>) & {
|
|
506
|
+
isSupported: () => boolean;
|
|
507
|
+
};
|
|
764
508
|
};
|
|
765
509
|
|
|
766
510
|
type GraniteEvent = {
|