react-native-daro 1.0.13 → 1.0.16
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/LICENSE +1 -1
- package/README.md +30 -30
- package/android/build.gradle +52 -59
- package/android/src/admob/java/com/daro/reactnative/DaroSdkBridge.kt +23 -0
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/com/{darom → daro/reactnative}/DaroMAdBannerViewManager.kt +38 -15
- package/android/src/main/java/com/daro/reactnative/DaroMAdNativeViewManager.kt +167 -0
- package/android/src/main/java/com/daro/reactnative/DaroMModule.kt +257 -0
- package/android/src/main/java/com/daro/reactnative/DaroMPackage.kt +45 -0
- package/android/src/main/java/com/daro/reactnative/DaroMediaViewManager.kt +25 -0
- package/android/src/main/java/com/{darom → daro/reactnative}/constants/InternalDaroMBannerSize.kt +1 -1
- package/android/src/main/java/com/{darom → daro/reactnative}/event/DaroMEvent.kt +19 -8
- package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMBannerViewModuleImpl.kt +2 -2
- package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMInterstitialModuleImpl.kt +26 -26
- package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMLightPopupModuleImpl.kt +30 -29
- package/android/src/main/java/com/{darom → daro/reactnative}/impl/DaroMRewardedAdModuleImpl.kt +27 -27
- package/android/src/main/java/com/{darom → daro/reactnative}/util/AdInfoUtil.kt +25 -1
- package/android/src/main/java/com/daro/reactnative/util/EventEmitterUtil.kt +37 -0
- package/android/src/main/java/com/daro/reactnative/view/DaroMAdBannerViewContainer.kt +417 -0
- package/android/src/main/java/com/daro/reactnative/view/DaroMAdNativeViewContainer.kt +624 -0
- package/android/src/main/java/com/daro/reactnative/view/DaroMediaView.kt +123 -0
- package/android/src/newarch/java/com/daro/reactnative/DaroMModuleSpec.kt +6 -0
- package/android/src/oldarch/java/com/daro/reactnative/DaroMModuleSpec.kt +90 -0
- package/app.plugin.js +1 -0
- package/ios/DaroMModule+AppOpen.swift +38 -32
- package/ios/DaroMModule+Interstitial.swift +32 -26
- package/ios/DaroMModule+LightPopup.swift +43 -33
- package/ios/DaroMModule+Rewarded.swift +38 -27
- package/ios/DaroMModule.mm +45 -17
- package/ios/DaroMModule.swift +24 -17
- package/ios/Fabric/DaroMAdBannerComponentView.mm +207 -0
- package/ios/Fabric/DaroMFabricEventSink.mm +31 -0
- package/ios/Fabric/DaroMFabricPropApplier.mm +123 -0
- package/ios/Fabric/DaroMNativeAdComponentView.mm +294 -0
- package/ios/{DaroMAdBannerViewManager.m → Paper/DaroMAdBannerViewManager.m} +3 -1
- package/ios/Paper/DaroMAdBannerViewManager.swift +21 -0
- package/ios/{DaroMNativeAdViewManager.m → Paper/DaroMNativeAdViewManager.m} +2 -1
- package/ios/Paper/DaroMNativeAdViewManager.swift +22 -0
- package/ios/Shared/DaroMAdEventSink.swift +24 -0
- package/ios/Shared/DaroMBannerAdView.swift +188 -0
- package/ios/Shared/DaroMNativeAdLoadCoordinator.swift +49 -0
- package/ios/Shared/DaroMNativeAdView.swift +575 -0
- package/ios/Shared/DaroMNativeAssetResolver.swift +53 -0
- package/ios/mediation/admob/DaroMediationDebugger.swift +11 -0
- package/ios/mediation/admob/DaroMediationTypes.swift +23 -0
- package/lib/commonjs/AdBannerView.js +21 -35
- package/lib/commonjs/AdBannerView.js.map +1 -1
- package/lib/commonjs/AppOpenAd.js +80 -21
- package/lib/commonjs/AppOpenAd.js.map +1 -1
- package/lib/commonjs/DaroMAdBannerViewNativeComponent.ts +47 -0
- package/lib/commonjs/DaroMNativeAdViewNativeComponent.ts +62 -0
- package/lib/commonjs/DaroMediaViewNativeComponent.ts +9 -0
- package/lib/commonjs/ErrorCode.js.map +1 -1
- package/lib/commonjs/EventEmitter.js +4 -5
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/InterstitialAd.js +48 -22
- package/lib/commonjs/InterstitialAd.js.map +1 -1
- package/lib/commonjs/LightPopupAd.js +64 -46
- package/lib/commonjs/LightPopupAd.js.map +1 -1
- package/lib/commonjs/NativeDaroModule.js +9 -0
- package/lib/commonjs/NativeDaroModule.js.map +1 -0
- package/lib/commonjs/RewardedAd.js +47 -23
- package/lib/commonjs/RewardedAd.js.map +1 -1
- package/lib/commonjs/codegen-env.d.js +2 -0
- package/lib/commonjs/codegen-env.d.js.map +1 -0
- package/lib/commonjs/hooks/useInterstitialAd.js +110 -0
- package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -0
- package/lib/commonjs/hooks/useLightPopupAd.js +114 -0
- package/lib/commonjs/hooks/useLightPopupAd.js.map +1 -0
- package/lib/commonjs/hooks/useRewardedAd.js +113 -0
- package/lib/commonjs/hooks/useRewardedAd.js.map +1 -0
- package/lib/commonjs/index.js +29 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdView.js +23 -18
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js +43 -31
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js +34 -7
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/module/AdBannerView.js +20 -36
- package/lib/module/AdBannerView.js.map +1 -1
- package/lib/module/AppOpenAd.js +80 -22
- package/lib/module/AppOpenAd.js.map +1 -1
- package/lib/module/DaroMAdBannerViewNativeComponent.ts +47 -0
- package/lib/module/DaroMNativeAdViewNativeComponent.ts +62 -0
- package/lib/module/DaroMediaViewNativeComponent.ts +9 -0
- package/lib/module/ErrorCode.js.map +1 -1
- package/lib/module/EventEmitter.js +4 -6
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/InterstitialAd.js +47 -22
- package/lib/module/InterstitialAd.js.map +1 -1
- package/lib/module/LightPopupAd.js +65 -47
- package/lib/module/LightPopupAd.js.map +1 -1
- package/lib/module/NativeDaroModule.js +5 -0
- package/lib/module/NativeDaroModule.js.map +1 -0
- package/lib/module/RewardedAd.js +46 -23
- package/lib/module/RewardedAd.js.map +1 -1
- package/lib/module/codegen-env.d.js +2 -0
- package/lib/module/codegen-env.d.js.map +1 -0
- package/lib/module/hooks/useInterstitialAd.js +106 -0
- package/lib/module/hooks/useInterstitialAd.js.map +1 -0
- package/lib/module/hooks/useLightPopupAd.js +110 -0
- package/lib/module/hooks/useLightPopupAd.js.map +1 -0
- package/lib/module/hooks/useRewardedAd.js +109 -0
- package/lib/module/hooks/useRewardedAd.js.map +1 -0
- package/lib/module/index.js +7 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/nativeAd/NativeAdView.js +22 -19
- package/lib/module/nativeAd/NativeAdView.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewComponents.js +45 -34
- package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewProvider.js +35 -8
- package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/plugin/src/index.d.ts +19 -0
- package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/plugin/src/skAdNetworkIds.d.ts +6 -0
- package/lib/typescript/commonjs/plugin/src/skAdNetworkIds.d.ts.map +1 -0
- package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +8 -0
- package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -0
- package/lib/typescript/commonjs/plugin/src/withIos.d.ts +8 -0
- package/lib/typescript/commonjs/plugin/src/withIos.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/AdBannerView.d.ts +126 -4
- package/lib/typescript/commonjs/src/AdBannerView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/AppOpenAd.d.ts +6 -0
- package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DaroMAdBannerViewNativeComponent.d.ts +32 -0
- package/lib/typescript/commonjs/src/DaroMAdBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/DaroMNativeAdViewNativeComponent.d.ts +42 -0
- package/lib/typescript/commonjs/src/DaroMNativeAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/DaroMediaViewNativeComponent.d.ts +6 -0
- package/lib/typescript/commonjs/src/DaroMediaViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ErrorCode.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/InterstitialAd.d.ts +6 -0
- package/lib/typescript/commonjs/src/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/LightPopupAd.d.ts +6 -0
- package/lib/typescript/commonjs/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts +61 -0
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/RewardedAd.d.ts +6 -0
- package/lib/typescript/commonjs/src/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts +19 -0
- package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts +23 -0
- package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts +20 -0
- package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +7 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts +125 -2
- package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/nativeAd/NativeAdViewProvider.d.ts +11 -5
- package/lib/typescript/commonjs/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdBannerViewProps.d.ts +2 -2
- package/lib/typescript/commonjs/src/types/AdBannerViewProps.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdProps.d.ts +2 -2
- package/lib/typescript/commonjs/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/DaroMMobileAds.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts +2 -0
- package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/lib/typescript/module/plugin/src/index.d.ts +19 -0
- package/lib/typescript/module/plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/module/plugin/src/skAdNetworkIds.d.ts +6 -0
- package/lib/typescript/module/plugin/src/skAdNetworkIds.d.ts.map +1 -0
- package/lib/typescript/module/plugin/src/withAndroid.d.ts +8 -0
- package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -0
- package/lib/typescript/module/plugin/src/withIos.d.ts +8 -0
- package/lib/typescript/module/plugin/src/withIos.d.ts.map +1 -0
- package/lib/typescript/module/src/AdBannerView.d.ts +126 -4
- package/lib/typescript/module/src/AdBannerView.d.ts.map +1 -1
- package/lib/typescript/module/src/AppOpenAd.d.ts +6 -0
- package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/module/src/DaroMAdBannerViewNativeComponent.d.ts +32 -0
- package/lib/typescript/module/src/DaroMAdBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/DaroMNativeAdViewNativeComponent.d.ts +42 -0
- package/lib/typescript/module/src/DaroMNativeAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/DaroMediaViewNativeComponent.d.ts +6 -0
- package/lib/typescript/module/src/DaroMediaViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/ErrorCode.d.ts.map +1 -1
- package/lib/typescript/module/src/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/module/src/InterstitialAd.d.ts +6 -0
- package/lib/typescript/module/src/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/module/src/LightPopupAd.d.ts +6 -0
- package/lib/typescript/module/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeDaroModule.d.ts +61 -0
- package/lib/typescript/module/src/NativeDaroModule.d.ts.map +1 -0
- package/lib/typescript/module/src/RewardedAd.d.ts +6 -0
- package/lib/typescript/module/src/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts +19 -0
- package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts +23 -0
- package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useRewardedAd.d.ts +20 -0
- package/lib/typescript/module/src/hooks/useRewardedAd.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +7 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts +125 -2
- package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/module/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
- package/lib/typescript/module/src/nativeAd/NativeAdViewProvider.d.ts +11 -5
- package/lib/typescript/module/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdBannerViewProps.d.ts +2 -2
- package/lib/typescript/module/src/types/AdBannerViewProps.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdProps.d.ts +2 -2
- package/lib/typescript/module/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/module/src/types/DaroMMobileAds.d.ts.map +1 -1
- package/lib/typescript/module/src/types/NativeAdViewProps.d.ts +2 -0
- package/lib/typescript/module/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/package.json +95 -105
- package/plugin/build/index.d.ts +18 -0
- package/plugin/build/index.js +71 -0
- package/plugin/build/skAdNetworkIds.d.ts +5 -0
- package/plugin/build/skAdNetworkIds.js +205 -0
- package/plugin/build/withAndroid.d.ts +7 -0
- package/plugin/build/withAndroid.js +222 -0
- package/plugin/build/withIos.d.ts +7 -0
- package/plugin/build/withIos.js +82 -0
- package/react-native-daro.podspec +28 -0
- package/src/AdBannerView.tsx +48 -48
- package/src/AppOpenAd.ts +101 -20
- package/src/DaroMAdBannerViewNativeComponent.ts +47 -0
- package/src/DaroMNativeAdViewNativeComponent.ts +62 -0
- package/src/DaroMediaViewNativeComponent.ts +9 -0
- package/src/ErrorCode.ts +1 -2
- package/src/EventEmitter.ts +9 -7
- package/src/InterstitialAd.ts +75 -21
- package/src/LightPopupAd.ts +90 -51
- package/src/NativeDaroModule.ts +91 -0
- package/src/RewardedAd.ts +72 -22
- package/src/codegen-env.d.ts +45 -0
- package/src/hooks/useInterstitialAd.ts +117 -0
- package/src/hooks/useLightPopupAd.ts +132 -0
- package/src/hooks/useRewardedAd.ts +122 -0
- package/src/index.tsx +21 -22
- package/src/nativeAd/NativeAdView.tsx +83 -45
- package/src/nativeAd/NativeAdViewComponents.tsx +129 -64
- package/src/nativeAd/NativeAdViewProvider.tsx +84 -16
- package/src/types/AdBannerViewProps.ts +11 -11
- package/src/types/AdInfo.ts +17 -17
- package/src/types/AdProps.ts +8 -9
- package/src/types/DaroMMobileAds.ts +3 -6
- package/src/types/NativeAdViewProps.ts +12 -5
- package/src/types/index.ts +1 -1
- package/android/gradle.properties +0 -5
- package/android/src/main/AndroidManifestNew.xml +0 -7
- package/android/src/main/java/com/darom/DaroMAdNativeViewManager.kt +0 -136
- package/android/src/main/java/com/darom/DaroMModule.kt +0 -203
- package/android/src/main/java/com/darom/DaroMPackage.kt +0 -21
- package/android/src/main/java/com/darom/util/EventEmitterUtil.kt +0 -24
- package/android/src/main/java/com/darom/view/DaroMAdBannerViewContainer.kt +0 -163
- package/android/src/main/java/com/darom/view/DaroMAdNativeViewContainer.kt +0 -375
- package/android/src/main/res/layout/layout_activity_transparent.xml +0 -7
- package/android/src/main/res/values/styles.xml +0 -11
- package/ios/DaroM-Bridging-Header.h +0 -6
- package/ios/DaroMAdBannerViewManager.swift +0 -91
- package/ios/DaroMNativeAdViewManager.swift +0 -291
- package/react-native-daro-m.podspec +0 -44
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const withAndroid_1 = require("./withAndroid");
|
|
37
|
+
const withIos_1 = require("./withIos");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const PACKAGE_MEDIATION = {
|
|
41
|
+
'react-native-daro': 'admob',
|
|
42
|
+
'react-native-daro-m': 'max',
|
|
43
|
+
};
|
|
44
|
+
function getPackageMediation() {
|
|
45
|
+
try {
|
|
46
|
+
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
47
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
48
|
+
return packageJson.name ? PACKAGE_MEDIATION[packageJson.name] : undefined;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const withDaro = (config, props) => {
|
|
55
|
+
const mediation = getPackageMediation();
|
|
56
|
+
if (!mediation) {
|
|
57
|
+
throw new Error('[daro-react-native] The config plugin must be loaded from ' +
|
|
58
|
+
'"react-native-daro" or "react-native-daro-m".');
|
|
59
|
+
}
|
|
60
|
+
if (props?.ios) {
|
|
61
|
+
config = (0, withIos_1.withIosConfiguration)(config, { ...props.ios, mediation });
|
|
62
|
+
}
|
|
63
|
+
if (props?.android) {
|
|
64
|
+
config = (0, withAndroid_1.withAndroidConfiguration)(config, {
|
|
65
|
+
...props.android,
|
|
66
|
+
mediation,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return config;
|
|
70
|
+
};
|
|
71
|
+
exports.default = withDaro;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DARO_SK_AD_NETWORK_IDS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Daro 미디에이션 네트워크가 요구하는 SKAdNetwork 식별자 목록.
|
|
6
|
+
* Info.plist의 SKAdNetworkItems 배열에 머지된다.
|
|
7
|
+
*/
|
|
8
|
+
exports.DARO_SK_AD_NETWORK_IDS = [
|
|
9
|
+
'cstr6suwn9.skadnetwork',
|
|
10
|
+
'4fzdc2evr5.skadnetwork',
|
|
11
|
+
'4pfyvq9l8r.skadnetwork',
|
|
12
|
+
'2fnua5tdw4.skadnetwork',
|
|
13
|
+
'ydx93a7ass.skadnetwork',
|
|
14
|
+
'5a6flpkh64.skadnetwork',
|
|
15
|
+
'p78axxw29g.skadnetwork',
|
|
16
|
+
'v72qych5uu.skadnetwork',
|
|
17
|
+
'ludvb6z3bs.skadnetwork',
|
|
18
|
+
'cp8zw746q7.skadnetwork',
|
|
19
|
+
'3sh42y64q3.skadnetwork',
|
|
20
|
+
'c6k4g5qg8m.skadnetwork',
|
|
21
|
+
's39g8k73mm.skadnetwork',
|
|
22
|
+
'3qy4746246.skadnetwork',
|
|
23
|
+
'f38h382jlk.skadnetwork',
|
|
24
|
+
'hs6bdukanm.skadnetwork',
|
|
25
|
+
'v4nxqhlyqp.skadnetwork',
|
|
26
|
+
'wzmmz9fp6w.skadnetwork',
|
|
27
|
+
'yclnxrl5pm.skadnetwork',
|
|
28
|
+
't38b2kh725.skadnetwork',
|
|
29
|
+
'7ug5zh24hu.skadnetwork',
|
|
30
|
+
'gta9lk7p23.skadnetwork',
|
|
31
|
+
'vutu7akeur.skadnetwork',
|
|
32
|
+
'y5ghdn5j9k.skadnetwork',
|
|
33
|
+
'n6fk4nfna4.skadnetwork',
|
|
34
|
+
'v9wttpbfk9.skadnetwork',
|
|
35
|
+
'n38lu8286q.skadnetwork',
|
|
36
|
+
'47vhws6wlr.skadnetwork',
|
|
37
|
+
'kbd757ywx3.skadnetwork',
|
|
38
|
+
'9t245vhmpl.skadnetwork',
|
|
39
|
+
'eh6m2bh4zr.skadnetwork',
|
|
40
|
+
'a2p9lx4jpn.skadnetwork',
|
|
41
|
+
'22mmun2rn5.skadnetwork',
|
|
42
|
+
'4468km3ulz.skadnetwork',
|
|
43
|
+
'2u9pt9hc89.skadnetwork',
|
|
44
|
+
'8s468mfl3y.skadnetwork',
|
|
45
|
+
'klf5c3l5u5.skadnetwork',
|
|
46
|
+
'ppxm28t8ap.skadnetwork',
|
|
47
|
+
'ecpz2srf59.skadnetwork',
|
|
48
|
+
'uw77j35x4d.skadnetwork',
|
|
49
|
+
'pwa73g5rt2.skadnetwork',
|
|
50
|
+
'mlmmfzh3r3.skadnetwork',
|
|
51
|
+
'578prtvx9j.skadnetwork',
|
|
52
|
+
'4dzt52r2t5.skadnetwork',
|
|
53
|
+
'e5fvkxwrpn.skadnetwork',
|
|
54
|
+
'8c4e2ghe7u.skadnetwork',
|
|
55
|
+
'zq492l623r.skadnetwork',
|
|
56
|
+
'3rd42ekr43.skadnetwork',
|
|
57
|
+
'3qcr597p9d.skadnetwork',
|
|
58
|
+
'mj797d8u6f.skadnetwork',
|
|
59
|
+
'55644vm79v.skadnetwork',
|
|
60
|
+
'6yxyv74ff7.skadnetwork',
|
|
61
|
+
'55y65gfgn7.skadnetwork',
|
|
62
|
+
'cwn433xbcr.skadnetwork',
|
|
63
|
+
'nu4557a4je.skadnetwork',
|
|
64
|
+
'w7jznl3r6g.skadnetwork',
|
|
65
|
+
'577p5t736z.skadnetwork',
|
|
66
|
+
'6rd35atwn8.skadnetwork',
|
|
67
|
+
'7bxrt786m8.skadnetwork',
|
|
68
|
+
'7fbxrn65az.skadnetwork',
|
|
69
|
+
'dt3cjx1a9i.skadnetwork',
|
|
70
|
+
'fz2k2k5tej.skadnetwork',
|
|
71
|
+
'jk2fsx2rgz.skadnetwork',
|
|
72
|
+
'r8lj5b58b5.skadnetwork',
|
|
73
|
+
'tmhh9296z4.skadnetwork',
|
|
74
|
+
'k6y4y55b64.skadnetwork',
|
|
75
|
+
'qwpu75vrh2.skadnetwork',
|
|
76
|
+
'238da6jt44.skadnetwork',
|
|
77
|
+
'24t9a8vw3c.skadnetwork',
|
|
78
|
+
'24zw6aqk47.skadnetwork',
|
|
79
|
+
'252b5q8x7y.skadnetwork',
|
|
80
|
+
'275upjj5gd.skadnetwork',
|
|
81
|
+
'294l99pt4k.skadnetwork',
|
|
82
|
+
'32z4fx6l9h.skadnetwork',
|
|
83
|
+
'3l6bd9hu43.skadnetwork',
|
|
84
|
+
'424m5254lk.skadnetwork',
|
|
85
|
+
'44jx6755aq.skadnetwork',
|
|
86
|
+
'44n7hlldy6.skadnetwork',
|
|
87
|
+
'488r3q3dtq.skadnetwork',
|
|
88
|
+
'4mn522wn87.skadnetwork',
|
|
89
|
+
'4w7y6s5ca2.skadnetwork',
|
|
90
|
+
'523jb4fst2.skadnetwork',
|
|
91
|
+
'52fl2v3hgk.skadnetwork',
|
|
92
|
+
'54nzkqm89y.skadnetwork',
|
|
93
|
+
'5f5u5tfb26.skadnetwork',
|
|
94
|
+
'5l3tpt7t6e.skadnetwork',
|
|
95
|
+
'5lm9lj6jb7.skadnetwork',
|
|
96
|
+
'5tjdwbrq8w.skadnetwork',
|
|
97
|
+
'6964rsfnh4.skadnetwork',
|
|
98
|
+
'6g9af3uyq4.skadnetwork',
|
|
99
|
+
'6p4ks3rnbw.skadnetwork',
|
|
100
|
+
'6v7lgmsu45.skadnetwork',
|
|
101
|
+
'6xzpu9s2p8.skadnetwork',
|
|
102
|
+
'737z793b9f.skadnetwork',
|
|
103
|
+
'74b6s63p6l.skadnetwork',
|
|
104
|
+
'77y3x8wds4.skadnetwork',
|
|
105
|
+
'7953jerfzd.skadnetwork',
|
|
106
|
+
'79pbpufp6p.skadnetwork',
|
|
107
|
+
'7fmhfwg9en.skadnetwork',
|
|
108
|
+
'7rz58n8ntl.skadnetwork',
|
|
109
|
+
'84993kbrcf.skadnetwork',
|
|
110
|
+
'87u5trcl3r.skadnetwork',
|
|
111
|
+
'89z7zv988g.skadnetwork',
|
|
112
|
+
'8m87ys6875.skadnetwork',
|
|
113
|
+
'8r8llnkz5a.skadnetwork',
|
|
114
|
+
'97r2b46745.skadnetwork',
|
|
115
|
+
'9b89h5y424.skadnetwork',
|
|
116
|
+
'9g2aggbj52.skadnetwork',
|
|
117
|
+
'9nlqeag3gk.skadnetwork',
|
|
118
|
+
'9rd848q2bz.skadnetwork',
|
|
119
|
+
'9vvzujtq5s.skadnetwork',
|
|
120
|
+
'9yg77x724h.skadnetwork',
|
|
121
|
+
'a7xqa6mtl2.skadnetwork',
|
|
122
|
+
'a8cz6cu7e5.skadnetwork',
|
|
123
|
+
'apzhy3va96.skadnetwork',
|
|
124
|
+
'av6w8kgt66.skadnetwork',
|
|
125
|
+
'b9bk5wbcq9.skadnetwork',
|
|
126
|
+
'bvpn9ufa9b.skadnetwork',
|
|
127
|
+
'bxvub5ada5.skadnetwork',
|
|
128
|
+
'c3frkrj4fj.skadnetwork',
|
|
129
|
+
'ce8ybjwass.skadnetwork',
|
|
130
|
+
'cg4yq2srnc.skadnetwork',
|
|
131
|
+
'cj5566h2ga.skadnetwork',
|
|
132
|
+
'cs644xg564.skadnetwork',
|
|
133
|
+
'dbu4b84rxf.skadnetwork',
|
|
134
|
+
'dkc879ngq3.skadnetwork',
|
|
135
|
+
'dzg6xy7pwj.skadnetwork',
|
|
136
|
+
'ejvt5qm6ak.skadnetwork',
|
|
137
|
+
'f2zub97jtl.skadnetwork',
|
|
138
|
+
'f73kdq92p3.skadnetwork',
|
|
139
|
+
'f7s53z58qe.skadnetwork',
|
|
140
|
+
'feyaarzu9v.skadnetwork',
|
|
141
|
+
'fq6vru337s.skadnetwork',
|
|
142
|
+
'g28c52eehv.skadnetwork',
|
|
143
|
+
'g2y4y55b64.skadnetwork',
|
|
144
|
+
'g6gcrrvk4p.skadnetwork',
|
|
145
|
+
'ggvn48r87g.skadnetwork',
|
|
146
|
+
'glqzh8vgby.skadnetwork',
|
|
147
|
+
'gta8lk7p23.skadnetwork',
|
|
148
|
+
'gvmwg8q7h5.skadnetwork',
|
|
149
|
+
'h65wbv5k3f.skadnetwork',
|
|
150
|
+
'hb56zgv37p.skadnetwork',
|
|
151
|
+
'hdw39hrw9y.skadnetwork',
|
|
152
|
+
'hjevpa356n.skadnetwork',
|
|
153
|
+
'k674qkevps.skadnetwork',
|
|
154
|
+
'kbmxgpxpgc.skadnetwork',
|
|
155
|
+
'krvm3zuq6h.skadnetwork',
|
|
156
|
+
'ln5gz23vtd.skadnetwork',
|
|
157
|
+
'lr83yxwka7.skadnetwork',
|
|
158
|
+
'm297p6643m.skadnetwork',
|
|
159
|
+
'm5mvw97r93.skadnetwork',
|
|
160
|
+
'm8dbw4sv7c.skadnetwork',
|
|
161
|
+
'mls7yz5dvl.skadnetwork',
|
|
162
|
+
'mp6xlyr22a.skadnetwork',
|
|
163
|
+
'mqn7fxpca7.skadnetwork',
|
|
164
|
+
'mtkv5xtk9e.skadnetwork',
|
|
165
|
+
'n66cz3y3bx.skadnetwork',
|
|
166
|
+
'n9x2a789qt.skadnetwork',
|
|
167
|
+
'ns5j362hk7.skadnetwork',
|
|
168
|
+
'nzq8sh4pbs.skadnetwork',
|
|
169
|
+
'p4ybsjem3u.skadnetwork',
|
|
170
|
+
'prcb7njmu6.skadnetwork',
|
|
171
|
+
'pu4na253f3.skadnetwork',
|
|
172
|
+
'pwdxu55a5a.skadnetwork',
|
|
173
|
+
'qqp299437r.skadnetwork',
|
|
174
|
+
'qu637u8glc.skadnetwork',
|
|
175
|
+
'r45fhb6rf7.skadnetwork',
|
|
176
|
+
'rvh3l7un93.skadnetwork',
|
|
177
|
+
'rx5hdcabgc.skadnetwork',
|
|
178
|
+
's69wq72ugq.skadnetwork',
|
|
179
|
+
'sczv5946wb.skadnetwork',
|
|
180
|
+
'su67r6k2v3.skadnetwork',
|
|
181
|
+
't6d3zquu66.skadnetwork',
|
|
182
|
+
'tl55sbb4fm.skadnetwork',
|
|
183
|
+
'tvvz7th9br.skadnetwork',
|
|
184
|
+
'u679fj5vs4.skadnetwork',
|
|
185
|
+
'v79kvwwj4g.skadnetwork',
|
|
186
|
+
'vcra2ehyfk.skadnetwork',
|
|
187
|
+
'vhf287vqwu.skadnetwork',
|
|
188
|
+
'w9q455wk68.skadnetwork',
|
|
189
|
+
'wg4vff78zm.skadnetwork',
|
|
190
|
+
'x2jnk7ly8j.skadnetwork',
|
|
191
|
+
'x44k69ngh6.skadnetwork',
|
|
192
|
+
'x5l83yy675.skadnetwork',
|
|
193
|
+
'x8jxxk4ff5.skadnetwork',
|
|
194
|
+
'x8uqf25wch.skadnetwork',
|
|
195
|
+
'x8yj322td6.skadnetwork',
|
|
196
|
+
'xga6mpmplv.skadnetwork',
|
|
197
|
+
'xy9t38ct57.skadnetwork',
|
|
198
|
+
'y45688jllp.skadnetwork',
|
|
199
|
+
'yrqqpx2mcb.skadnetwork',
|
|
200
|
+
'z24wtl6j62.skadnetwork',
|
|
201
|
+
'z4gj7hsk7h.skadnetwork',
|
|
202
|
+
'z959bm4gru.skadnetwork',
|
|
203
|
+
'zmmz9fp6w.skadnetwork',
|
|
204
|
+
'zmvfpc5aq8.skadnetwork',
|
|
205
|
+
];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ConfigPlugin } from 'expo/config-plugins';
|
|
2
|
+
import type { DaroAndroidProps, DaroMediation } from './index';
|
|
3
|
+
type DaroResolvedAndroidProps = DaroAndroidProps & {
|
|
4
|
+
mediation: DaroMediation;
|
|
5
|
+
};
|
|
6
|
+
export declare const withAndroidConfiguration: ConfigPlugin<DaroResolvedAndroidProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.withAndroidConfiguration = void 0;
|
|
37
|
+
const config_plugins_1 = require("expo/config-plugins");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const KEY_FILE_NAME = 'android-daro-key.txt';
|
|
41
|
+
const JETIFIER_IGNORELIST_KEY = 'android.jetifier.ignorelist';
|
|
42
|
+
const JETIFIER_IGNORELIST_ENTRIES = ['react-android', 'hermes-android'];
|
|
43
|
+
const DARO_GRADLE_PLUGIN_CLASSPATH = 'so.daro:daro-plugin:1.0.13';
|
|
44
|
+
const MAX_QUALITY_CLASSPATH = 'com.applovin.quality:AppLovinQualityServiceGradlePlugin:5.5.2';
|
|
45
|
+
const APPLOVIN_MAVEN_REPO = 'https://artifacts.applovin.com/android';
|
|
46
|
+
const MAX_ALLPROJECTS_MAVEN_REPOS = [
|
|
47
|
+
'https://android-sdk.is.com',
|
|
48
|
+
'https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea',
|
|
49
|
+
'https://maven.ogury.co',
|
|
50
|
+
'https://artifact.bytedance.com/repository/pangle',
|
|
51
|
+
'https://s3.amazonaws.com/smaato-sdk-releases/',
|
|
52
|
+
'https://cboost.jfrog.io/artifactory/chartboost-ads/',
|
|
53
|
+
APPLOVIN_MAVEN_REPO,
|
|
54
|
+
];
|
|
55
|
+
const DARO_APP_PLUGIN_IDS = {
|
|
56
|
+
admob: 'so.daro.a',
|
|
57
|
+
max: 'so.daro.m',
|
|
58
|
+
};
|
|
59
|
+
const DARO_SDK_DEPENDENCIES = {
|
|
60
|
+
admob: 'so.daro:daro-a:1.5.5',
|
|
61
|
+
max: 'so.daro:daro-m:1.3.8',
|
|
62
|
+
};
|
|
63
|
+
const DARO_SDK_DEPENDENCY_LINE_PATTERN = /^\s*(?:implementation|api|compileOnly|runtimeOnly)\s*(?:\(\s*)?['"]so\.daro:daro-[am]:[^'"]+['"]\s*\)?\s*(?:\/\/.*)?$/gm;
|
|
64
|
+
const DARO_MAVEN_REPOS = [
|
|
65
|
+
'https://artifact.bytedance.com/repository/pangle',
|
|
66
|
+
'https://cboost.jfrog.io/artifactory/chartboost-ads/',
|
|
67
|
+
'https://android-sdk.is.com',
|
|
68
|
+
'https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea',
|
|
69
|
+
];
|
|
70
|
+
function replaceOrThrow(contents, pattern, replacement, target) {
|
|
71
|
+
if (!pattern.test(contents)) {
|
|
72
|
+
throw new Error(`[daro-react-native] Cannot automatically update android/build.gradle. ` +
|
|
73
|
+
`Expected to find ${target}.`);
|
|
74
|
+
}
|
|
75
|
+
return contents.replace(pattern, replacement);
|
|
76
|
+
}
|
|
77
|
+
function findClosingBrace(contents, openBraceIndex) {
|
|
78
|
+
let depth = 0;
|
|
79
|
+
for (let index = openBraceIndex; index < contents.length; index += 1) {
|
|
80
|
+
const char = contents[index];
|
|
81
|
+
if (char === '{') {
|
|
82
|
+
depth += 1;
|
|
83
|
+
}
|
|
84
|
+
else if (char === '}') {
|
|
85
|
+
depth -= 1;
|
|
86
|
+
if (depth === 0)
|
|
87
|
+
return index;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
throw new Error('[daro-react-native] Cannot automatically update android/build.gradle. ' +
|
|
91
|
+
'Expected to find a complete repositories block.');
|
|
92
|
+
}
|
|
93
|
+
function findRepositoriesBlock(contents, pattern, target) {
|
|
94
|
+
const match = pattern.exec(contents);
|
|
95
|
+
if (!match) {
|
|
96
|
+
throw new Error(`[daro-react-native] Cannot automatically update android/build.gradle. ` +
|
|
97
|
+
`Expected to find ${target}.`);
|
|
98
|
+
}
|
|
99
|
+
const openBraceIndex = match.index + match[0].lastIndexOf('{');
|
|
100
|
+
const closeBraceIndex = findClosingBrace(contents, openBraceIndex);
|
|
101
|
+
return {
|
|
102
|
+
insertIndex: match.index + match[0].length,
|
|
103
|
+
contentStartIndex: openBraceIndex + 1,
|
|
104
|
+
contents: contents.slice(openBraceIndex + 1, closeBraceIndex),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function addMavenRepositories(contents, pattern, urls, target) {
|
|
108
|
+
const repositoriesBlock = findRepositoriesBlock(contents, pattern, target);
|
|
109
|
+
const missingUrls = urls.filter((url) => !repositoriesBlock.contents.includes(url));
|
|
110
|
+
if (missingUrls.length === 0)
|
|
111
|
+
return contents;
|
|
112
|
+
const insertIndex = findRepositoryInsertIndex(repositoriesBlock);
|
|
113
|
+
return `${contents.slice(0, insertIndex)}\n${missingUrls
|
|
114
|
+
.map((url) => ` maven { url = uri("${url}") }`)
|
|
115
|
+
.join('\n')}${contents.slice(insertIndex)}`;
|
|
116
|
+
}
|
|
117
|
+
function findRepositoryInsertIndex(repositoriesBlock) {
|
|
118
|
+
const preferredAnchor = /mavenCentral\(\)[^\S\r\n]*/.exec(repositoriesBlock.contents) ??
|
|
119
|
+
/google\(\)[^\S\r\n]*/.exec(repositoriesBlock.contents);
|
|
120
|
+
return preferredAnchor
|
|
121
|
+
? repositoriesBlock.contentStartIndex +
|
|
122
|
+
preferredAnchor.index +
|
|
123
|
+
preferredAnchor[0].length
|
|
124
|
+
: repositoriesBlock.insertIndex;
|
|
125
|
+
}
|
|
126
|
+
function addMaxBuildscriptRepository(contents) {
|
|
127
|
+
const repositoriesBlock = findRepositoriesBlock(contents, /buildscript\s*\{[\s\S]*?repositories\s*\{/, 'a buildscript repositories block');
|
|
128
|
+
if (repositoriesBlock.contents.includes(APPLOVIN_MAVEN_REPO)) {
|
|
129
|
+
return contents;
|
|
130
|
+
}
|
|
131
|
+
const insertIndex = findRepositoryInsertIndex(repositoriesBlock);
|
|
132
|
+
const repositoryLine = `\n maven { url = uri("${APPLOVIN_MAVEN_REPO}") }`;
|
|
133
|
+
return `${contents.slice(0, insertIndex)}${repositoryLine}${contents.slice(insertIndex)}`;
|
|
134
|
+
}
|
|
135
|
+
const withAndroidConfiguration = (config, props) => {
|
|
136
|
+
const { mediation } = props;
|
|
137
|
+
const daroAppPluginId = DARO_APP_PLUGIN_IDS[mediation];
|
|
138
|
+
const daroSdkDependency = DARO_SDK_DEPENDENCIES[mediation];
|
|
139
|
+
// 1. project build.gradle: classpath + maven repos
|
|
140
|
+
config = (0, config_plugins_1.withProjectBuildGradle)(config, (gradleConfig) => {
|
|
141
|
+
if (gradleConfig.modResults.language !== 'groovy') {
|
|
142
|
+
config_plugins_1.WarningAggregator.addWarningAndroid('daro-react-native', 'Cannot automatically configure project build.gradle if it is not groovy.');
|
|
143
|
+
return gradleConfig;
|
|
144
|
+
}
|
|
145
|
+
let contents = gradleConfig.modResults.contents;
|
|
146
|
+
if (!contents.includes(DARO_GRADLE_PLUGIN_CLASSPATH)) {
|
|
147
|
+
contents = replaceOrThrow(contents, /dependencies\s*\{/, (match) => `${match}\n classpath("${DARO_GRADLE_PLUGIN_CLASSPATH}")`, 'a buildscript dependencies block');
|
|
148
|
+
}
|
|
149
|
+
if (mediation === 'max' && !contents.includes(MAX_QUALITY_CLASSPATH)) {
|
|
150
|
+
contents = replaceOrThrow(contents, /dependencies\s*\{/, (match) => `${match}\n classpath("${MAX_QUALITY_CLASSPATH}")`, 'a buildscript dependencies block');
|
|
151
|
+
}
|
|
152
|
+
contents = addMavenRepositories(contents, /allprojects\s*\{[\s\S]*?repositories\s*\{/, mediation === 'max' ? MAX_ALLPROJECTS_MAVEN_REPOS : DARO_MAVEN_REPOS, 'an allprojects repositories block');
|
|
153
|
+
if (mediation === 'max') {
|
|
154
|
+
contents = addMaxBuildscriptRepository(contents);
|
|
155
|
+
}
|
|
156
|
+
gradleConfig.modResults.contents = contents;
|
|
157
|
+
return gradleConfig;
|
|
158
|
+
});
|
|
159
|
+
// 2. app/build.gradle: add selected Daro SDK dependency and plugin.
|
|
160
|
+
config = (0, config_plugins_1.withAppBuildGradle)(config, (gradleConfig) => {
|
|
161
|
+
if (gradleConfig.modResults.language !== 'groovy') {
|
|
162
|
+
config_plugins_1.WarningAggregator.addWarningAndroid('daro-react-native', 'Cannot automatically configure app/build.gradle if it is not groovy.');
|
|
163
|
+
return gradleConfig;
|
|
164
|
+
}
|
|
165
|
+
let contents = gradleConfig.modResults.contents.replace(/\n?apply plugin: ['"]so\.daro\.[am]['"]\n?/g, '\n');
|
|
166
|
+
contents = contents.replace(DARO_SDK_DEPENDENCY_LINE_PATTERN, '');
|
|
167
|
+
contents = replaceOrThrow(contents, /dependencies\s*\{/, (match) => `${match}\n implementation("${daroSdkDependency}")`, 'an app dependencies block');
|
|
168
|
+
if (!contents.includes(daroAppPluginId)) {
|
|
169
|
+
contents = `${contents.trimEnd()}\napply plugin: "${daroAppPluginId}"\n`;
|
|
170
|
+
}
|
|
171
|
+
gradleConfig.modResults.contents = contents;
|
|
172
|
+
return gradleConfig;
|
|
173
|
+
});
|
|
174
|
+
// 3. gradle.properties: daroAppKey + Jetifier
|
|
175
|
+
config = (0, config_plugins_1.withGradleProperties)(config, (propertiesConfig) => {
|
|
176
|
+
const entries = [
|
|
177
|
+
{ key: 'daroMediation', value: mediation },
|
|
178
|
+
{ key: 'daroAppKey', value: props.daroAppKey },
|
|
179
|
+
{ key: 'android.useAndroidX', value: 'true' },
|
|
180
|
+
{ key: 'android.enableJetifier', value: 'true' },
|
|
181
|
+
];
|
|
182
|
+
const existingIgnorelist = propertiesConfig.modResults
|
|
183
|
+
.filter((item) => item.type === 'property' && item.key === JETIFIER_IGNORELIST_KEY)
|
|
184
|
+
.flatMap((item) => item.value.split(','))
|
|
185
|
+
.map((item) => item.trim())
|
|
186
|
+
.filter(Boolean);
|
|
187
|
+
propertiesConfig.modResults = propertiesConfig.modResults.filter((item) => !(item.type === 'property' && item.key === JETIFIER_IGNORELIST_KEY));
|
|
188
|
+
entries.push({
|
|
189
|
+
key: JETIFIER_IGNORELIST_KEY,
|
|
190
|
+
value: [
|
|
191
|
+
...new Set([...existingIgnorelist, ...JETIFIER_IGNORELIST_ENTRIES]),
|
|
192
|
+
].join(','),
|
|
193
|
+
});
|
|
194
|
+
for (const { key, value } of entries) {
|
|
195
|
+
const existingIndex = propertiesConfig.modResults.findIndex((item) => item.type === 'property' && item.key === key);
|
|
196
|
+
const entry = { type: 'property', key, value };
|
|
197
|
+
if (existingIndex >= 0) {
|
|
198
|
+
propertiesConfig.modResults[existingIndex] = entry;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
propertiesConfig.modResults.push(entry);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return propertiesConfig;
|
|
205
|
+
});
|
|
206
|
+
// 4. daroKeyFile을 android/app/ 루트에 복사
|
|
207
|
+
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
208
|
+
'android',
|
|
209
|
+
async (dangerousConfig) => {
|
|
210
|
+
const sourcePath = path.resolve(dangerousConfig.modRequest.projectRoot, props.daroKeyFile);
|
|
211
|
+
if (!fs.existsSync(sourcePath)) {
|
|
212
|
+
throw new Error(`[daro-react-native] Cannot find Android key file at "${sourcePath}". ` +
|
|
213
|
+
`Set "android.daroKeyFile" in plugin options to a valid path.`);
|
|
214
|
+
}
|
|
215
|
+
const destinationPath = path.resolve(dangerousConfig.modRequest.platformProjectRoot, 'app', KEY_FILE_NAME);
|
|
216
|
+
fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
|
|
217
|
+
fs.copyFileSync(sourcePath, destinationPath);
|
|
218
|
+
return dangerousConfig;
|
|
219
|
+
},
|
|
220
|
+
]);
|
|
221
|
+
};
|
|
222
|
+
exports.withAndroidConfiguration = withAndroidConfiguration;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ConfigPlugin } from 'expo/config-plugins';
|
|
2
|
+
import type { DaroIosProps, DaroMediation } from './index';
|
|
3
|
+
type DaroResolvedIosProps = DaroIosProps & {
|
|
4
|
+
mediation: DaroMediation;
|
|
5
|
+
};
|
|
6
|
+
export declare const withIosConfiguration: ConfigPlugin<DaroResolvedIosProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.withIosConfiguration = void 0;
|
|
37
|
+
const config_plugins_1 = require("expo/config-plugins");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const skAdNetworkIds_1 = require("./skAdNetworkIds");
|
|
41
|
+
const KEY_FILE_NAME = 'ios-daro-key.txt';
|
|
42
|
+
const DEFAULT_ATT_USAGE_DESCRIPTION = 'This identifier will be used to deliver personalized ads to you.';
|
|
43
|
+
const withIosConfiguration = (config, props) => {
|
|
44
|
+
const { mediation } = props;
|
|
45
|
+
config = (0, config_plugins_1.withInfoPlist)(config, (config) => {
|
|
46
|
+
config.modResults.DaroAppKey = props.daroAppKey;
|
|
47
|
+
config.modResults.NSUserTrackingUsageDescription =
|
|
48
|
+
props.attUsageDescription ?? DEFAULT_ATT_USAGE_DESCRIPTION;
|
|
49
|
+
if (!props.admobAppId) {
|
|
50
|
+
throw new Error(`[daro-react-native] "ios.admobAppId" is required when mediation is "${mediation}". ` +
|
|
51
|
+
'Google Mobile Ads SDK requires GADApplicationIdentifier.');
|
|
52
|
+
}
|
|
53
|
+
config.modResults.GADApplicationIdentifier = props.admobAppId;
|
|
54
|
+
// SKAdNetworkItems: 사용자가 미리 추가한 항목과 머지 (중복 제거)
|
|
55
|
+
const existing = config.modResults.SKAdNetworkItems ??
|
|
56
|
+
[];
|
|
57
|
+
const existingIds = new Set(existing.map((item) => item.SKAdNetworkIdentifier));
|
|
58
|
+
const additions = skAdNetworkIds_1.DARO_SK_AD_NETWORK_IDS.filter((id) => !existingIds.has(id)).map((id) => ({ SKAdNetworkIdentifier: id }));
|
|
59
|
+
config.modResults.SKAdNetworkItems = [...existing, ...additions];
|
|
60
|
+
return config;
|
|
61
|
+
});
|
|
62
|
+
return (0, config_plugins_1.withXcodeProject)(config, (config) => {
|
|
63
|
+
const projectRoot = config.modRequest.projectRoot;
|
|
64
|
+
const projectName = config.modRequest.projectName ??
|
|
65
|
+
config_plugins_1.IOSConfig.XcodeUtils.getProjectName(projectRoot);
|
|
66
|
+
const sourcePath = path.resolve(projectRoot, props.daroKeyFile);
|
|
67
|
+
if (!fs.existsSync(sourcePath)) {
|
|
68
|
+
throw new Error(`[daro-react-native] Cannot find iOS key file at "${sourcePath}". ` +
|
|
69
|
+
`Set "ios.daroKeyFile" in plugin options to a valid path.`);
|
|
70
|
+
}
|
|
71
|
+
const destinationPath = path.resolve(config_plugins_1.IOSConfig.Paths.getSourceRoot(projectRoot), KEY_FILE_NAME);
|
|
72
|
+
fs.copyFileSync(sourcePath, destinationPath);
|
|
73
|
+
config_plugins_1.IOSConfig.XcodeUtils.addResourceFileToGroup({
|
|
74
|
+
filepath: `${projectName}/${KEY_FILE_NAME}`,
|
|
75
|
+
groupName: projectName,
|
|
76
|
+
project: config.modResults,
|
|
77
|
+
isBuildFile: true,
|
|
78
|
+
});
|
|
79
|
+
return config;
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
exports.withIosConfiguration = withIosConfiguration;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "react-native-daro"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/delightroom/daro-react-native.git", :tag => "react-native-daro@#{package["version"]}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = [
|
|
17
|
+
"ios/*.{h,m,mm,swift,cpp}",
|
|
18
|
+
"ios/Shared/**/*.{h,m,mm,swift,cpp}",
|
|
19
|
+
"ios/Paper/**/*.{h,m,mm,swift,cpp}",
|
|
20
|
+
"ios/Fabric/**/*.{h,m,mm,swift,cpp}",
|
|
21
|
+
"ios/mediation/admob/**/*.{h,m,mm,swift,cpp}"
|
|
22
|
+
]
|
|
23
|
+
s.private_header_files = "ios/**/*.h"
|
|
24
|
+
|
|
25
|
+
s.dependency "DaroAds", "1.1.59"
|
|
26
|
+
|
|
27
|
+
install_modules_dependencies(s)
|
|
28
|
+
end
|