@apps-in-toss/native-modules 1.0.0 → 1.0.2
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/index.cjs +65 -1
- package/dist/index.d.cts +439 -137
- package/dist/index.d.ts +439 -137
- package/dist/index.js +65 -1
- package/package.json +4 -4
- package/src/AppsInTossModule/native-modules/ads/googleAdMob.ts +158 -167
- package/src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts +363 -0
- package/src/AppsInTossModule/native-modules/ads/types.ts +17 -0
- package/src/AppsInTossModule/native-modules/index.ts +22 -4
- package/src/utils/compareVersion.spec.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -501,6 +501,68 @@ loadAdMobRewardedAd.isSupported = createIsSupported();
|
|
|
501
501
|
showAdMobInterstitialAd.isSupported = createIsSupported();
|
|
502
502
|
showAdMobRewardedAd.isSupported = createIsSupported();
|
|
503
503
|
|
|
504
|
+
// src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts
|
|
505
|
+
var import_es_toolkit2 = require("es-toolkit");
|
|
506
|
+
function loadAppsInTossAdMob(params) {
|
|
507
|
+
if (!loadAppsInTossAdMob.isSupported()) {
|
|
508
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
509
|
+
return import_es_toolkit2.noop;
|
|
510
|
+
}
|
|
511
|
+
const { onEvent, onError, options } = params;
|
|
512
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAppsInTossAdmob", options, {
|
|
513
|
+
onSuccess: (result) => onEvent({ type: "loaded", data: result }),
|
|
514
|
+
onError
|
|
515
|
+
});
|
|
516
|
+
return unregisterCallbacks;
|
|
517
|
+
}
|
|
518
|
+
function showAppsInTossAdMob(params) {
|
|
519
|
+
if (!showAppsInTossAdMob.isSupported()) {
|
|
520
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
521
|
+
return import_es_toolkit2.noop;
|
|
522
|
+
}
|
|
523
|
+
const { onEvent, onError, options } = params;
|
|
524
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAppsInTossAdmob", options, {
|
|
525
|
+
onAdClicked: () => {
|
|
526
|
+
onEvent({ type: "clicked" });
|
|
527
|
+
},
|
|
528
|
+
onAdDismissed: () => {
|
|
529
|
+
onEvent({ type: "dismissed" });
|
|
530
|
+
},
|
|
531
|
+
onAdFailedToShow: () => {
|
|
532
|
+
onEvent({ type: "failedToShow" });
|
|
533
|
+
},
|
|
534
|
+
onAdImpression: () => {
|
|
535
|
+
onEvent({ type: "impression" });
|
|
536
|
+
},
|
|
537
|
+
onAdShow: () => {
|
|
538
|
+
onEvent({ type: "show" });
|
|
539
|
+
},
|
|
540
|
+
onUserEarnedReward: (data) => {
|
|
541
|
+
onEvent({ type: "userEarnedReward", data });
|
|
542
|
+
},
|
|
543
|
+
onSuccess: () => onEvent({ type: "requested" }),
|
|
544
|
+
onError
|
|
545
|
+
});
|
|
546
|
+
return unregisterCallbacks;
|
|
547
|
+
}
|
|
548
|
+
var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION2 = "5.227.0";
|
|
549
|
+
var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION2 = "5.227.0";
|
|
550
|
+
var UNSUPPORTED_ERROR_MESSAGE2 = "This feature is not supported in the current environment";
|
|
551
|
+
var ENVIRONMENT2 = getOperationalEnvironment();
|
|
552
|
+
function createIsSupported2() {
|
|
553
|
+
return () => {
|
|
554
|
+
if (ENVIRONMENT2 !== "toss") {
|
|
555
|
+
return false;
|
|
556
|
+
}
|
|
557
|
+
return isMinVersionSupported({
|
|
558
|
+
android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION2,
|
|
559
|
+
ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION2
|
|
560
|
+
});
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
loadAppsInTossAdMob.isSupported = createIsSupported2();
|
|
564
|
+
showAppsInTossAdMob.isSupported = createIsSupported2();
|
|
565
|
+
|
|
504
566
|
// src/AppsInTossModule/native-modules/checkoutPayment.ts
|
|
505
567
|
async function checkoutPayment(options) {
|
|
506
568
|
return AppsInTossModule.checkoutPayment({ params: options });
|
|
@@ -751,7 +813,9 @@ var GoogleAdMob = {
|
|
|
751
813
|
loadAdMobInterstitialAd,
|
|
752
814
|
showAdMobInterstitialAd,
|
|
753
815
|
loadAdMobRewardedAd,
|
|
754
|
-
showAdMobRewardedAd
|
|
816
|
+
showAdMobRewardedAd,
|
|
817
|
+
loadAppsInTossAdMob,
|
|
818
|
+
showAppsInTossAdMob
|
|
755
819
|
};
|
|
756
820
|
|
|
757
821
|
// src/BedrockModule/native-modules/natives/BedrockModule.ts
|