diff --git a/Sample/CHANGELOG.md b/Sample/CHANGELOG.md new file mode 100644 index 00000000..7f40abdf --- /dev/null +++ b/Sample/CHANGELOG.md @@ -0,0 +1,332 @@ +## sample Unity Mediation Plugin Changelog + +#### [Version 3.35.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.35.0.zip) +- Supports [sample Android adapter version 5.45.3.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-54530). +- Supports [sample iOS adapter version 5.40.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-54000). +- Built and tested with the Google Mobile Ads Unity Plugin version 11.0.0. + +#### [Version 3.34.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.34.0.zip) +- Supports [sample Android adapter version 5.27.4.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52741). +- Supports [sample iOS adapter version 5.39.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53910). +- Built and tested with the Google Mobile Ads Unity Plugin version 11.0.0. + +#### [Version 3.33.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.33.0.zip) +- Supports [sample Android adapter version 5.27.4.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52740). +- Supports [sample iOS adapter version 5.38.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53800). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.6.0. + +#### [Version 3.32.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.32.1.zip) +- Supports [sample Android adapter version 5.27.4.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52740). +- Supports [sample iOS adapter version 5.37.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53710). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.6.0. + +#### [Version 3.32.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.32.0.zip) +- Supports [sample Android adapter version 5.27.4.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52740). +- Supports [sample iOS adapter version 5.37.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53700). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.6.0. + +#### [Version 3.31.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.31.0.zip) +- Supports [sample Android adapter version 5.27.3.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52730). +- Supports [sample iOS adapter version 5.36.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53600). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.5.0. + +#### [Version 3.30.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.30.1.zip) +- Supports [sample Android adapter version 5.27.3.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52730). +- Supports [sample iOS adapter version 5.35.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53510). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.5.0. + +#### [Version 3.30.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.30.0.zip) +- Supports [sample Android adapter version 5.27.2.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52720). +- Supports [sample iOS adapter version 5.35.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53500). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.4.2. + +#### [Version 3.29.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.29.0.zip) +- Supports [sample Android adapter version 5.27.2.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52720). +- Supports [sample iOS adapter version 5.33.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53300). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.3.0. + +#### [Version 3.28.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.28.0.zip) +- Supports [sample Android adapter version 5.27.2.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52720). +- Supports [sample iOS adapter version 5.32.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53210). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.3.0. + +#### [Version 3.27.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.27.1.zip) +- Supports [sample Android adapter version 5.27.1.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52711). +- Supports [sample iOS adapter version 5.31.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53110). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.2.0. + +#### [Version 3.27.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.27.0.zip) +- Supports [sample Android adapter version 5.27.1.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52711). +- Supports [sample iOS adapter version 5.31.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53100). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.2.0. + +#### [Version 3.26.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.26.0.zip) +- Supports [sample Android adapter version 5.27.1.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52711). +- Supports [sample iOS adapter version 5.30.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-53000). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.1.0. + +#### [Version 3.25.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.25.0.zip) +- Supports [sample Android adapter version 5.27.1.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52711). +- Supports [sample iOS adapter version 5.29.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52910). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.0.0. + +#### [Version 3.24.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.24.0.zip) +- Supports [sample Android adapter version 5.27.1.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52711). +- Supports [sample iOS adapter version 5.28.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52800). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.0.0. + +#### [Version 3.23.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.23.0.zip) +- Supports [sample Android adapter version 5.27.1.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52711). +- Supports [sample iOS adapter version 5.27.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52700). +- Built and tested with the Google Mobile Ads Unity Plugin version 10.0.0. + +#### [Version 3.22.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.22.0.zip) +- Supports [sample Android adapter version 5.27.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52710). +- Supports [sample iOS adapter version 5.24.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52410). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.5.0. + +#### [Version 3.21.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.21.1.zip) +- Supports [sample Android adapter version 5.27.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52710). +- Supports [sample iOS adapter version 5.23.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52300). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.5.0. + +#### [Version 3.21.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.21.0.zip) +- Supports [sample Android adapter version 5.27.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52700). +- Supports [sample iOS adapter version 5.23.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52300). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.5.0. + +#### [Version 3.20.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.20.0.zip) +- Supports [sample Android adapter version 5.26.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52600). +- Supports [sample iOS adapter version 5.22.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52200). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.4.0. + +#### [Version 3.19.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.19.0.zip) +- Supports [sample Android adapter version 5.23.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52300). +- Supports [sample iOS adapter version 5.21.9.1](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52191). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.4.0. + +#### [Version 3.18.2](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.18.2.zip) +- Supports [sample Android adapter version 5.22.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52210). +- Supports [sample iOS adapter version 5.21.9.1](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52191). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.3.0. + +#### [Version 3.18.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.18.1.zip) +- Supports [sample Android adapter version 5.22.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52210). +- Supports [sample iOS adapter version 5.21.8.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52180). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.2.0. + +#### [Version 3.18.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.18.0.zip) +- Renamed `DummyClient` to `PlaceholderClient`. +- Supports [sample Android adapter version 5.22.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52210). +- Supports [sample iOS adapter version 5.21.6.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52160). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.2.0. + +#### [Version 3.17.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.17.1.zip) +- Supports [sample Android adapter version 5.21.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52110). +- Supports [sample iOS adapter version 5.21.5.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52150). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.2.0. + +#### [Version 3.17.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.17.0.zip) +- Supports [sample Android adapter version 5.21.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52100). +- Supports [sample iOS adapter version 5.21.4.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52140). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.1.0. + +#### [Version 3.16.2](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.16.2.zip) +- Supports [sample Android adapter version 5.20.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52010). +- Supports [sample iOS adapter version 5.21.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52120). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.1.0. + +#### [Version 3.16.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.16.1.zip) +- Supports [sample Android adapter version 5.20.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52010). +- Supports [sample iOS adapter version 5.21.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52110). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.0.0. + +#### [Version 3.16.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.16.0.zip) +- Supports [sample Android adapter version 5.20.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52000). +- Supports [sample iOS adapter version 5.21.0.1](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52101). +- Built and tested with the Google Mobile Ads Unity Plugin version 9.0.0. + +#### [Version 3.15.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.15.0.zip) +- Supports [sample Android adapter version 5.20.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-52000). +- Supports [sample iOS adapter version 5.20.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-52010). +- Built and tested with the Google Mobile Ads Unity Plugin version 8.7.0. + +#### [Version 3.14.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.14.0.zip) +- Supports [sample Android adapter version 5.18.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51800). +- Supports [sample iOS adapter version 5.19.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51900). +- Built and tested with the Google Mobile Ads Unity Plugin version 8.5.0. + +#### [Version 3.13.2](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.13.2.zip) +- Supports [sample Android adapter version 5.16.5.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51650). +- Supports [sample iOS adapter version 5.17.5.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51750). +- Built and tested with the Google Mobile Ads Unity Plugin version 8.3.0. + +#### [Version 3.13.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.13.1.zip) +- Moved adapter content to `GoogleMobileAds/Mediation/Sample/`. +- Refactored adapter namespace to use `GoogleMobileAds.Mediation.Sample`. +- Supports [sample Android adapter version 5.16.4.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51641). +- Supports [sample iOS adapter version 5.17.4.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51740). +- Built and tested with the Google Mobile Ads Unity Plugin version 8.1.0. + +#### [Version 3.13.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.13.0.zip) +- Supports [sample Android adapter version 5.16.4.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51640). +- Supports [sample iOS adapter version 5.17.4.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51740). +- Built and tested with the Google Mobile Ads Unity Plugin version 8.0.0. + +#### [Version 3.12.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.12.0.zip) +- Supports [sample Android adapter version 5.15.5.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51550). +- Supports [sample iOS adapter version 5.16.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51600). +- Built and tested with the Google Mobile Ads Unity Plugin version 7.3.0. + +#### [Version 3.11.4](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.11.4.zip) +- Supports [sample Android adapter version 5.15.4.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51540). +- Supports [sample iOS adapter version 5.15.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51520). +- Built and tested with the Google Mobile Ads Unity Plugin version 7.2.0. + +#### [Version 3.11.3](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.11.3.zip) +- Renamed the `IsConsent()` method from the `Sample` class to `GetUserConsent()`. +- Added the following methods to the `Sample` class: + * `SetCCPAUserConsent(bool)` + * `GetCCPAUserConsent()` +- Supports [sample Android adapter version 5.15.3.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51530). +- Supports [sample iOS adapter version 5.15.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51520). +- Built and tested with the Google Mobile Ads Unity Plugin version 7.2.0. + +#### [Version 3.11.2](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.11.2.zip) +- Supports [sample Android adapter version 5.15.2.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51521). +- Supports [sample iOS adapter version 5.15.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51520). +- Built and tested with the Google Mobile Ads Unity Plugin version 7.0.2. + +#### [Version 3.11.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.11.1.zip) +- Supports [sample Android adapter version 5.15.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51510). +- Supports [sample iOS adapter version 5.15.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51510). +- Built and tested with the Google Mobile Ads Unity Plugin version 7.0.0. + +#### [Version 3.11.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.11.0.zip) +- Supports [sample Android adapter version 5.15.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51500). +- Supports [sample iOS adapter version 5.15.0.1](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51501). +- Built and tested with the Google Mobile Ads Unity Plugin version 7.0.0. + +#### [Version 3.10.2](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.10.2.zip) +- Supports [sample Android adapter version 5.14.4.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51440). +- Supports [sample iOS adapter version 5.14.4.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51440). + +#### [Version 3.10.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.10.1.zip) +- Supports [sample Android adapter version 5.14.3.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51430). +- Supports [sample iOS adapter version 5.14.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51420). + +#### [Version 3.10.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.10.0.zip) +- Supports [sample Android adapter version 5.14.2.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51420). +- Supports [sample iOS adapter version 5.14.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51410). + +#### [Version 3.9.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.9.0.zip) +- Supports [sample Android adapter version 5.13.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51300). +- Supports [sample iOS adapter version 5.11.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-51120). + +#### [Version 3.8.2](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.8.2.zip) +- Supports [sample Android adapter version 5.11.7.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51170). +- Supports [sample iOS adapter version 5.9.10.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-59100). + +#### [Version 3.8.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.8.1.zip) +- Supports [sample Android adapter version 5.11.5.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51150). +- Supports [sample iOS adapter version 5.9.6.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5960). + +#### [Version 3.8.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.8.0.zip) +- Supports [sample Android adapter version 5.11.4.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51140). +- Supports [sample iOS adapter version 5.9.5.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5950). + +#### [Version 3.7.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.7.0.zip) +- Supports [sample Android adapter version 5.10.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-51000). +- Supports [sample iOS adapter version 5.7.5.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5750). + +#### [Version 3.6.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.6.1.zip) +- Renamed the `Sample.IsUserConsent()` method to `Sample.IsConsent()`. +- Supports [sample Android adapter version 5.9.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-5910). +- Supports [sample iOS adapter version 5.7.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5720). + +#### [Version 3.6.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.6.0.zip) +- Supports [sample Android adapter version 5.9.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-5900). +- Supports [sample iOS adapter version 5.7.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5700). + +#### [Version 3.5.2](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.5.2.zip) +- Supports [sample Android adapter version 5.8.3.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-5830). +- Supports [sample iOS adapter version 5.6.3.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5630). + +#### [Version 3.5.1](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.5.1.zip) +- Supports [sample Android adapter version 5.8.2.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-5820). +- Supports [sample iOS adapter version 5.6.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5610). + +#### [Version 3.5.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.5.0.zip) +- Supports [sample Android adapter version 5.8.1.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-5810). +- Supports [sample iOS adapter version 5.6.0.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5600). + +#### [Version 3.4.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.4.0.zip) +- Supports [sample Android adapter version 5.8.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-5800). +- Supports [sample iOS adapter version 5.5.2.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5520). + +#### [Version 3.3.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.3.0.zip) +- Supports [sample Android adapter version 5.7.0.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-5700). +- Supports [sample iOS adapter version 5.5.1.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5510). + +#### [Version 3.2.0](https://dl.google.com/googleadmobadssdk/mediation/unity/mytarget/SampleUnityAdapter-3.2.0.zip) +- Supports [sample Android adapter version 5.6.3.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-5630). +- Supports [sample iOS adapter version 5.4.9.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5490). + +#### Version 3.1.0 +- Supports [sample Android adapter version 5.4.6.0](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/mytarget/CHANGELOG.md#version-5460). +- Supports [sample iOS adapter version 5.3.3.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/Sample/CHANGELOG.md#version-5330). + +#### Version 3.0.0 +- Updated the plugin to support the new open-beta Rewarded API. +- Supports sample Android adapter version 5.3.9.0. +- Supports sample iOS adapter version 5.0.4.0. + +#### Version 2.3.2 +- Supports sample Android adapter version 5.2.5.0. +- Supports sample iOS adapter version 4.8.9.0. + +#### Version 2.3.1 +- Supports sample Android adapter version 5.2.5.0. +- Supports sample iOS adapter version 4.8.5.0. + +#### Version 2.3.0 +- Supports sample Android adapter version 5.2.2.0. +- Supports sample iOS adapter version 4.8.0.0. + +#### Version 2.2.0 +- Supports sample Android adapter version 5.1.4.0. +- Supports sample iOS adapter version 4.8.0.0. + +#### Version 2.1.2 +- Supports sample Android adapter version 5.1.3.0. +- Supports sample iOS adapter version 4.7.11.0. + +#### Version 2.1.1 +- Supports sample Android adapter version 5.1.1.0. +- Supports sample iOS adapter version 4.7.10.0. + +#### Version 2.1.0 +- Supports sample Android SDK version 5.1.0. +- Supports sample iOS SDK version 4.7.9. +- Added the following methods: + * `Sample.SetUserConsent()` method to forward the user's consent status to the Sample SDK. + * `Sample.SetUserAgeRestricted` method that sets a flag to indicate if the user is known to be in an age-restricted category (i.e., under the age of 16). + * `Sample.IsUserConsent()` method to get the user's current consent status. + * `Sample.IsUserAgeRestricted()` method to get the flag indicating that the user is known to be in an age-restricted category (i.e., under the age of 16). + +#### Version 2.0.1 +- Supports sample Android SDK version 5.0.2. +- Supports sample iOS SDK version 4.7.8. + +#### Version 2.0.0 +- Supports sample Android SDK version 5.0.0. +- Supports sample iOS SDK version 4.7.7. + +#### Version 1.1.0 +- Supports sample Android SDK version 4.7.2. +- Supports sample iOS SDK version 4.7.6. + +#### Version 1.0.0 +- First release! +- Supports sample Android SDK version 4.6.27. +- Supports sample iOS SDK version 4.6.24. diff --git a/Sample/CHANGELOG.md.meta b/Sample/CHANGELOG.md.meta new file mode 100644 index 00000000..0aa049cd --- /dev/null +++ b/Sample/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4ab48c2ecec0343ac9d2c58752aa6758 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/CONTRIBUTING.md b/Sample/CONTRIBUTING.md new file mode 100644 index 00000000..9af69dd7 --- /dev/null +++ b/Sample/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Best Practices + +There are several coding practices that are applied to all adapters, for code readability, code consistency, and bug avoidance purposes. +Please keep these in mind when making adapter modifications: + +1. All adapters should be formatted using [Google Style](https://google.github.io/styleguide/csharp-style.html). + +# If you can't become a contributor + +If you can't become a contributor, but wish to share some code that illustrates +an issue / shows how an issue may be fixed, then you can attach your changes on +the issue tracker. We will use this code to troubleshoot the issue and fix it, +but will not use this code in the library unless the steps to submit patches +are done. diff --git a/Sample/LICENSE b/Sample/LICENSE new file mode 100644 index 00000000..b7c9ed18 --- /dev/null +++ b/Sample/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2013 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Sample/LICENSE.meta b/Sample/LICENSE.meta new file mode 100644 index 00000000..ccf6c717 --- /dev/null +++ b/Sample/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8e626a812198b453c9fb95b72a3ad7d0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/README.md b/Sample/README.md new file mode 100644 index 00000000..6e3040e9 --- /dev/null +++ b/Sample/README.md @@ -0,0 +1,8 @@ +# sample Adapter plugin for Google Mobile Ads SDK for Unity + +This is a plugin to be used in conjunction with the Google Mobile Ads SDK in +Google Play services. For requirements, instructions, and other info, see the +[sample Adapter Integration Guide](https://developers.google.com/admob/unity/mediation/sample). + +See the [changelog](https://developers.google.com/admob/unity/mediation/sample#sample-unity-mediation-plugin-changelog) +to view the version history. diff --git a/Sample/README.md.meta b/Sample/README.md.meta new file mode 100644 index 00000000..a6229aa0 --- /dev/null +++ b/Sample/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9a7029ae0d5dd475196562326656f89b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/build.gradle b/Sample/build.gradle new file mode 100644 index 00000000..b8ab3dc2 --- /dev/null +++ b/Sample/build.gradle @@ -0,0 +1,99 @@ +/* +* Gradle file to build a Unity package to add sample mediation support to the Google Mobile Ads Unity plugin. +* Usage: ./gradlew exportPackage +*/ +defaultTasks 'exportPackage' + +// Project level variables. +project.ext { + unity_exe = System.getProperty("UNITY_EXE") + if (unity_exe == null || unity_exe.isEmpty()) { + unity_exe = System.getenv("UNITY_EXE") + } + if (unity_exe == null || unity_exe.isEmpty()) { + unity_exe = '/Applications/Unity/Unity.app/Contents/MacOS/Unity' + } + + if (!file(unity_exe).exists()) { + throw new GradleException('Unable to locate installation of Unity. Please create a ' + + 'UNITY_EXE environment variable and point it to your Unity installation.') + } + + versionString = '1.0.0' + adapterName = 'Sample' + pluginName = "GoogleMobileAds${adapterName}Mediation" + pluginFileName = "${pluginName}.unitypackage" + zipName = "${adapterName}UnityAdapter-${versionString}" + zipFileName = "${zipName}.zip" + pluginSource = file('source/plugin').absolutePath + pluginBuildDir = file('temp/plugin-build-dir').absolutePath + buildPath = file('temp').absolutePath + exportPath = file(pluginFileName).absolutePath +} + +// Build unity package using through command line interface. +// Create new unity project with files in temporary build directory and export files to a unity package. +// Command line usage and arguments documented at http://docs.unity3d.com/Manual/CommandLineArguments.html. +task exportPackage(type: Exec) { + description = "Creates and exports the Plugin unity package" + executable "${unity_exe}" + args "-g.building", + "-batchmode", + "-projectPath", "${pluginBuildDir}", + "-logFile", "temp/unity.log", + "-exportPackage", + "Assets/GoogleMobileAds", + "${exportPath}", + "-quit" + + ignoreExitValue true + + doLast { + if (executionResult.get().exitValue != 0) { + copy { + from "temp/" + into "./" + include "unity.log" + } + } + } +} + +task createTempBuildFolder(type: Copy) { + from { "${pluginSource}" } + into { "${pluginBuildDir}" } +} + +task clearTempBuildFolder(type: Delete) { + delete { "${buildPath}" } +} + +exportPackage.dependsOn(createTempBuildFolder) +exportPackage.finalizedBy(clearTempBuildFolder) + +/** + * Delete task to delete any previously generated .zip files by makeZip task. + * makeZip depends on this task. + */ +task clearZip(type: Delete) { + // Targets to be deleted. + delete(zipFileName) +} + +/** + * Zip task to make a zip archive. This task depends on exportPackage and clearZip tasks. + */ +task makeZip(type: Zip) { + // Targets to be added to the zip archive. + from('./' + pluginFileName, './README.md') + from('./' + pluginFileName, './LICENSE') + // Root directory name for the zip archive. + into(zipName) + // Name of the zip archive. + archiveFileName = zipFileName + // Destination directory in which the archive needs to be saved. + destinationDirectory = file('.') +} + +makeZip.dependsOn([clearZip, exportPackage]) +makeZip.mustRunAfter([clearZip, exportPackage]) diff --git a/Sample/build.gradle.meta b/Sample/build.gradle.meta new file mode 100644 index 00000000..ed01175d --- /dev/null +++ b/Sample/build.gradle.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 00e2552c0ee094d6e9b569b68b85ace2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/package.json b/Sample/package.json new file mode 100644 index 00000000..b5b0a502 --- /dev/null +++ b/Sample/package.json @@ -0,0 +1,21 @@ +{ + "name": "com.google.ads.mobile.mediation.sample", + "version": "1.0.0", + "displayName": "Google Mobile Ads sample Mediation", + "keywords": [ + "Google", + "Mobile", + "Ads", + "vh-name:GoogleMobileAdsMediationSample", + "vh-name:Google Mobile Ads sample Mediation" + ], + "author": { + "name": "Google LLC", + "url": "https://github.com/googleads/googleads-mobile-unity-mediation" + }, + "description": "The Google Mobile Ads mediation plugin for sample package allows you to load and display ads from sample using mediation, covering waterfall integrations.", + "unity": "2019.4", + "dependencies": { + "com.google.ads.mobile": "11.0.0" + } +} diff --git a/Sample/package.json.meta b/Sample/package.json.meta new file mode 100644 index 00000000..a119cded --- /dev/null +++ b/Sample/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d581240647df740f5bd761f352823b8d +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source.meta b/Sample/source.meta new file mode 100644 index 00000000..6ec6ff66 --- /dev/null +++ b/Sample/source.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 789149be4511548e28b2971ae182f912 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin.meta b/Sample/source/plugin.meta new file mode 100644 index 00000000..1e765b63 --- /dev/null +++ b/Sample/source/plugin.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0a3ead0bd85d748b994c94155d1e4930 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets.meta b/Sample/source/plugin/Assets.meta new file mode 100644 index 00000000..a5c8006d --- /dev/null +++ b/Sample/source/plugin/Assets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46a4bf891d53445728711b1f9d441293 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds.meta b/Sample/source/plugin/Assets/GoogleMobileAds.meta new file mode 100644 index 00000000..0b52ac7e --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6a2cc5c1ef3ee4056b54e866a0070c0a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation.meta new file mode 100644 index 00000000..e8b0d1bc --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 25eded4ef9f8f438fb92520959191748 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample.meta new file mode 100644 index 00000000..e952429e --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7312cd31969424dfb94b053d8beed3c4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/GoogleMobileAds.Mediation.Sample.Api.asmdef b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/GoogleMobileAds.Mediation.Sample.Api.asmdef new file mode 100644 index 00000000..18ec0a1e --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/GoogleMobileAds.Mediation.Sample.Api.asmdef @@ -0,0 +1,23 @@ +{ + "name": "GoogleMobileAds.Mediation.MyTarget.Api", + "rootNamespace": "", + "references": [ + "GoogleMobileAds.Api.Mediation", + "GoogleMobileAds.Mediation.MyTarget.Common", + "GoogleMobileAds.Mediation.MyTarget.Mediation" + ], + "references": [], + "includePlatforms": [ + "Android", + "Editor", + "iOS" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/GoogleMobileAds.Mediation.Sample.Api.asmdef.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/GoogleMobileAds.Mediation.Sample.Api.asmdef.meta new file mode 100644 index 00000000..7ed86a8a --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/GoogleMobileAds.Mediation.Sample.Api.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4e60aca8a3812479eb385ec9a21c957d +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/Sample.cs b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/Sample.cs new file mode 100644 index 00000000..8f92ff90 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/Sample.cs @@ -0,0 +1,92 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using GoogleMobileAds.Mediation.Sample.Common; + +namespace GoogleMobileAds.Mediation.Sample.Api +{ + public class Sample + { + internal static readonly ISampleClient client = + SampleClientFactory.CreateSampleClient(); + + public static void SetUserConsent(bool userConsent) + { + client.SetUserConsent(userConsent); + } + + public static bool GetUserConsent() + { + return client.GetUserConsent(); + } + + public static void SetUserAgeRestricted(bool userAgeRestricted) + { + client.SetUserAgeRestricted(userAgeRestricted); + } + + public static bool IsUserAgeRestricted() + { + return client.IsUserAgeRestricted(); + } + + public static void SetCCPAUserConsent(bool ccpaUserConsent) + { + client.SetCCPAUserConsent(ccpaUserConsent); + } + + public static bool GetCCPAUserConsent() + { + return client.GetCCPAUserConsent(); + } + } +} + +namespace GoogleMobileAds.Api.Mediation.Sample +{ + [System.Obsolete("Use `GoogleMobileAds.Mediation.Sample.Api.Sample` instead.")] + public class Sample + { + public static void SetUserConsent(bool userConsent) + { + GoogleMobileAds.Mediation.Sample.Api.Sample.SetUserConsent(userConsent); + } + + public static bool GetUserConsent() + { + return GoogleMobileAds.Mediation.Sample.Api.Sample.GetUserConsent(); + } + + public static void SetUserAgeRestricted(bool userAgeRestricted) + { + GoogleMobileAds.Mediation.Sample.Api.Sample + .SetUserAgeRestricted(userAgeRestricted); + } + + public static bool IsUserAgeRestricted() + { + return GoogleMobileAds.Mediation.Sample.Api.Sample.IsUserAgeRestricted(); + } + + public static void SetCCPAUserConsent(bool ccpaUserConsent) + { + GoogleMobileAds.Mediation.Sample.Api.Sample.SetCCPAUserConsent(ccpaUserConsent); + } + + public static bool GetCCPAUserConsent() + { + return GoogleMobileAds.Mediation.Sample.Api.Sample.GetCCPAUserConsent(); + } + } +} diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/Sample.cs.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/Sample.cs.meta new file mode 100644 index 00000000..a98da4cf --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Api/Sample.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1edbd7ea114c7417eb9c55510e20bb09 +timeCreated: 1527546842 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/GoogleMobileAds.Mediation.Sample.Common.asmdef b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/GoogleMobileAds.Mediation.Sample.Common.asmdef new file mode 100644 index 00000000..d32a3c47 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/GoogleMobileAds.Mediation.Sample.Common.asmdef @@ -0,0 +1,14 @@ +{ + "name": "GoogleMobileAds.Mediation.MyTarget.Common", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/GoogleMobileAds.Mediation.Sample.Common.asmdef.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/GoogleMobileAds.Mediation.Sample.Common.asmdef.meta new file mode 100644 index 00000000..3aed89e1 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/GoogleMobileAds.Mediation.Sample.Common.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 951e440e6050f4cd0912c3c90e89f178 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/ISampleClient.cs b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/ISampleClient.cs new file mode 100644 index 00000000..5b0ec275 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/ISampleClient.cs @@ -0,0 +1,26 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace GoogleMobileAds.Mediation.Sample.Common +{ + public interface ISampleClient + { + void SetUserConsent(bool userConsent); + bool GetUserConsent(); + void SetUserAgeRestricted(bool userAgeRestricted); + bool IsUserAgeRestricted(); + void SetCCPAUserConsent(bool ccpaUserConsent); + bool GetCCPAUserConsent(); + } +} diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/ISampleClient.cs.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/ISampleClient.cs.meta new file mode 100644 index 00000000..a68ad7b9 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/ISampleClient.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b458fbedb131c48329b2690d51e932c9 +timeCreated: 1527547128 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/PlaceholderClient.cs b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/PlaceholderClient.cs new file mode 100644 index 00000000..5cad24e8 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/PlaceholderClient.cs @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Reflection; + +using UnityEngine; + +namespace GoogleMobileAds.Mediation.Sample.Common +{ + public class PlaceholderClient : ISampleClient + { + public PlaceholderClient() + { + Debug.Log ("Placeholder " + MethodBase.GetCurrentMethod().Name); + } + + public void SetUserConsent(bool userConsent) + { + Debug.Log ("Placeholder " + MethodBase.GetCurrentMethod().Name); + } + + public bool GetUserConsent() + { + Debug.Log ("Placeholder " + MethodBase.GetCurrentMethod().Name); + return false; + } + + public void SetUserAgeRestricted(bool userAgeRestricted) + { + Debug.Log ("Placeholder " + MethodBase.GetCurrentMethod().Name); + } + + public bool IsUserAgeRestricted() + { + Debug.Log ("Placeholder " + MethodBase.GetCurrentMethod().Name); + return false; + } + + public void SetCCPAUserConsent(bool ccpaUserConsent) + { + Debug.Log ("Placeholder " + MethodBase.GetCurrentMethod().Name); + } + + public bool GetCCPAUserConsent() + { + Debug.Log ("Placeholder " + MethodBase.GetCurrentMethod().Name); + return false; + } + } +} diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/PlaceholderClient.cs.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/PlaceholderClient.cs.meta new file mode 100644 index 00000000..a84ed91e --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Common/PlaceholderClient.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1fd48ffcf784545d1af535ec6ad3edad +timeCreated: 1527547121 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Editor/SampleMediationDependencies.xml b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Editor/SampleMediationDependencies.xml new file mode 100644 index 00000000..91946965 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Editor/SampleMediationDependencies.xml @@ -0,0 +1,30 @@ + + + + + + + https://repo.maven.apache.org/maven2/ + https://dl.google.com/dl/android/maven2/ + + + + + + + + diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Editor/SampleMediationDependencies.xml.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Editor/SampleMediationDependencies.xml.meta new file mode 100644 index 00000000..3e63880f --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Editor/SampleMediationDependencies.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3ff460858179d42da883f22756f26e6f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/GoogleMobileAds.Mediation.Sample.Android.asmdef b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/GoogleMobileAds.Mediation.Sample.Android.asmdef new file mode 100644 index 00000000..d509aa30 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/GoogleMobileAds.Mediation.Sample.Android.asmdef @@ -0,0 +1,19 @@ +{ + "name": "GoogleMobileAds.Mediation.MyTarget.Android", + "rootNamespace": "", + "references": [ + "GoogleMobileAds.Mediation.MyTarget.Common" + ], + "includePlatforms": [ + "Android", + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/GoogleMobileAds.Mediation.Sample.Android.asmdef.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/GoogleMobileAds.Mediation.Sample.Android.asmdef.meta new file mode 100644 index 00000000..5cf590be --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/GoogleMobileAds.Mediation.Sample.Android.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: be8624d49169d4b2a97f6df3d0928b87 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/SampleClient.cs b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/SampleClient.cs new file mode 100644 index 00000000..93e2cf50 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/SampleClient.cs @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if UNITY_ANDROID + +using UnityEngine; + +using GoogleMobileAds.Mediation.Sample.Common; + +namespace GoogleMobileAds.Mediation.Sample.Android +{ + public class SampleClient : ISampleClient + { + private static SampleClient instance = new SampleClient(); + private SampleClient() {} + + private const string SAMPLE_PRIVACY_CLASS_NAME = "com.my.target.common.SamplePrivacy"; + + public static SampleClient Instance + { + get + { + return instance; + } + } + + public void SetUserConsent(bool userConsent) + { + AndroidJavaClass samplePrivacy = new AndroidJavaClass(SAMPLE_PRIVACY_CLASS_NAME); + samplePrivacy.CallStatic("setUserConsent", userConsent); + } + + public bool GetUserConsent() + { + AndroidJavaClass samplePrivacy = new AndroidJavaClass(SAMPLE_PRIVACY_CLASS_NAME); + AndroidJavaObject sampleCurrentPrivacy = + samplePrivacy.CallStatic("currentPrivacy"); + AndroidJavaObject userConsent = + sampleCurrentPrivacy.Get("userConsent"); + return userConsent.Call("booleanValue"); + } + + public void SetUserAgeRestricted(bool userAgeRestricted) + { + AndroidJavaClass samplePrivacy = new AndroidJavaClass(SAMPLE_PRIVACY_CLASS_NAME); + samplePrivacy.CallStatic("setUserAgeRestricted", userAgeRestricted); + } + + public bool IsUserAgeRestricted() + { + AndroidJavaClass samplePrivacy = new AndroidJavaClass(SAMPLE_PRIVACY_CLASS_NAME); + AndroidJavaObject sampleCurrentPrivacy = + samplePrivacy.CallStatic("currentPrivacy"); + return sampleCurrentPrivacy.Get("userAgeRestricted"); + } + + public void SetCCPAUserConsent(bool ccpaUserConsent) + { + AndroidJavaClass samplePrivacy = new AndroidJavaClass(SAMPLE_PRIVACY_CLASS_NAME); + samplePrivacy.CallStatic("setCcpaUserConsent", ccpaUserConsent); + } + + public bool GetCCPAUserConsent() + { + AndroidJavaClass samplePrivacy = new AndroidJavaClass(SAMPLE_PRIVACY_CLASS_NAME); + AndroidJavaObject sampleCurrentPrivacy = + samplePrivacy.CallStatic("currentPrivacy"); + AndroidJavaObject ccpaUserConsent = + sampleCurrentPrivacy.Get("ccpaUserConsent"); + return ccpaUserConsent.Call("booleanValue"); + } + } +} + +#endif diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/SampleClient.cs.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/SampleClient.cs.meta new file mode 100644 index 00000000..92ced9fd --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Android/SampleClient.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ec19282172e424a71b8f1cf1cc711597 +timeCreated: 1527547138 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/GoogleMobileAds.Mediation.Sample.Mediation.asmdef b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/GoogleMobileAds.Mediation.Sample.Mediation.asmdef new file mode 100644 index 00000000..573131e6 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/GoogleMobileAds.Mediation.Sample.Mediation.asmdef @@ -0,0 +1,22 @@ +{ + "name": "GoogleMobileAds.Mediation.MyTarget.Mediation", + "rootNamespace": "", + "references": [ + "GoogleMobileAds.Mediation.MyTarget.Common", + "GoogleMobileAds.Mediation.MyTarget.Android", + "GoogleMobileAds.Mediation.MyTarget.iOS" + ], + "includePlatforms": [ + "Editor", + "Android", + "iOS" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/GoogleMobileAds.Mediation.Sample.Mediation.asmdef.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/GoogleMobileAds.Mediation.Sample.Mediation.asmdef.meta new file mode 100644 index 00000000..6e674eac --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/GoogleMobileAds.Mediation.Sample.Mediation.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9debba11feeda475ab7d2cfc82614342 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/SampleClientFactory.cs b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/SampleClientFactory.cs new file mode 100644 index 00000000..4f3828e8 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/SampleClientFactory.cs @@ -0,0 +1,34 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using GoogleMobileAds.Mediation.Sample.Common; + +namespace GoogleMobileAds.Mediation.Sample +{ + public class SampleClientFactory + { + public static ISampleClient CreateSampleClient() + { + #if UNITY_EDITOR + return new GoogleMobileAds.Mediation.Sample.Common.PlaceholderClient(); + #elif UNITY_ANDROID + return GoogleMobileAds.Mediation.Sample.Android.SampleClient.Instance; + #elif UNITY_IOS + return GoogleMobileAds.Mediation.Sample.iOS.SampleClient.Instance; + #else + return new GoogleMobileAds.Mediation.Sample.Common.PlaceholderClient(); + #endif + } + } +} diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/SampleClientFactory.cs.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/SampleClientFactory.cs.meta new file mode 100644 index 00000000..858cf20b --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/Mediation/SampleClientFactory.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3d1037dbc24204835a5fc7329adf858d +timeCreated: 1527547150 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/Externs.cs b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/Externs.cs new file mode 100644 index 00000000..f199aeaa --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/Externs.cs @@ -0,0 +1,44 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if UNITY_IOS + +using System.Runtime.InteropServices; + +namespace GoogleMobileAds.Mediation.Sample.iOS +{ + // Externs used by the iOS component. + internal class Externs + { + [DllImport("__Internal")] + internal static extern void GADUMSampleSetUserConsent(bool userConsent); + + [DllImport("__Internal")] + internal static extern bool GADUMSampleGetUserConsent(); + + [DllImport("__Internal")] + internal static extern void GADUMSampleSetUserAgeRestricted(bool userAgeRestricted); + + [DllImport("__Internal")] + internal static extern bool GADUMSampleIsUserAgeRestricted(); + + [DllImport("__Internal")] + internal static extern void GADUMSampleSetCCPAUserConsent(bool ccpaUserConsent); + + [DllImport("__Internal")] + internal static extern bool GADUMSampleGetCCPAUserConsent(); + } +} + +#endif diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/Externs.cs.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/Externs.cs.meta new file mode 100644 index 00000000..129e7e0d --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/Externs.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 96594b909678945cd84e0dfabc4a19d1 +timeCreated: 1527547157 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/GoogleMobileAds.Mediation.Sample.iOS.asmdef b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/GoogleMobileAds.Mediation.Sample.iOS.asmdef new file mode 100644 index 00000000..e2cf4961 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/GoogleMobileAds.Mediation.Sample.iOS.asmdef @@ -0,0 +1,19 @@ +{ + "name": "GoogleMobileAds.Mediation.MyTarget.iOS", + "rootNamespace": "", + "references": [ + "GoogleMobileAds.Mediation.MyTarget.Common" + ], + "includePlatforms": [ + "Editor", + "iOS" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/GoogleMobileAds.Mediation.Sample.iOS.asmdef.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/GoogleMobileAds.Mediation.Sample.iOS.asmdef.meta new file mode 100644 index 00000000..9b3ad58c --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/GoogleMobileAds.Mediation.Sample.iOS.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d451b4b3a484644dbb1e64a0f16a674b +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/SampleClient.cs b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/SampleClient.cs new file mode 100644 index 00000000..466aecc8 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/SampleClient.cs @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if UNITY_IOS + +using GoogleMobileAds.Mediation.Sample.Common; + +namespace GoogleMobileAds.Mediation.Sample.iOS +{ + public class SampleClient : ISampleClient + { + private static SampleClient instance = new SampleClient(); + private SampleClient() { } + + public static SampleClient Instance + { + get + { + return instance; + } + } + + public void SetUserConsent(bool userConsent) + { + Externs.GADUMSampleSetUserConsent(userConsent); + } + + public bool GetUserConsent() + { + return Externs.GADUMSampleGetUserConsent(); + } + + public void SetUserAgeRestricted(bool userAgeRestricted) + { + Externs.GADUMSampleSetUserAgeRestricted(userAgeRestricted); + } + + public bool IsUserAgeRestricted() + { + return Externs.GADUMSampleIsUserAgeRestricted(); + } + + public void SetCCPAUserConsent(bool ccpaUserConsent) + { + Externs.GADUMSampleSetCCPAUserConsent(ccpaUserConsent); + } + + public bool GetCCPAUserConsent() + { + return Externs.GADUMSampleGetCCPAUserConsent(); + } + } +} + +#endif diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/SampleClient.cs.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/SampleClient.cs.meta new file mode 100644 index 00000000..23033a65 --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Platforms/iOS/SampleClient.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5d9c81d10e0fc4a43a8a7643c01f7f7c +timeCreated: 1527547163 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Plugins/iOS/GADUMSampleInterface.m b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Plugins/iOS/GADUMSampleInterface.m new file mode 100644 index 00000000..f0595f3f --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Plugins/iOS/GADUMSampleInterface.m @@ -0,0 +1,31 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +void GADUMSampleSetUserConsent(BOOL userConsent) { [SamplePrivacy setUserConsent:userConsent]; } + +BOOL GADUMSampleGetUserConsent() { return [SamplePrivacy currentPrivacy].userConsent; } + +void GADUMSampleSetUserAgeRestricted(BOOL userAgeRestricted) { + [SamplePrivacy setUserAgeRestricted:userAgeRestricted]; +} + +BOOL GADUMSampleIsUserAgeRestricted() { return [SamplePrivacy currentPrivacy].userAgeRestricted; } + +void GADUMSampleSetCCPAUserConsent(BOOL ccpaUserConsent) { + [SamplePrivacy setCcpaUserConsent:ccpaUserConsent]; +} + +BOOL GADUMSampleGetCCPAUserConsent() { return [SamplePrivacy currentPrivacy].ccpaUserConsent; } diff --git a/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Plugins/iOS/GADUMSampleInterface.m.meta b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Plugins/iOS/GADUMSampleInterface.m.meta new file mode 100644 index 00000000..49153fde --- /dev/null +++ b/Sample/source/plugin/Assets/GoogleMobileAds/Mediation/Sample/Plugins/iOS/GADUMSampleInterface.m.meta @@ -0,0 +1,31 @@ +fileFormatVersion: 2 +guid: 2f061ad868625452bb75e9b66c7151ae +timeCreated: 1527549095 +licenseType: Pro +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/scripts/generate_unity_adapter.sh b/scripts/generate_unity_adapter.sh new file mode 100755 index 00000000..a75d8d6b --- /dev/null +++ b/scripts/generate_unity_adapter.sh @@ -0,0 +1,420 @@ +#!/bin/bash +# Script must be run from a google3 workspace root. +# Generates a new Unity mediation adapter plugin. +# +# Usage: +# # From google3/third_party/unity/gma_sdk_mediation/scripts/ +# ./generate_unity_adapter.sh -adapter_name \ +# [-version ] \ +# [-unity_version ] \ +# [-android_adapter_version ] \ +# [-ios_adapter_version ] \ +# [-android_package_name ] \ +# [-ios_pod_name ] \ +# [-with_extras] +# +# Example: +# # From google3/third_party/unity/gma_sdk_mediation/scripts/ +# ./generate_unity_adapter.sh -adapter_name MyNewAd -version 1.0.0 \ +# -unity_version 11.0.0 -android_adapter_version 1.2.3.0 \ +# -ios_adapter_version 1.2.3.0 \ +# -android_package_name com.google.ads.mediation.mynewad \ +# -ios_pod_name GoogleMobileAdsMediationMyNewAd \ +# -with_extras + +set -e +set -o pipefail + +echo "-------------------------------------------------------------------------" + +# 1) Set up bash variables and parse arguments. +adapter_name="" +version="1.0.0" +unity_version="11.0.0" # Default Google Mobile Ads Unity Plugin version +android_adapter_version="a.b.c.d" +ios_adapter_version="x.y.z.w" +android_package_name="" +ios_pod_name="" +with_extras=false +year=$(date +"%Y") + +while [[ "$#" -gt 0 ]]; do + case "$1" in + -adapter_name) + adapter_name="$2" + shift 2 + ;; + -version) + version="$2" + shift 2 + ;; + -unity_version) + unity_version="$2" + shift 2 + ;; + -android_adapter_version) + android_adapter_version="$2" + shift 2 + ;; + -ios_adapter_version) + ios_adapter_version="$2" + shift 2 + ;; + -android_package_name) + android_package_name="$2" + shift 2 + ;; + -ios_pod_name) + ios_pod_name="$2" + shift 2 + ;; + -with_extras) + with_extras=true + shift 1 + ;; + *) + echo "Error: Invalid option '$1'" + echo "Usage: $0 -adapter_name [-version ] [-unity_version ] [-android_adapter_version ] [-ios_adapter_version ] [-android_package_name ] [-ios_pod_name ] [-with_extras]" + exit 1 + ;; + esac +done + +if [[ -z "$adapter_name" ]]; then + echo "Error: -adapter_name is required." + echo "Usage: $0 -adapter_name [-version ] [-unity_version ] [-android_adapter_version ] [-ios_adapter_version ] [-android_package_name ] [-ios_pod_name ] [-with_extras]" + exit 1 +fi + +if [[ ! ${adapter_name:0:1} =~ [[:upper:]] ]]; then + echo "Error: First character of the Adapter name must be in upper case." + exit 1 +fi + +adapter_name_lower_cased=$(echo "$adapter_name" | tr '[:upper:]' '[:lower:]') +adapter_name_upper_cased=$(echo "$adapter_name" | tr '[:lower:]' '[:upper:]') +plugin_name="GoogleMobileAds${adapter_name}Mediation" + +# Determine the root directory of the Unity mediation plugins. +# Assuming the script is in google3/third_party/unity/gma_sdk_mediation/scripts/ +SCRIPT_DIR="$(dirname "$(realpath "$0")")" +adapter_root_dir="$(dirname "${SCRIPT_DIR}")" +template_adapter_dir="${adapter_root_dir}/MyTarget" # Using MyTarget as a base template +extras_template_dir="${adapter_root_dir}/LiftoffMonetize" # Template for extras +new_adapter_dir="${adapter_root_dir}/${adapter_name}" + +# Determine workspace type for making files writable +workspace_cmd="" +# Check if .hg exists two levels up (from scripts/ to google3/) +if [[ -d "${SCRIPT_DIR}/../../.hg" ]]; then + workspace_cmd="hg" + echo "Fig workspace detected." +# Check if .citc exists two levels up +elif [[ -d "${SCRIPT_DIR}/../../.citc" ]]; then + workspace_cmd="g4" + echo "Piper workspace detected." +else + echo "No Piper or Fig workspace detected. Using chmod." +fi + +# Function to make a file writable in the current workspace. +make_writable() { + local file="$1" + if [[ -n "$workspace_cmd" ]]; then + echo " Making writable: ${file} using ${workspace_cmd}" + # Use g4 edit or hg edit. Redirect stdout/stderr to /dev/null to suppress messages. + "${workspace_cmd}" edit "${file}" > /dev/null 2>&1 || true + else + echo " Making writable: ${file} using chmod" + chmod +w "${file}" || true + fi +} +# Export the function so it's available in subshells spawned by find -exec +export -f make_writable + +# Set default package/pod names if not provided +if [[ -z "$android_package_name" ]]; then + android_package_name="com.google.ads.mediation.${adapter_name_lower_cased}" +fi +if [[ -z "$ios_pod_name" ]]; then + ios_pod_name="GoogleMobileAdsMediation${adapter_name}" +fi + +echo "Generating Unity adapter for: ${adapter_name}" +echo "Output directory: ${new_adapter_dir}" +echo "Plugin Version: ${version}" +echo "GMA Unity Plugin Version: ${unity_version}" +echo "Android Adapter Version: ${android_adapter_version}" +echo "iOS Adapter Version: ${ios_adapter_version}" +echo "Android Package Name: ${android_package_name}" +echo "iOS Pod Name: ${ios_pod_name}" +if [[ "$with_extras" == true ]]; then + echo "Including Mediation Extras templates." +fi + +# Check if adapter directory already exists +if [[ -d "${new_adapter_dir}" ]]; then + echo "Error: Directory ${new_adapter_dir} already exists. Please remove it or choose a different adapter name." + exit 1 +fi + +# 2) Create new adapter directory structure +echo "Creating directory structure..." +mkdir -p "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api" +mkdir -p "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Common" +mkdir -p "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Editor" +mkdir -p "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Android" +mkdir -p "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/iOS" +mkdir -p "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Mediation" +mkdir -p "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/Android" +mkdir -p "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS" + +# 3) Copy template files and .meta files +echo "Copying template files from ${template_adapter_dir}..." +# Root files +cp "${adapter_root_dir}/LICENSE" "${new_adapter_dir}/LICENSE" +cp "${adapter_root_dir}/CONTRIBUTING.md" "${new_adapter_dir}/CONTRIBUTING.md" +cp "${template_adapter_dir}/README.md" "${new_adapter_dir}/README.md" +cp "${template_adapter_dir}/CHANGELOG.md" "${new_adapter_dir}/CHANGELOG.md" +cp "${template_adapter_dir}/build.gradle" "${new_adapter_dir}/build.gradle" +cp "${template_adapter_dir}/package.json" "${new_adapter_dir}/package.json" +cp "${template_adapter_dir}/METADATA" "${new_adapter_dir}/METADATA" +cp "${template_adapter_dir}/rapid.blueprint" "${new_adapter_dir}/rapid.blueprint" + +# .meta files for root +cp "${adapter_root_dir}/MyTarget/LICENSE.meta" "${new_adapter_dir}/LICENSE.meta" +cp "${template_adapter_dir}/README.md.meta" "${new_adapter_dir}/README.md.meta" +cp "${template_adapter_dir}/CHANGELOG.md.meta" "${new_adapter_dir}/CHANGELOG.md.meta" +cp "${template_adapter_dir}/build.gradle.meta" "${new_adapter_dir}/build.gradle.meta" +cp "${template_adapter_dir}/package.json.meta" "${new_adapter_dir}/package.json.meta" +cp "${template_adapter_dir}/source.meta" "${new_adapter_dir}/source.meta" +cp "${template_adapter_dir}/source/plugin.meta" "${new_adapter_dir}/source/plugin.meta" +cp "${template_adapter_dir}/source/plugin/Assets.meta" "${new_adapter_dir}/source/plugin/Assets.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}.meta" + +# C# API and Common +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Api/MyTarget.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}.cs" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Api/MyTarget.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}.cs.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Common/IMyTargetClient.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Common/I${adapter_name}Client.cs" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Common/IMyTargetClient.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Common/I${adapter_name}Client.cs.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Common/PlaceholderClient.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Common/PlaceholderClient.cs" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Common/PlaceholderClient.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Common/PlaceholderClient.cs.meta" + +# C# Platform Factories +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/Mediation/MyTargetClientFactory.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Mediation/${adapter_name}ClientFactory.cs" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/Mediation/MyTargetClientFactory.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Mediation/${adapter_name}ClientFactory.cs.meta" + +# C# Android Platform +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/Android/MyTargetClient.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Android/${adapter_name}Client.cs" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/Android/MyTargetClient.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Android/${adapter_name}Client.cs.meta" + +# C# iOS Platform +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/iOS/MyTargetClient.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/iOS/${adapter_name}Client.cs" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/iOS/MyTargetClient.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/iOS/${adapter_name}Client.cs.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/iOS/Externs.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/iOS/Externs.cs" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/iOS/Externs.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/iOS/Externs.cs.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Plugins/iOS/GADUMMyTargetInterface.m" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/GADUM${adapter_name}Interface.m" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Plugins/iOS/GADUMMyTargetInterface.m.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/GADUM${adapter_name}Interface.m.meta" + +# Mediation Dependencies XML +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Editor/MyTargetMediationDependencies.xml" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Editor/${adapter_name}MediationDependencies.xml" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Editor/MyTargetMediationDependencies.xml.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Editor/${adapter_name}MediationDependencies.xml.meta" + +# ASMDEF files +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Api/Api.asmdef" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/GoogleMobileAds.Mediation.${adapter_name}.Api.asmdef" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Api/Api.asmdef.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/GoogleMobileAds.Mediation.${adapter_name}.Api.asmdef.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Common/Common.asmdef" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Common/GoogleMobileAds.Mediation.${adapter_name}.Common.asmdef" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Common/Common.asmdef.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Common/GoogleMobileAds.Mediation.${adapter_name}.Common.asmdef.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/Android/Android.asmdef" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Android/GoogleMobileAds.Mediation.${adapter_name}.Android.asmdef" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/Android/Android.asmdef.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Android/GoogleMobileAds.Mediation.${adapter_name}.Android.asmdef.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/iOS/iOS.asmdef" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/iOS/GoogleMobileAds.Mediation.${adapter_name}.iOS.asmdef" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/iOS/iOS.asmdef.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/iOS/GoogleMobileAds.Mediation.${adapter_name}.iOS.asmdef.meta" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/Mediation/Mediation.asmdef" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Mediation/GoogleMobileAds.Mediation.${adapter_name}.Mediation.asmdef" +cp "${template_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/MyTarget/Platforms/Mediation/Mediation.asmdef.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Mediation/GoogleMobileAds.Mediation.${adapter_name}.Mediation.asmdef.meta" + +# Optional: Copy Extras templates if -with_extras is used +if [[ "$with_extras" == true ]]; then + echo "Copying Extras template files from ${extras_template_dir}..." + mkdir -p "${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/src/main/java/com/google/unity/mediation/${adapter_name_lower_cased}" + mkdir -p "${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/src/main/res/values" + mkdir -p "${new_adapter_dir}/source/android-library/gradle/wrapper" + + cp "${extras_template_dir}/source/android-library/build.gradle" "${new_adapter_dir}/source/android-library/build.gradle" + cp "${extras_template_dir}/source/android-library/gradle.properties" "${new_adapter_dir}/source/android-library/gradle.properties" + cp "${extras_template_dir}/source/android-library/gradlew" "${new_adapter_dir}/source/android-library/gradlew" + cp "${extras_template_dir}/source/android-library/gradlew.bat" "${new_adapter_dir}/source/android-library/gradlew.bat" + cp "${extras_template_dir}/source/android-library/settings.gradle" "${new_adapter_dir}/source/android-library/settings.gradle" + cp "${extras_template_dir}/source/android-library/liftoffmonetize/build.gradle" "${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/build.gradle" + cp "${extras_template_dir}/source/android-library/liftoffmonetize/proguard-rules.pgcfg" "${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/proguard-rules.pgcfg" + cp "${extras_template_dir}/source/android-library/liftoffmonetize/src/main/AndroidManifest.xml" "${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/src/main/AndroidManifest.xml" + cp "${extras_template_dir}/source/android-library/liftoffmonetize/src/main/res/values/strings.xml" "${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/src/main/res/values/strings.xml" + cp "${extras_template_dir}/source/android-library/liftoffmonetize/src/main/java/com/google/unity/mediation/liftoffmonetize/VungleUnityExtrasBuilder.java" "${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/src/main/java/com/google/unity/mediation/${adapter_name_lower_cased}/${adapter_name}UnityExtrasBuilder.java" + cp "${extras_template_dir}/source/android-library/liftoffmonetize/src/main/java/com/google/unity/mediation/liftoffmonetize/VungleUnityInterstitialExtrasBuilder.java" "${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/src/main/java/com/google/unity/mediation/${adapter_name_lower_cased}/${adapter_name}UnityInterstitialExtrasBuilder.java" + cp "${extras_template_dir}/source/android-library/liftoffmonetize/src/main/java/com/google/unity/mediation/liftoffmonetize/VungleUnityRewardedVideoExtrasBuilder.java" "${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/src/main/java/com/google/unity/mediation/${adapter_name_lower_cased}/${adapter_name}UnityRewardedVideoExtrasBuilder.java" + cp "${extras_template_dir}/source/android-library/gradle/wrapper/gradle-wrapper.properties" "${new_adapter_dir}/source/android-library/gradle/wrapper/gradle-wrapper.properties" + + # Copy iOS Extras Builder + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Api/LiftoffMonetizeMediationExtras.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}MediationExtras.cs" + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Api/LiftoffMonetizeMediationExtras.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}MediationExtras.cs.meta" + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Api/LiftoffMonetizeInterstitialMediationExtras.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}InterstitialMediationExtras.cs" + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Api/LiftoffMonetizeInterstitialMediationExtras.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}InterstitialMediationExtras.cs.meta" + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Api/LiftoffMonetizeRewardedVideoMediationExtras.cs" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}RewardedVideoMediationExtras.cs" + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Api/LiftoffMonetizeRewardedVideoMediationExtras.cs.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}RewardedVideoMediationExtras.cs.meta" + + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Plugins/iOS/LiftoffMonetizeExtrasBuilder.h" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/${adapter_name}ExtrasBuilder.h" + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Plugins/iOS/LiftoffMonetizeExtrasBuilder.h.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/${adapter_name}ExtrasBuilder.h.meta" + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Plugins/iOS/LiftoffMonetizeExtrasBuilder.m" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/${adapter_name}ExtrasBuilder.m" + cp "${extras_template_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/LiftoffMonetize/Plugins/iOS/LiftoffMonetizeExtrasBuilder.m.meta" "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/${adapter_name}ExtrasBuilder.m.meta" +fi + +# 4) Replace placeholders +echo "Replacing placeholder symbols..." + +# First, make all files in the new adapter directory writable +echo "Preparing files for editing..." +find "${new_adapter_dir}" -type f -exec bash -c 'make_writable "$0"' {} \; + +# Now perform the sed replacements +echo "Performing text replacements..." +find "${new_adapter_dir}" -type f \( -name "*.md" -o -name "*.cs" -o -name "*.xml" -o -name "*.gradle" -o -name "*.json" -o -name "*.blueprint" -o -name "*.m" -o -name "*.h" -o -name "*.java" -o -name "*.properties" -o -name "*.pgcfg" \) -exec sed -i '' \ + -e "s/MyTarget/${adapter_name}/g" \ + -e "s/myTarget/${adapter_name_lower_cased}/g" \ + -e "s/MYTARGET/${adapter_name_upper_cased}/g" \ + -e "s/LiftoffMonetize/${adapter_name}/g" \ + -e "s/liftoffmonetize/${adapter_name_lower_cased}/g" \ + -e "s/Vungle/${adapter_name}/g" \ + -e "s/vungle/${adapter_name_lower_cased}/g" \ + -e "s/GoogleMobileAdsMyTargetMediation/${plugin_name}/g" \ + -e "s/\"version\": \"3.35.0\"/\"version\": \"${version}\"/g" \ + -e "s/versionString = '3.35.0'/versionString = '${version}'/g" \ + -e "s/Copyright 2017 Google LLC/Copyright ${year} Google LLC/g" \ + -e "s/Copyright 2018 Google LLC/Copyright ${year} Google LLC/g" \ + -e "s/Copyright 2019 Google LLC/Copyright ${year} Google LLC/g" \ + -e "s/Copyright 2022 Google LLC/Copyright ${year} Google LLC/g" \ + -e "s/Copyright 2023 Google LLC/Copyright ${year} Google LLC/g" \ + -e "s/Copyright 2024 Google LLC/Copyright ${year} Google LLC/g" \ + -e "s/Copyright 2025 Google LLC/Copyright ${year} Google LLC/g" \ + -e "s/com.google.ads.mobile\": \"11.0.0\"/com.google.ads.mobile\": \"${unity_version}\"/g" \ + -e "s/GoogleMobileAdsMediationMyTarget\" version=\"5.40.0.0\"/${ios_pod_name}\" version=\"${ios_adapter_version}\"/g" \ + -e "s/com.google.ads.mediation:mytarget:5.45.3.0/${android_package_name}:${android_adapter_version}/g" \ + -e "s/value: 'MyTarget'/value: '${adapter_name}'/g" \ + -e "s/blueprint_file = ::Rapid::BlueprintFile(\"\/\/depot\/google3\/third_party\/unity\/gma_sdk_mediation\/MyTarget\/...\", \"MyTarget\")/blueprint_file = ::Rapid::BlueprintFile(\"\/\/depot\/google3\/third_party\/unity\/gma_sdk_mediation\/${adapter_name}\/...\", \"${adapter_name}\")/g" \ + -e "s/myTarget Adapter Integration Guide/${adapter_name} Adapter Integration Guide/g" \ + -e "s/mediation\/myTarget/mediation\/${adapter_name_lower_cased}/g" \ + -e "s/mytarget#mytarget-unity-mediation-plugin-changelog/${adapter_name_lower_cased}#${adapter_name_lower_cased}-unity-mediation-plugin-changelog/g" \ + -e "s/myTarget Unity Mediation Plugin Changelog/${adapter_name} Unity Mediation Plugin Changelog/g" \ + -e "s/MyTargetUnityAdapter-3.35.0.zip/${adapter_name}UnityAdapter-${version}.zip/g" \ + -e "s/Built and tested with the Google Mobile Ads Unity Plugin version 11.0.0./Built and tested with the Google Mobile Ads Unity Plugin version ${unity_version}./g" \ + -e "s/com.google.ads.mobile.mediation.mytarget/com.google.ads.mobile.mediation.${adapter_name_lower_cased}/g" \ + -e "s/Google Mobile Ads myTarget Mediation/Google Mobile Ads ${adapter_name} Mediation/g" \ + -e "s/vh-name:GoogleMobileAdsMediationMyTarget/vh-name:${ios_pod_name}/g" \ + -e "s/vh-name:Google Mobile Ads myTarget Mediation/vh-name:Google Mobile Ads ${adapter_name} Mediation/g" \ + -e "s/mediation plugin for myTarget package/mediation plugin for ${adapter_name} package/g" \ + -e "s/add myTarget mediation support/add ${adapter_name} mediation support/g" \ + -e "s/adapterName = 'MyTarget'/adapterName = '${adapter_name}'/g" \ + -e "s/BuildMyTargetUnity/Build${adapter_name}Unity/g" \ + -e "s/GADUMMyTarget/GADUM${adapter_name}/g" \ + -e "s//<${adapter_name}SDK\/${adapter_name}SDK.h>/g" \ + -e "s/MTRGPrivacy/${adapter_name}Privacy/g" \ + -e "s/GoogleMobileAds.Mediation.MyTarget/GoogleMobileAds.Mediation.${adapter_name}/g" \ + -e "s/com.google.unity.mediation.mytarget/com.google.unity.mediation.${adapter_name_lower_cased}/g" \ + {} + + +# Additional replacements for -with_extras +if [[ "$with_extras" == true ]]; then + echo "Replacing placeholders in Extras files..." + # Make files writable first + find "${new_adapter_dir}/source/android-library/" -type f -exec bash -c 'make_writable "$0"' {} \; + find "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/" -type f \( -name "*.cs" \) -exec bash -c 'make_writable "$0"' {} \; + find "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/" -type f \( -name "*.h" -o -name "*.m" \) -exec bash -c 'make_writable "$0"' {} \; + + # Perform sed replacements for extras + find "${new_adapter_dir}/source/android-library/" -type f -exec sed -i '' \ + -e "s/liftoffmonetize/${adapter_name_lower_cased}/g" \ + -e "s/LiftoffMonetize/${adapter_name}/g" \ + -e "s/Vungle/${adapter_name}/g" \ + -e "s/vungle/${adapter_name_lower_cased}/g" \ + -e "s/com.google.ads.mediation:vungle:7.7.2.0/${android_package_name}:${android_adapter_version}/g" \ + -e "s/GoogleMobileAdsMediationVungle\" version=\"7.7.1.0\"/${ios_pod_name}\" version=\"${ios_adapter_version}\"/g" \ + -e "s/VungleUnityExtrasBuilder/${adapter_name}UnityExtrasBuilder/g" \ + -e "s/VungleUnityInterstitialExtrasBuilder/${adapter_name}UnityInterstitialExtrasBuilder/g" \ + -e "s/VungleUnityRewardedVideoExtrasBuilder/${adapter_name}UnityRewardedVideoExtrasBuilder/g" \ + -e "s/VungleConstants/${adapter_name}Constants/g" \ + -e "s/VungleAdNetworkExtras/${adapter_name}AdNetworkExtras/g" \ + -e "s/VungleInterstitialAdapter/${adapter_name}InterstitialAdapter/g" \ + -e "s/VungleAdapter/${adapter_name}Adapter/g" \ + -e "s/com.google.unity.mediation.liftoffmonetize/com.google.unity.mediation.${adapter_name_lower_cased}/g" \ + -e "s/include 'liftoffmonetize'/include '${adapter_name_lower_cased}'/g" \ + -e "s/buildFile = 'source\/android-library\/liftoffmonetize\/build.gradle'/buildFile = 'source\/android-library\/${adapter_name_lower_cased}\/build.gradle'/g" \ + -e "s/from('source\/android-library\/liftoffmonetize\/build\/libs\/liftoffmonetize-unity-android-library.aar')/from('source\/android-library\/${adapter_name_lower_cased}\/build\/libs\/${adapter_name_lower_cased}-unity-android-library.aar')/g" \ + -e "s/into(\"\$\{pluginBuildDir\}\/Assets\/GoogleMobileAds\/Mediation\/LiftoffMonetize\/Plugins\/Android\/\")/into(\"\$\{pluginBuildDir\}\/Assets\/GoogleMobileAds\/Mediation\/${adapter_name}\/Plugins\/Android\/\")/g" \ + -e "s/#import /#import <${adapter_name}Adapter\/${adapter_name}AdNetworkExtras.h>/g" \ + -e "s/LiftoffMonetizeExtrasBuilder/${adapter_name}ExtrasBuilder/g" \ + -e "s/GADUMLiftoffMonetizeSetGDPRStatus/GADUM${adapter_name}SetGDPRStatus/g" \ + -e "s/GADUMLiftoffMonetizeSetGDPRMessageVersion/GADUM${adapter_name}SetGDPRMessageVersion/g" \ + -e "s/GADUMLiftoffMonetizeSetCCPAStatus/GADUM${adapter_name}SetCCPAStatus/g" \ + -e "s/com.vungle.ads.VunglePrivacySettings/com.${adapter_name_lower_cased}.ads.${adapter_name}PrivacySettings/g" \ + {} + + + # Sed for iOS extras C# and Objective-C + find "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/" -type f \( -name "*.cs" \) -exec sed -i '' \ + -e "s/LiftoffMonetize/${adapter_name}/g" \ + -e "s/liftoffmonetize/${adapter_name_lower_cased}/g" \ + -e "s/Vungle/${adapter_name}/g" \ + -e "s/vungle/${adapter_name_lower_cased}/g" \ + -e "s/com.google.unity.mediation.liftoffmonetize.VungleUnityInterstitialExtrasBuilder/com.google.unity.mediation.${adapter_name_lower_cased}.${adapter_name}UnityInterstitialExtrasBuilder/g" \ + -e "s/com.google.unity.mediation.liftoffmonetize.VungleUnityRewardedVideoExtrasBuilder/com.google.unity.mediation.${adapter_name_lower_cased}.${adapter_name}UnityRewardedVideoExtrasBuilder/g" \ + -e "s/LiftoffMonetizeExtrasBuilder/${adapter_name}ExtrasBuilder/g" \ + {} + + + find "${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/" -type f \( -name "*.h" -o -name "*.m" \) -exec sed -i '' \ + -e "s/LiftoffMonetize/${adapter_name}/g" \ + -e "s/liftoffmonetize/${adapter_name_lower_cased}/g" \ + -e "s/Vungle/${adapter_name}/g" \ + -e "s/vungle/${adapter_name_lower_cased}/g" \ + -e "s/#import /#import <${adapter_name}Adapter\/${adapter_name}AdNetworkExtras.h>/g" \ + -e "s/VungleAdNetworkExtras/${adapter_name}AdNetworkExtras/g" \ + -e "s/LiftoffMonetizeExtrasBuilder/${adapter_name}ExtrasBuilder/g" \ + {} + +fi + +echo "Done! New adapter structure created at ${new_adapter_dir}" +echo "" +echo "--- Manual Steps Required ---" +echo "The script has automated most of the boilerplate. However, some manual adjustments are still needed:" +echo "" +echo "1. **${new_adapter_dir}/CHANGELOG.md:**" +echo " - Update the descriptions for the initial release." +echo " - Verify the Android and iOS adapter versions are correct." +echo " - **CRITICAL:** Update the GitHub links to the *actual* Android and iOS adapter CHANGELOGs for ${adapter_name}." +echo "" +echo "2. **${new_adapter_dir}/package.json:**" +echo " - Verify the 'displayName' and 'description'. The description is currently generic." +echo "" +echo "3. **${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Editor/${adapter_name}MediationDependencies.xml:**" +echo " - **CRITICAL:** Update the \`androidPackage\` and \`iosPod\` \`spec\` and \`version\` attributes to match the actual dependencies for the ${adapter_name} SDK." +echo " - Add any necessary repositories for Android packages. The template includes common ones, but network-specific ones might be needed." +echo " - Add any additional \`iosPod\` entries if required (e.g., for the core SDK, like 'OpenWrapSDK' in PubMatic)." +echo "" +echo "4. **C# Implementation Files:**" +echo " - **${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Common/I${adapter_name}Client.cs:** Define the interface methods that your Unity plugin will expose to interact with the native ${adapter_name} SDKs." +echo " - **${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/Android/${adapter_name}Client.cs:** Implement the \`I${adapter_name}Client\` interface for Android. **CRITICAL:** Update AndroidJavaClass names (e.g., \`com.my.target.common.MyTargetPrivacy\`) to the correct ${adapter_name} SDK classes and method calls." +echo " - **${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/iOS/${adapter_name}Client.cs:** Implement the \`I${adapter_name}Client\` interface for iOS, using \`Externs\`. Update method calls to match your native iOS implementation." +echo " - **${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Platforms/iOS/Externs.cs:** Declare the \`[DllImport(\"__Internal\")]\` methods. Update method names (e.g., \`GADUMMyTargetSetUserConsent\` to \`GADUM${adapter_name}SetUserConsent\`)." +echo " - **${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}.cs:** Implement the public API, calling the \`client\` methods." +echo "" +echo "5. **Native Platform Files:**" +echo " - **iOS:** Create Objective-C (\`.m\`) or Swift (\`.swift\`) files in \`${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/\` to implement the native calls declared in \`Externs.cs\`. **CRITICAL:** Update imports (e.g., \`\` to \`<${adapter_name}SDK/${adapter_name}SDK.h>\`) and native SDK calls. See '${adapter_root_dir}/IronSource/source/plugin/Assets/GoogleMobileAds/Mediation/IronSource/Plugins/iOS/GADUMIronSourceInterface.m' for an example." +echo " - **Android:** Place any required Android AAR libraries in \`${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/Android/\`. If using \`-with_extras\`, review and update the Gradle project under \`${new_adapter_dir}/source/android-library/\`." +echo "" +if [[ "$with_extras" == true ]]; then + echo "6. **Mediation Extras Files:**" + echo " - **${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Api/${adapter_name}MediationExtras.cs:** Define the C# extras class. Update keys and the \`IOSMediationExtraBuilderClassName\`." + echo " - **${new_adapter_dir}/source/android-library/${adapter_name_lower_cased}/src/main/java/com/google/unity/mediation/${adapter_name_lower_cased}/${adapter_name}UnityExtrasBuilder.java:** Implement the Android extras builder. **CRITICAL:** Update keys and how the bundle is built, referencing the correct native Android adapter classes (e.g., \`com.google.ads.mediation.${adapter_name_lower_cased}.${adapter_name}Extras\`)." + echo " - **${new_adapter_dir}/source/plugin/Assets/GoogleMobileAds/Mediation/${adapter_name}/Plugins/iOS/${adapter_name}ExtrasBuilder.h/m:** Implement the iOS extras builder. **CRITICAL:** Update keys and how \`GADAdNetworkExtras\` is created, referencing the correct native iOS adapter classes (e.g., \`<${adapter_name}Adapter/${adapter_name}AdNetworkExtras.h>\`)." +fi +echo "" +echo "7. **.meta Files:** While copied, Unity might regenerate GUIDs. Check if any assets fail to link in Unity and update GUIDs in the \`.meta\` files if necessary." +echo ""