diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c0a2c83c9..08a0073a1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,7 +20,6 @@ jobs: fail-fast: false matrix: regex: - - "samples/admob/adaptive_banner_example" - "samples/admob/app_open_example" - "samples/admob/banner_example" - "samples/admob/interstitial_example" @@ -30,7 +29,7 @@ jobs: - "samples/admob/rewarded_example" - "samples/admob/rewarded_interstitial_example" steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" @@ -52,7 +51,6 @@ jobs: fail-fast: false matrix: regex: - - "samples/admob/adaptive_banner_example" - "samples/admob/app_open_example" - "samples/admob/banner_example" - "samples/admob/interstitial_example" @@ -62,7 +60,7 @@ jobs: - "samples/admob/rewarded_example" - "samples/admob/rewarded_interstitial_example" steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" @@ -85,7 +83,6 @@ jobs: fail-fast: false matrix: regex: - - "samples/admob/adaptive_banner_example" - "samples/admob/app_open_example" - "samples/admob/banner_example" - "samples/admob/interstitial_example" @@ -95,7 +92,7 @@ jobs: - "samples/admob/rewarded_example" - "samples/admob/rewarded_interstitial_example" steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" diff --git a/.github/workflows/gma_mediation_applovin.yaml b/.github/workflows/gma_mediation_applovin.yaml index 029af8cd4..c0f4cd118 100644 --- a/.github/workflows/gma_mediation_applovin.yaml +++ b/.github/workflows/gma_mediation_applovin.yaml @@ -31,7 +31,7 @@ jobs: if: github.event_name == 'pull_request' timeout-minutes: 30 steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - uses: actions/setup-java@v4 @@ -56,7 +56,7 @@ jobs: - uses: swift-actions/setup-swift@v2 with: swift-version: "5.7.2" - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" @@ -71,7 +71,7 @@ jobs: flutter pub get flutter precache --ios pod install - xcodebuild -configuration Debug -resultBundlePath TestResults VERBOSE_SCRIPT_LOGGING=YES -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=16.2' test + xcodebuild -configuration Debug -resultBundlePath TestResults VERBOSE_SCRIPT_LOGGING=YES -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5' test - uses: actions/upload-artifact@v4 if: failure() with: @@ -82,7 +82,7 @@ jobs: if: github.event_name == 'pull_request' timeout-minutes: 30 steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" diff --git a/.github/workflows/gma_mediation_dtexchange.yaml b/.github/workflows/gma_mediation_dtexchange.yaml index d5c5818d2..a86cb9eea 100644 --- a/.github/workflows/gma_mediation_dtexchange.yaml +++ b/.github/workflows/gma_mediation_dtexchange.yaml @@ -31,7 +31,7 @@ jobs: if: github.event_name == 'pull_request' timeout-minutes: 30 steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" diff --git a/.github/workflows/gma_mediation_inmobi.yaml b/.github/workflows/gma_mediation_inmobi.yaml index abf4a7d09..004f35100 100644 --- a/.github/workflows/gma_mediation_inmobi.yaml +++ b/.github/workflows/gma_mediation_inmobi.yaml @@ -31,7 +31,7 @@ jobs: if: github.event_name == 'pull_request' timeout-minutes: 30 steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" diff --git a/.github/workflows/gma_mediation_ironsource.yaml b/.github/workflows/gma_mediation_ironsource.yaml index b5dfc8c75..d639b0251 100644 --- a/.github/workflows/gma_mediation_ironsource.yaml +++ b/.github/workflows/gma_mediation_ironsource.yaml @@ -31,7 +31,7 @@ jobs: if: github.event_name == 'pull_request' timeout-minutes: 30 steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" diff --git a/.github/workflows/gma_mediation_liftoffmonetize.yaml b/.github/workflows/gma_mediation_liftoffmonetize.yaml new file mode 100644 index 000000000..a3c5932d5 --- /dev/null +++ b/.github/workflows/gma_mediation_liftoffmonetize.yaml @@ -0,0 +1,105 @@ +# Copyright 2024 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 +# +# https://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. + +name: gma_mediation_liftoffmonetize + +on: + pull_request: + paths: + - "packages/mediation/gma_mediation_liftoffmonetize/**" + - ".github/workflows/gma_mediation_liftoffmonetize.yaml" + - "packages/mediation/gma_mediation_liftoffmonetize/ios/**" + - "packages/mediation/gma_mediation_liftoffmonetize/android/**" + push: + branches: + - master + +jobs: + android: + runs-on: macos-latest + if: github.event_name == 'pull_request' + timeout-minutes: 30 + steps: + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b + with: + fetch-depth: 0 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: "Install Flutter" + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: "Install Tools" + run: ./.github/workflows/scripts/install-tools.sh + - name: "Build Example" + run: ./.github/workflows/scripts/build-example.sh android ./lib/main.dart packages/mediation/gma_mediation_liftoffmonetize/example + - name: "Unit Tests" + run: | + cd packages/mediation/gma_mediation_liftoffmonetize/example/android + ./gradlew :gma_mediation_liftoffmonetize:testDebugUnitTest + + iOS: + runs-on: macos-latest + timeout-minutes: 40 + steps: + - uses: swift-actions/setup-swift@v1 + with: + swift-version: "5.7.2" + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b + with: + fetch-depth: 0 + - name: "Install Flutter" + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: "Install Tools" + run: | + ./.github/workflows/scripts/install-tools.sh + - name: "Unit Tests" + run: | + cd packages/mediation/gma_mediation_liftoffmonetize/example/ios + flutter clean + flutter pub get + flutter precache --ios + pod install + xcodebuild -configuration Debug -resultBundlePath TestResults VERBOSE_SCRIPT_LOGGING=YES -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5' test + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: iOSTestResults + path: packages/mediation/gma_mediation_liftoffmonetize/example/ios/TestResults.xcresult + + flutter: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + timeout-minutes: 30 + steps: + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b + with: + fetch-depth: 0 + - name: "Install Flutter" + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: "Install Tools" + run: ./.github/workflows/scripts/install-tools.sh + - name: "Flutter Analyze" + run: | + cd packages/mediation/gma_mediation_liftoffmonetize + flutter analyze + - name: "Flutter Publish" + run: | + cd packages/mediation/gma_mediation_liftoffmonetize + flutter pub publish --dry-run + - name: "Flutter Format" + run: | + flutter pub global activate flutter_plugin_tools + flutter pub global run flutter_plugin_tools format + ./.github/workflows/scripts/validate-formatting.sh diff --git a/.github/workflows/gma_mediation_meta.yaml b/.github/workflows/gma_mediation_meta.yaml index 21296057b..9bf985959 100644 --- a/.github/workflows/gma_mediation_meta.yaml +++ b/.github/workflows/gma_mediation_meta.yaml @@ -31,7 +31,7 @@ jobs: if: github.event_name == 'pull_request' timeout-minutes: 30 steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" diff --git a/.github/workflows/gma_mediation_mintegral.yaml b/.github/workflows/gma_mediation_mintegral.yaml new file mode 100644 index 000000000..e4742ab22 --- /dev/null +++ b/.github/workflows/gma_mediation_mintegral.yaml @@ -0,0 +1,53 @@ +# Copyright 2024 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 +# +# https://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. + +name: gma_mediation_mintegral + +on: + pull_request: + paths: + - "packages/mediation/gma_mediation_mintegral/**" + - ".github/workflows/gma_mediation_mintegral.yaml" + - "packages/mediation/gma_mediation_mintegral/ios/**" + - "packages/mediation/gma_mediation_mintegral/android/**" + push: + branches: + - main + +jobs: + flutter: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + timeout-minutes: 30 + steps: + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b + with: + fetch-depth: 0 + - name: "Install Flutter" + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: "Install Tools" + run: ./.github/workflows/scripts/install-tools.sh + - name: "Flutter Analyze" + run: | + cd packages/mediation/gma_mediation_mintegral + flutter analyze + - name: "Flutter Publish" + run: | + cd packages/mediation/gma_mediation_mintegral + flutter pub publish --dry-run + - name: "Flutter Format" + run: | + flutter pub global activate flutter_plugin_tools + flutter pub global run flutter_plugin_tools format + ./.github/workflows/scripts/validate-formatting.sh diff --git a/.github/workflows/gma_mediation_pangle.yaml b/.github/workflows/gma_mediation_pangle.yaml index 7be167ad2..a687124b0 100644 --- a/.github/workflows/gma_mediation_pangle.yaml +++ b/.github/workflows/gma_mediation_pangle.yaml @@ -31,7 +31,7 @@ jobs: if: github.event_name == 'pull_request' timeout-minutes: 30 steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" diff --git a/.github/workflows/gma_mediation_unity.yaml b/.github/workflows/gma_mediation_unity.yaml new file mode 100644 index 000000000..050c69a94 --- /dev/null +++ b/.github/workflows/gma_mediation_unity.yaml @@ -0,0 +1,102 @@ +# Copyright 2024 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 +# +# https://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. + +name: gma_mediation_unity + +on: + pull_request: + paths: + - "packages/mediation/gma_mediation_unity/**" + - ".github/workflows/gma_mediation_unity.yaml" + - "packages/mediation/gma_mediation_unity/ios/**" + - "packages/mediation/gma_mediation_unity/android/**" + push: + branches: + - main + +jobs: + android: + runs-on: macos-latest + if: github.event_name == 'pull_request' + timeout-minutes: 30 + steps: + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + with: + fetch-depth: 0 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: "Install Flutter" + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: "Install Tools" + run: ./.github/workflows/scripts/install-tools.sh + - name: "Build Example" + run: ./.github/workflows/scripts/build-example.sh android ./lib/main.dart packages/mediation/gma_mediation_unity/example + - name: "Unit Tests" + run: | + cd packages/mediation/gma_mediation_unity/example/android + ./gradlew :gma_mediation_unity:testDebugUnitTest + + iOS: + runs-on: macos-latest + timeout-minutes: 40 + steps: + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + with: + fetch-depth: 0 + - name: "Install Flutter" + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: "Install Tools" + run: | + ./.github/workflows/scripts/install-tools.sh + - name: "Unit Tests" + run: | + cd packages/mediation/gma_mediation_unity/example/ios + flutter clean + flutter pub get + flutter precache --ios + pod install + xcodebuild -configuration Debug -resultBundlePath TestResults VERBOSE_SCRIPT_LOGGING=YES -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5' test + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: iOSTestResults + path: packages/mediation/gma_mediation_unity/example/ios/TestResults.xcresult + + flutter: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + timeout-minutes: 30 + steps: + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + with: + fetch-depth: 0 + - name: "Install Flutter" + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: "Install Tools" + run: ./.github/workflows/scripts/install-tools.sh + - name: "Flutter Analyze" + run: | + cd packages/mediation/gma_mediation_unity/ + flutter analyze + - name: "Flutter Publish" + run: | + cd packages/mediation/gma_mediation_unity/ + flutter pub publish --dry-run + - name: "Flutter Format" + run: | + flutter pub global activate flutter_plugin_tools + flutter pub global run flutter_plugin_tools format + ./.github/workflows/scripts/validate-formatting.sh diff --git a/.github/workflows/google_mobile_ads.yaml b/.github/workflows/google_mobile_ads.yaml index 3d5f5d1a0..cd4e830a9 100644 --- a/.github/workflows/google_mobile_ads.yaml +++ b/.github/workflows/google_mobile_ads.yaml @@ -34,7 +34,7 @@ jobs: if: github.event_name == 'pull_request' timeout-minutes: 30 steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - uses: actions/setup-java@v4 @@ -56,7 +56,7 @@ jobs: runs-on: macos-latest timeout-minutes: 40 steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" @@ -83,7 +83,7 @@ jobs: if: github.event_name == 'pull_request' timeout-minutes: 30 steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - name: "Install Flutter" diff --git a/analysis_options.yaml b/analysis_options.yaml index 8cd5f4207..cfcc42c35 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -21,6 +21,7 @@ analyzer: packages/mediation/gma_mediation_inmobi/** packages/mediation/gma_mediation_ironsource/** packages/mediation/gma_mediation_meta/** + packages/mediation/gma_mediation_unity/** ] errors: omit_local_variable_types: ignore diff --git a/packages/google_mobile_ads/CHANGELOG.md b/packages/google_mobile_ads/CHANGELOG.md index e4c934d40..595226acf 100644 --- a/packages/google_mobile_ads/CHANGELOG.md +++ b/packages/google_mobile_ads/CHANGELOG.md @@ -1,4 +1,4 @@ -## Next Version +## 5.1.0 * Adds support for APIs from the [Android](https://developers.google.com/admob/android/privacy/release-notes) UMP SDK version 2.2.0. * Adds support for APIs from the [iOS](https://developers.google.com/admob/ios/privacy/download#release_notes) UMP SDK version 2.4.0. diff --git a/packages/google_mobile_ads/README.md b/packages/google_mobile_ads/README.md index 922f5a4e5..622eb3c9e 100644 --- a/packages/google_mobile_ads/README.md +++ b/packages/google_mobile_ads/README.md @@ -30,4 +30,4 @@ use [github's issue tracker](https://github.com/googleads/googleads-mobile-flutt ## License -[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html) \ No newline at end of file +[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) \ No newline at end of file diff --git a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/AdMessageCodec.java b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/AdMessageCodec.java index 1ea1eaa3b..91dd267cc 100644 --- a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/AdMessageCodec.java +++ b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/AdMessageCodec.java @@ -41,7 +41,6 @@ * Encodes and decodes values by reading from a ByteBuffer and writing to a ByteArrayOutputStream. */ class AdMessageCodec extends StandardMessageCodec { - // The type values below must be consistent for each platform. private static final byte VALUE_AD_SIZE = (byte) 128; private static final byte VALUE_AD_REQUEST = (byte) 129; @@ -71,7 +70,11 @@ class AdMessageCodec extends StandardMessageCodec { @NonNull Context context; @NonNull final FlutterAdSize.AdSizeFactory adSizeFactory; - @Nullable private MediationNetworkExtrasProvider mediationNetworkExtrasProvider; + + @SuppressWarnings("deprecation") + @Nullable + private MediationNetworkExtrasProvider mediationNetworkExtrasProvider; + @NonNull private final FlutterRequestAgentProvider requestAgentProvider; AdMessageCodec( @@ -95,6 +98,7 @@ void setContext(@NonNull Context context) { this.context = context; } + @SuppressWarnings("deprecation") void setMediationNetworkExtrasProvider( @Nullable MediationNetworkExtrasProvider mediationNetworkExtrasProvider) { this.mediationNetworkExtrasProvider = mediationNetworkExtrasProvider; diff --git a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/Constants.java b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/Constants.java index 49932fe77..77158a8d7 100644 --- a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/Constants.java +++ b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/Constants.java @@ -17,7 +17,7 @@ /** Constants used in the plugin. */ public class Constants { /** Version request agent. Should be bumped alongside plugin versions. */ - public static final String REQUEST_AGENT_PREFIX_VERSIONED = "Flutter-GMA-5.0.0"; + public static final String REQUEST_AGENT_PREFIX_VERSIONED = "Flutter-GMA-5.1.0"; /** Prefix for news template */ public static final String REQUEST_AGENT_NEWS_TEMPLATE_PREFIX = "News"; diff --git a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAdManagerAdRequest.java b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAdManagerAdRequest.java index 8d055bb38..68c86b63a 100644 --- a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAdManagerAdRequest.java +++ b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAdManagerAdRequest.java @@ -76,6 +76,7 @@ FlutterAdManagerAdRequest build() { } } + @SuppressWarnings("deprecation") private FlutterAdManagerAdRequest( @Nullable List keywords, @Nullable String contentUrl, diff --git a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAdRequest.java b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAdRequest.java index 9f6186949..53ee98f91 100644 --- a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAdRequest.java +++ b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAdRequest.java @@ -36,7 +36,11 @@ class FlutterAdRequest { @Nullable private final List neighboringContentUrls; @Nullable private final Integer httpTimeoutMillis; @Nullable private final String mediationExtrasIdentifier; - @Nullable private final MediationNetworkExtrasProvider mediationNetworkExtrasProvider; + + @SuppressWarnings("deprecation") + @Nullable + private final MediationNetworkExtrasProvider mediationNetworkExtrasProvider; + @Nullable private final Map adMobExtras; @NonNull private final String requestAgent; @Nullable private final List mediationExtras; @@ -48,7 +52,11 @@ protected static class Builder { @Nullable private List neighboringContentUrls; @Nullable private Integer httpTimeoutMillis; @Nullable private String mediationExtrasIdentifier; - @Nullable private MediationNetworkExtrasProvider mediationNetworkExtrasProvider; + + @SuppressWarnings("deprecation") + @Nullable + private MediationNetworkExtrasProvider mediationNetworkExtrasProvider; + @Nullable private Map adMobExtras; @NonNull private String requestAgent; @@ -97,6 +105,7 @@ Builder setMediationNetworkExtrasIdentifier(@Nullable String mediationExtrasIden } @CanIgnoreReturnValue + @SuppressWarnings("deprecation") Builder setMediationNetworkExtrasProvider( @Nullable MediationNetworkExtrasProvider mediationNetworkExtrasProvider) { this.mediationNetworkExtrasProvider = mediationNetworkExtrasProvider; @@ -145,6 +154,7 @@ protected String getMediationExtrasIdentifier() { return mediationExtrasIdentifier; } + @SuppressWarnings("deprecation") @Nullable protected MediationNetworkExtrasProvider getMediationNetworkExtrasProvider() { return mediationNetworkExtrasProvider; @@ -180,6 +190,7 @@ FlutterAdRequest build() { } } + @SuppressWarnings("deprecation") protected FlutterAdRequest( @Nullable List keywords, @Nullable String contentUrl, diff --git a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/GoogleMobileAdsPlugin.java b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/GoogleMobileAdsPlugin.java index e9d4b3444..89cc8b589 100644 --- a/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/GoogleMobileAdsPlugin.java +++ b/packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/GoogleMobileAdsPlugin.java @@ -68,7 +68,11 @@ private static T requireNonNull(T obj) { @Nullable private AppStateNotifier appStateNotifier; @Nullable private UserMessagingPlatformManager userMessagingPlatformManager; private final Map nativeAdFactories = new HashMap<>(); - @Nullable private MediationNetworkExtrasProvider mediationNetworkExtrasProvider; + + @SuppressWarnings("deprecation") + @Nullable + private MediationNetworkExtrasProvider mediationNetworkExtrasProvider; + private final FlutterMobileAdsWrapper flutterMobileAds; /** * Public constructor for the plugin. Dependency initialization is handled in lifecycle methods diff --git a/packages/google_mobile_ads/ios/Classes/FLTConstants.h b/packages/google_mobile_ads/ios/Classes/FLTConstants.h index 5c61871a6..34c8eb678 100644 --- a/packages/google_mobile_ads/ios/Classes/FLTConstants.h +++ b/packages/google_mobile_ads/ios/Classes/FLTConstants.h @@ -13,4 +13,4 @@ // limitations under the License. /** Versioned request agent string. */ -#define FLT_REQUEST_AGENT_VERSIONED @"Flutter-GMA-5.0.0" +#define FLT_REQUEST_AGENT_VERSIONED @"Flutter-GMA-5.1.0" diff --git a/packages/google_mobile_ads/ios/google_mobile_ads.podspec b/packages/google_mobile_ads/ios/google_mobile_ads.podspec index 91f42e5aa..9d565afc6 100644 --- a/packages/google_mobile_ads/ios/google_mobile_ads.podspec +++ b/packages/google_mobile_ads/ios/google_mobile_ads.podspec @@ -3,7 +3,7 @@ # Pod::Spec.new do |s| s.name = 'google_mobile_ads' - s.version = '1.0.0' + s.version = '5.1.0' s.summary = 'Google Mobile Ads plugin for Flutter.' s.description = <<-DESC Google Mobile Ads plugin for Flutter. diff --git a/packages/google_mobile_ads/lib/src/ad_containers.dart b/packages/google_mobile_ads/lib/src/ad_containers.dart index 80d679c15..83a038b7f 100644 --- a/packages/google_mobile_ads/lib/src/ad_containers.dart +++ b/packages/google_mobile_ads/lib/src/ad_containers.dart @@ -198,7 +198,8 @@ class AdRequest { this.neighboringContentUrls, this.nonPersonalizedAds, this.httpTimeoutMillis, - @deprecated this.mediationExtrasIdentifier, + @Deprecated('Use mediationExtras instead.') + this.mediationExtrasIdentifier, this.extras, this.mediationExtras}); @@ -230,7 +231,7 @@ class AdRequest { /// to the ad request. This identifier will get passed to your platform-side /// mediation extras factory class, allowing for additional customization /// of network extras. - @deprecated + @Deprecated('Use mediationExtras instead.') final String? mediationExtrasIdentifier; /// Extras to pass to the AdMob adapter. @@ -252,6 +253,18 @@ class AdRequest { mapEquals(extras, other.extras) && mediationExtras == other.mediationExtras; } + + @override + int get hashCode => Object.hash( + keywords, + contentUrl, + nonPersonalizedAds, + neighboringContentUrls, + httpTimeoutMillis, + //ignore: deprecated_member_use_from_same_package + mediationExtrasIdentifier, + extras, + mediationExtras); } /// Targeting info per the Ad Manager API. @@ -303,6 +316,10 @@ class AdManagerAdRequest extends AdRequest { other.customTargetingLists.toString() && publisherProvidedId == other.publisherProvidedId; } + + @override + int get hashCode => + Object.hash(customTargeting, customTargetingLists, publisherProvidedId); } /// An [AdSize] with the given width and a Google-optimized height to create a banner ad. @@ -554,6 +571,9 @@ class AdSize { bool operator ==(Object other) { return other is AdSize && width == other.width && height == other.height; } + + @override + int get hashCode => Object.hash(width, height); } /// The base class for all ads. @@ -1353,6 +1373,9 @@ class ServerSideVerificationOptions { userId == other.userId && customData == other.customData; } + + @override + int get hashCode => Object.hash(userId, customData); } /// A full-screen app open ad for the Google Mobile Ads Plugin. @@ -1505,6 +1528,15 @@ class NativeAdOptions { shouldRequestMultipleImages == other.shouldRequestMultipleImages && shouldReturnUrlsForImageAssets == other.shouldReturnUrlsForImageAssets; } + + @override + int get hashCode => Object.hash( + adChoicesPlacement, + mediaAspectRatio, + videoOptions, + requestCustomMuteThisAd, + shouldRequestMultipleImages, + shouldReturnUrlsForImageAssets); } /// Options for controlling video playback in supported ad formats. @@ -1539,4 +1571,8 @@ class VideoOptions { customControlsRequested == other.customControlsRequested && startMuted == other.startMuted; } + + @override + int get hashCode => + Object.hash(clickToExpandRequested, customControlsRequested, startMuted); } diff --git a/packages/google_mobile_ads/lib/src/ad_instance_manager.dart b/packages/google_mobile_ads/lib/src/ad_instance_manager.dart index 3bb29bcb6..9b93ad3e6 100644 --- a/packages/google_mobile_ads/lib/src/ad_instance_manager.dart +++ b/packages/google_mobile_ads/lib/src/ad_instance_manager.dart @@ -1270,7 +1270,7 @@ class AdMessageCodec extends StandardMessageCodec { writeValue(buffer, value.orientationValue); } else if (value is AnchoredAdaptiveBannerAdSize) { buffer.putUint8(_valueAnchoredAdaptiveBannerAdSize); - var orientationValue; + String? orientationValue; if (value.orientation != null) { orientationValue = (value.orientation as Orientation).name; } diff --git a/packages/google_mobile_ads/lib/src/ump/consent_form_impl.dart b/packages/google_mobile_ads/lib/src/ump/consent_form_impl.dart index 45dff718d..8ad486f75 100644 --- a/packages/google_mobile_ads/lib/src/ump/consent_form_impl.dart +++ b/packages/google_mobile_ads/lib/src/ump/consent_form_impl.dart @@ -37,4 +37,7 @@ class ConsentFormImpl extends ConsentForm { bool operator ==(Object other) { return other is ConsentFormImpl && platformHash == other.platformHash; } + + @override + int get hashCode => platformHash.hashCode; } diff --git a/packages/google_mobile_ads/lib/src/ump/consent_request_parameters.dart b/packages/google_mobile_ads/lib/src/ump/consent_request_parameters.dart index 91f5f346e..7873c0abc 100644 --- a/packages/google_mobile_ads/lib/src/ump/consent_request_parameters.dart +++ b/packages/google_mobile_ads/lib/src/ump/consent_request_parameters.dart @@ -34,6 +34,10 @@ class ConsentRequestParameters { tagForUnderAgeOfConsent == other.tagForUnderAgeOfConsent && consentDebugSettings == other.consentDebugSettings; } + + @override + int get hashCode => + Object.hash(tagForUnderAgeOfConsent, consentDebugSettings); } /// Debug settings to hardcode in test requests. @@ -55,6 +59,9 @@ class ConsentDebugSettings { debugGeography == other.debugGeography && listEquals(testIdentifiers, other.testIdentifiers); } + + @override + int get hashCode => Object.hash(debugGeography, testIdentifiers); } /// Debug values for testing geography. diff --git a/packages/google_mobile_ads/lib/src/ump/form_error.dart b/packages/google_mobile_ads/lib/src/ump/form_error.dart index 911e5fb58..7ff1c006d 100644 --- a/packages/google_mobile_ads/lib/src/ump/form_error.dart +++ b/packages/google_mobile_ads/lib/src/ump/form_error.dart @@ -37,4 +37,7 @@ class FormError { errorCode == other.errorCode && message == other.message; } + + @override + int get hashCode => Object.hash(errorCode, message); } diff --git a/packages/google_mobile_ads/pubspec.yaml b/packages/google_mobile_ads/pubspec.yaml index 86114d22f..9d8c891e4 100644 --- a/packages/google_mobile_ads/pubspec.yaml +++ b/packages/google_mobile_ads/pubspec.yaml @@ -13,7 +13,7 @@ # limitations under the License. name: google_mobile_ads -version: 5.0.0 +version: 5.1.0 description: Flutter plugin for Google Mobile Ads, supporting banner, interstitial (full-screen), rewarded and native ads repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/google_mobile_ads diff --git a/packages/mediation/gma_mediation_applovin/CHANGELOG.md b/packages/mediation/gma_mediation_applovin/CHANGELOG.md index 2e6bdf416..93d25621a 100644 --- a/packages/mediation/gma_mediation_applovin/CHANGELOG.md +++ b/packages/mediation/gma_mediation_applovin/CHANGELOG.md @@ -1,5 +1,13 @@ -## 1.0.0 +## AppLovin Flutter Mediation Adapter Changelog +#### 1.1.0 +* API for the GmaMediationApplovin is no longer static. +* Verified compatibility with AppLovin Android adapter version 12.4.3.0. +* Verified compatibility with AppLovin iOS adapter version 12.4.2.0. +* Built and tested with the Google Mobile Ads Flutter Plugin version 5.1.0. + +#### 1.0.0 * Initial release. * Verified compatibility with AppLovin Android adapter version 12.3.0.0 * Verified compatibility with AppLovin iOS adapter version 12.2.1.0 +* Built and tested with the Google Mobile Ads Flutter Plugin version 5.0.0. \ No newline at end of file diff --git a/packages/mediation/gma_mediation_applovin/LICENSE b/packages/mediation/gma_mediation_applovin/LICENSE index d64569567..e58143fcc 100644 --- a/packages/mediation/gma_mediation_applovin/LICENSE +++ b/packages/mediation/gma_mediation_applovin/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2024 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/mediation/gma_mediation_applovin/README.md b/packages/mediation/gma_mediation_applovin/README.md index 5b8b05522..369e7c757 100644 --- a/packages/mediation/gma_mediation_applovin/README.md +++ b/packages/mediation/gma_mediation_applovin/README.md @@ -33,4 +33,4 @@ use [github's issue tracker](https://github.com/googleads/googleads-mobile-flutt ## License -[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html) \ No newline at end of file +[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) \ No newline at end of file diff --git a/packages/mediation/gma_mediation_applovin/analysis_options.yaml b/packages/mediation/gma_mediation_applovin/analysis_options.yaml index fc32e0754..b52daef95 100644 --- a/packages/mediation/gma_mediation_applovin/analysis_options.yaml +++ b/packages/mediation/gma_mediation_applovin/analysis_options.yaml @@ -12,4 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -package:pedantic/analysis_options.1.11.0.yaml +include: package:lint/package.yaml + +analyzer: + exclude: + - '**.g.dart' diff --git a/packages/mediation/gma_mediation_applovin/android/build.gradle b/packages/mediation/gma_mediation_applovin/android/build.gradle index 6e866bd92..a0279a2d7 100644 --- a/packages/mediation/gma_mediation_applovin/android/build.gradle +++ b/packages/mediation/gma_mediation_applovin/android/build.gradle @@ -50,8 +50,8 @@ android { } dependencies { - implementation 'com.applovin:applovin-sdk:12.3.0' - implementation 'com.google.ads.mediation:applovin:12.3.0.0' + implementation 'com.applovin:applovin-sdk:12.4.3' + implementation 'com.google.ads.mediation:applovin:12.4.3.0' implementation 'com.google.android.gms:play-services-ads:23.0.0' implementation 'androidx.core:core-ktx:1.8.0' testImplementation 'junit:junit:4.13.2' diff --git a/packages/mediation/gma_mediation_applovin/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinFlutterMediationExtras.kt b/packages/mediation/gma_mediation_applovin/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinFlutterMediationExtras.kt index 81ebde581..13da718d1 100644 --- a/packages/mediation/gma_mediation_applovin/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinFlutterMediationExtras.kt +++ b/packages/mediation/gma_mediation_applovin/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinFlutterMediationExtras.kt @@ -1,3 +1,17 @@ +// Copyright 2024 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 +// +// https://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. + package io.flutter.plugins.googlemobileads.mediation.gma_mediation_applovin import android.os.Bundle diff --git a/packages/mediation/gma_mediation_applovin/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinSDKApi.g.kt b/packages/mediation/gma_mediation_applovin/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinSDKApi.g.kt index 6c7e14cc4..2cfb75971 100644 --- a/packages/mediation/gma_mediation_applovin/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinSDKApi.g.kt +++ b/packages/mediation/gma_mediation_applovin/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinSDKApi.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v17.1.2), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.googlemobileads.mediation.gma_mediation_applovin @@ -42,11 +42,19 @@ class FlutterError ( override val message: String? = null, val details: Any? = null ) : Throwable() -/** Generated interface from Pigeon that represents a handler of messages from Flutter. */ +/** + * The generated classes set the channels to call the methods in the corresponding kotlin AppLovinSDKApi interface and swift AppLovinSDKApi protocol from the dart layer. + * + * Generated interface from Pigeon that represents a handler of messages from Flutter. + */ interface AppLovinSDKApi { + /** Used to configure GDPR consent on the Android or iOS AppLovin SDK */ fun setHasUserConsent(hasUserConsent: Boolean) + /** Used to acknowledge that the user is in an age-restricted category on the Android or iOS AppLovin SDK */ fun setIsAgeRestrictedUser(isAgeRestrictedUser: Boolean) + /** Used to opt out of the sale of personal information in AppLovin SDK. */ fun setDoNotSell(doNotSell: Boolean) + /** Used to initialize the Android or iOS AppLovin SDK. Can be called anytime before the adapter initialization to let AppLovin track events as soon as possible. */ fun initializeSdk(sdkKey: String) companion object { diff --git a/packages/mediation/gma_mediation_applovin/example/README.md b/packages/mediation/gma_mediation_applovin/example/README.md index bed4ca573..960340425 100644 --- a/packages/mediation/gma_mediation_applovin/example/README.md +++ b/packages/mediation/gma_mediation_applovin/example/README.md @@ -1,6 +1,7 @@ # gma_mediation_applovin_example -Demonstrates how to use the gma_mediation_applovin plugin. +Learn how to integrate with your app that uses the [google_mobile_ads](https://pub.dev/packages/google_mobile_ads) plugin +by following the [development guide](https://developers.google.com/admob/flutter/mediation/applovin). ## Getting Started diff --git a/packages/mediation/gma_mediation_applovin/ios/Classes/AppLovinFlutterMediationExtras.swift b/packages/mediation/gma_mediation_applovin/ios/Classes/AppLovinFlutterMediationExtras.swift index 081e8eb2f..8ba4be5f3 100644 --- a/packages/mediation/gma_mediation_applovin/ios/Classes/AppLovinFlutterMediationExtras.swift +++ b/packages/mediation/gma_mediation_applovin/ios/Classes/AppLovinFlutterMediationExtras.swift @@ -1,3 +1,17 @@ +// Copyright 2024 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 +// +// https://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 Foundation import AppLovinAdapter diff --git a/packages/mediation/gma_mediation_applovin/ios/Classes/AppLovinSDKApi.g.swift b/packages/mediation/gma_mediation_applovin/ios/Classes/AppLovinSDKApi.g.swift index 7c440613b..67c3c52d5 100644 --- a/packages/mediation/gma_mediation_applovin/ios/Classes/AppLovinSDKApi.g.swift +++ b/packages/mediation/gma_mediation_applovin/ios/Classes/AppLovinSDKApi.g.swift @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v17.1.2), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -38,11 +38,17 @@ private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } return value as! T? } +/// The generated classes set the channels to call the methods in the corresponding kotlin AppLovinSDKApi interface and swift AppLovinSDKApi protocol from the dart layer. +/// /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol AppLovinSDKApi { + /// Used to configure GDPR consent on the Android or iOS AppLovin SDK func setHasUserConsent(hasUserConsent: Bool) throws + /// Used to acknowledge that the user is in an age-restricted category on the Android or iOS AppLovin SDK func setIsAgeRestrictedUser(isAgeRestrictedUser: Bool) throws + /// Used to opt out of the sale of personal information in AppLovin SDK. func setDoNotSell(doNotSell: Bool) throws + /// Used to initialize the Android or iOS AppLovin SDK. Can be called anytime before the adapter initialization to let AppLovin track events as soon as possible. func initializeSdk(sdkKey: String) throws } @@ -51,6 +57,7 @@ class AppLovinSDKApiSetup { /// The codec used by AppLovinSDKApi. /// Sets up an instance of `AppLovinSDKApi` to handle messages through the `binaryMessenger`. static func setUp(binaryMessenger: FlutterBinaryMessenger, api: AppLovinSDKApi?) { + /// Used to configure GDPR consent on the Android or iOS AppLovin SDK let setHasUserConsentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.gma_mediation_applovin.AppLovinSDKApi.setHasUserConsent", binaryMessenger: binaryMessenger) if let api = api { setHasUserConsentChannel.setMessageHandler { message, reply in @@ -66,6 +73,7 @@ class AppLovinSDKApiSetup { } else { setHasUserConsentChannel.setMessageHandler(nil) } + /// Used to acknowledge that the user is in an age-restricted category on the Android or iOS AppLovin SDK let setIsAgeRestrictedUserChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.gma_mediation_applovin.AppLovinSDKApi.setIsAgeRestrictedUser", binaryMessenger: binaryMessenger) if let api = api { setIsAgeRestrictedUserChannel.setMessageHandler { message, reply in @@ -81,6 +89,7 @@ class AppLovinSDKApiSetup { } else { setIsAgeRestrictedUserChannel.setMessageHandler(nil) } + /// Used to opt out of the sale of personal information in AppLovin SDK. let setDoNotSellChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.gma_mediation_applovin.AppLovinSDKApi.setDoNotSell", binaryMessenger: binaryMessenger) if let api = api { setDoNotSellChannel.setMessageHandler { message, reply in @@ -96,6 +105,7 @@ class AppLovinSDKApiSetup { } else { setDoNotSellChannel.setMessageHandler(nil) } + /// Used to initialize the Android or iOS AppLovin SDK. Can be called anytime before the adapter initialization to let AppLovin track events as soon as possible. let initializeSdkChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.gma_mediation_applovin.AppLovinSDKApi.initializeSdk", binaryMessenger: binaryMessenger) if let api = api { initializeSdkChannel.setMessageHandler { message, reply in diff --git a/packages/mediation/gma_mediation_applovin/ios/Classes/GmaMediationApplovinPlugin.swift b/packages/mediation/gma_mediation_applovin/ios/Classes/GmaMediationApplovinPlugin.swift index e9432170a..288d480e0 100644 --- a/packages/mediation/gma_mediation_applovin/ios/Classes/GmaMediationApplovinPlugin.swift +++ b/packages/mediation/gma_mediation_applovin/ios/Classes/GmaMediationApplovinPlugin.swift @@ -16,6 +16,7 @@ import AppLovinSDK import Flutter import UIKit +/// Manages AppLovinSDKApi and implements the needed methods. public class GmaMediationApplovinPlugin: NSObject, FlutterPlugin, AppLovinSDKApi { let applovinSdk: ALSdkProtocol @@ -28,6 +29,10 @@ public class GmaMediationApplovinPlugin: NSObject, FlutterPlugin, AppLovinSDKApi let api : AppLovinSDKApi& NSObjectProtocol = GmaMediationApplovinPlugin.init(applovinSdk: ALSdkImpl()) AppLovinSDKApiSetup.setUp(binaryMessenger: messenger, api: api) } + public func detachFromEngine(for registrar: FlutterPluginRegistrar) { + let messenger : FlutterBinaryMessenger = registrar.messenger() + AppLovinSDKApiSetup.setUp(binaryMessenger: messenger, api: nil) + } func setHasUserConsent(hasUserConsent: Bool) { applovinSdk.setHasUserConsent(hasUserConsent: hasUserConsent) diff --git a/packages/mediation/gma_mediation_applovin/ios/gma_mediation_applovin.podspec b/packages/mediation/gma_mediation_applovin/ios/gma_mediation_applovin.podspec index 2bdee067d..ccace3ca9 100644 --- a/packages/mediation/gma_mediation_applovin/ios/gma_mediation_applovin.podspec +++ b/packages/mediation/gma_mediation_applovin/ios/gma_mediation_applovin.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'gma_mediation_applovin' - s.version = '1.0.0' + s.version = '1.1.0' s.summary = 'Google Mobile Ads Mediation of AppLovin.' s.description = <<-DESC Mediation Adapter for AppLovin to use with Google Mobile Ads. @@ -16,7 +16,7 @@ Mediation Adapter for AppLovin to use with Google Mobile Ads. s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' - s.dependency 'GoogleMobileAdsMediationAppLovin', '~> 12.2.1.0' + s.dependency 'GoogleMobileAdsMediationAppLovin', '~> 12.4.2.0' s.platform = :ios, '12.0' # Flutter.framework does not contain a i386 slice. diff --git a/packages/mediation/gma_mediation_applovin/lib/applovin_mediation_extras.dart b/packages/mediation/gma_mediation_applovin/lib/applovin_mediation_extras.dart index c87559602..5cc8c7e23 100644 --- a/packages/mediation/gma_mediation_applovin/lib/applovin_mediation_extras.dart +++ b/packages/mediation/gma_mediation_applovin/lib/applovin_mediation_extras.dart @@ -1,8 +1,25 @@ +// Copyright 2024 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 +// +// https://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 'package:google_mobile_ads/google_mobile_ads.dart'; +/// Extra information sent to the AppLovin adapter through an [AdRequest] or an [AdManagerAdRequest]. class AppLovinMediationExtras implements MediationExtras { + /// Default constructor with required extras value. const AppLovinMediationExtras({required this.isMuted}); + /// Specifies whether the loaded AppLovin ad will be muted or not. final bool isMuted; @override diff --git a/packages/mediation/gma_mediation_applovin/lib/applovin_sdk_api.g.dart b/packages/mediation/gma_mediation_applovin/lib/applovin_sdk_api.g.dart index f7668eee4..af0f885ff 100644 --- a/packages/mediation/gma_mediation_applovin/lib/applovin_sdk_api.g.dart +++ b/packages/mediation/gma_mediation_applovin/lib/applovin_sdk_api.g.dart @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v17.1.2), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -15,6 +15,7 @@ PlatformException _createConnectionError(String channelName) { ); } +/// The generated classes set the channels to call the methods in the corresponding kotlin AppLovinSDKApi interface and swift AppLovinSDKApi protocol from the dart layer. class AppLovinSDKApi { /// Constructor for [AppLovinSDKApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default @@ -26,6 +27,7 @@ class AppLovinSDKApi { static const MessageCodec pigeonChannelCodec = StandardMessageCodec(); + /// Used to configure GDPR consent on the Android or iOS AppLovin SDK Future setHasUserConsent(bool hasUserConsent) async { const String __pigeon_channelName = 'dev.flutter.pigeon.gma_mediation_applovin.AppLovinSDKApi.setHasUserConsent'; @@ -50,6 +52,7 @@ class AppLovinSDKApi { } } + /// Used to acknowledge that the user is in an age-restricted category on the Android or iOS AppLovin SDK Future setIsAgeRestrictedUser(bool isAgeRestrictedUser) async { const String __pigeon_channelName = 'dev.flutter.pigeon.gma_mediation_applovin.AppLovinSDKApi.setIsAgeRestrictedUser'; @@ -74,6 +77,7 @@ class AppLovinSDKApi { } } + /// Used to opt out of the sale of personal information in AppLovin SDK. Future setDoNotSell(bool doNotSell) async { const String __pigeon_channelName = 'dev.flutter.pigeon.gma_mediation_applovin.AppLovinSDKApi.setDoNotSell'; @@ -98,6 +102,7 @@ class AppLovinSDKApi { } } + /// Used to initialize the Android or iOS AppLovin SDK. Can be called anytime before the adapter initialization to let AppLovin track events as soon as possible. Future initializeSdk(String sdkKey) async { const String __pigeon_channelName = 'dev.flutter.pigeon.gma_mediation_applovin.AppLovinSDKApi.initializeSdk'; diff --git a/packages/mediation/gma_mediation_applovin/lib/gma_mediation_applovin.dart b/packages/mediation/gma_mediation_applovin/lib/gma_mediation_applovin.dart index 37431008b..49dc8d9a9 100644 --- a/packages/mediation/gma_mediation_applovin/lib/gma_mediation_applovin.dart +++ b/packages/mediation/gma_mediation_applovin/lib/gma_mediation_applovin.dart @@ -14,20 +14,21 @@ import 'package:gma_mediation_applovin/applovin_sdk_api.g.dart'; +/// This class has entrypoint to call AppLovin's SDK APIs. class GmaMediationApplovin { - static Future setHasUserConsent(bool hasUserConsent) async { + Future setHasUserConsent(bool hasUserConsent) async { AppLovinSDKApi().setHasUserConsent(hasUserConsent); } - static Future setIsAgeRestrictedUser(bool isAgeRestrictedUser) async { + Future setIsAgeRestrictedUser(bool isAgeRestrictedUser) async { AppLovinSDKApi().setIsAgeRestrictedUser(isAgeRestrictedUser); } - static Future setDoNotSell(bool doNotSell) async { + Future setDoNotSell(bool doNotSell) async { AppLovinSDKApi().setDoNotSell(doNotSell); } - static Future initializeSdk(String sdkKey) async { + Future initializeSdk(String sdkKey) async { AppLovinSDKApi().initializeSdk(sdkKey); } } diff --git a/packages/mediation/gma_mediation_applovin/pigeons/applovin_privacy_api.dart b/packages/mediation/gma_mediation_applovin/pigeons/applovin_privacy_api.dart index 98d3f3c96..ba1dad7ee 100644 --- a/packages/mediation/gma_mediation_applovin/pigeons/applovin_privacy_api.dart +++ b/packages/mediation/gma_mediation_applovin/pigeons/applovin_privacy_api.dart @@ -14,25 +14,34 @@ import 'package:pigeon/pigeon.dart'; -@ConfigurePigeon(PigeonOptions( - dartOut: 'lib/applovin_sdk_api.g.dart', - dartOptions: DartOptions(), - kotlinOut: - 'android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinSDKApi.g.kt', - kotlinOptions: KotlinOptions( +@ConfigurePigeon( + PigeonOptions( + dartOut: 'lib/applovin_sdk_api.g.dart', + dartOptions: DartOptions(), + kotlinOut: + 'android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_applovin/AppLovinSDKApi.g.kt', + kotlinOptions: KotlinOptions( package: - "io.flutter.plugins.googlemobileads.mediation.gma_mediation_applovin"), - swiftOut: 'ios/Classes/AppLovinSDKApi.g.swift', - swiftOptions: SwiftOptions(), - dartPackageName: 'gma_mediation_applovin', -)) + "io.flutter.plugins.googlemobileads.mediation.gma_mediation_applovin", + ), + swiftOut: 'ios/Classes/AppLovinSDKApi.g.swift', + swiftOptions: SwiftOptions(), + dartPackageName: 'gma_mediation_applovin', + ), +) @HostApi() + +/// The generated classes set the channels to call the methods in the corresponding kotlin AppLovinSDKApi interface and swift AppLovinSDKApi protocol from the dart layer. abstract class AppLovinSDKApi { + /// Used to configure GDPR consent on the Android or iOS AppLovin SDK void setHasUserConsent(bool hasUserConsent); + /// Used to acknowledge that the user is in an age-restricted category on the Android or iOS AppLovin SDK void setIsAgeRestrictedUser(bool isAgeRestrictedUser); + /// Used to opt out of the sale of personal information in AppLovin SDK. void setDoNotSell(bool doNotSell); + /// Used to initialize the Android or iOS AppLovin SDK. Can be called anytime before the adapter initialization to let AppLovin track events as soon as possible. void initializeSdk(String sdkKey); } diff --git a/packages/mediation/gma_mediation_applovin/pubspec.yaml b/packages/mediation/gma_mediation_applovin/pubspec.yaml index 6523091c7..b5d23fa45 100644 --- a/packages/mediation/gma_mediation_applovin/pubspec.yaml +++ b/packages/mediation/gma_mediation_applovin/pubspec.yaml @@ -1,7 +1,7 @@ name: gma_mediation_applovin -description: "Mediation Adapter for AppLovin to use with Google Mobile Ads." -version: 1.0.0 -repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/google_mobile_ads/mediation +description: "Mediation Adapter that enables sending ad requests to the AppLovin ad network using the google_mobile_ads plugin." +version: 1.1.0 +repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/mediation/gma_mediation_applovin environment: sdk: '>=3.2.5 <4.0.0' @@ -10,13 +10,14 @@ environment: dependencies: flutter: sdk: flutter - google_mobile_ads: ^5.0.0 + google_mobile_ads: ^5.1.0 plugin_platform_interface: ^2.0.2 dev_dependencies: + flutter_lints: ^2.0.0 flutter_test: sdk: flutter - flutter_lints: ^2.0.0 + lint: ^2.3.0 pigeon: ^17.0.0 flutter: diff --git a/packages/mediation/gma_mediation_liftoffmonetize/.gitignore b/packages/mediation/gma_mediation_liftoffmonetize/.gitignore new file mode 100644 index 000000000..ac5aa9893 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/.gitignore @@ -0,0 +1,29 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +build/ diff --git a/samples/admob/adaptive_banner_example/.metadata b/packages/mediation/gma_mediation_liftoffmonetize/.metadata similarity index 59% rename from samples/admob/adaptive_banner_example/.metadata rename to packages/mediation/gma_mediation_liftoffmonetize/.metadata index 7cc394df5..5a15fe0d0 100644 --- a/samples/admob/adaptive_banner_example/.metadata +++ b/packages/mediation/gma_mediation_liftoffmonetize/.metadata @@ -4,23 +4,23 @@ # This file should be version controlled and should not be manually edited. version: - revision: "d211f42860350d914a5ad8102f9ec32764dc6d06" + revision: "41456452f29d64e8deb623a3c927524bcf9f111b" channel: "stable" -project_type: app +project_type: plugin # Tracks metadata for the flutter migrate command migration: platforms: - platform: root - create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 - base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b - platform: android - create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 - base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b - platform: ios - create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 - base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b # User provided section diff --git a/packages/mediation/gma_mediation_liftoffmonetize/CHANGELOG.md b/packages/mediation/gma_mediation_liftoffmonetize/CHANGELOG.md new file mode 100644 index 000000000..57f419373 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/CHANGELOG.md @@ -0,0 +1,7 @@ +## Liftoff Monetize Flutter Mediation Adapter Changelog + +#### Version 1.0.0 +- Initial release. +- Verified compatibility with Liftoff Monetize Android adapter version 7.3.1.0 +- Verified compatibility with LiftoffMonetize iOS adapter version 7.3.2.0 +- Built and tested with the Google Mobile Ads Flutter Plugin version 5.1.0. \ No newline at end of file diff --git a/packages/mediation/gma_mediation_liftoffmonetize/LICENSE b/packages/mediation/gma_mediation_liftoffmonetize/LICENSE new file mode 100644 index 000000000..7a4a3ea24 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/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 [yyyy] [name of copyright owner] + + 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. \ No newline at end of file diff --git a/packages/mediation/gma_mediation_liftoffmonetize/README.md b/packages/mediation/gma_mediation_liftoffmonetize/README.md new file mode 100644 index 000000000..59b8a885e --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/README.md @@ -0,0 +1,31 @@ +# Google Mobile Ads Mediation of Liftoff Monetize for Flutter + +[![gma_mediation_liftoffmonetize](https://github.com/googleads/googleads-mobile-flutter/actions/workflows/google_mobile_ads.yaml/badge.svg)](https://github.com/googleads/googleads-mobile-flutter/actions/workflows/google_mobile_ads.yaml) + +This repository contains the source code for the Mediation Liftoff Monetize +Flutter plugin to be used with the Google Mobile Ads plugin. It enables +mediation of the Liftoff Monetize Ad Network through the Google Mobile Ads SDK. + +## Documentation +For instructions on how to use with the google_mobile_ads plugin, refer to the +developer guide for [](https://developers.google.com/admob/flutter/mediation/liftoff-monetize). + +## Downloads + +See [pub.dev](https://pub.dev/packages/gma_mediation_liftoffmonetize/versions) for the +latest releases of the plugin. + +## Suggesting improvements + +To file bugs, make feature requests, or to suggest other improvements, please +use [github's issue tracker](https://github.com/googleads/googleads-mobile-flutter/issues). + + +## Other resources + +* [AdMob help center](https://support.google.com/admob/?hl=en#topic=7383088) +* [Ad Manager help center](https://support.google.com/admanager/?hl=en#topic=7505988) + +## License + +[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) \ No newline at end of file diff --git a/packages/mediation/gma_mediation_liftoffmonetize/analysis_options.yaml b/packages/mediation/gma_mediation_liftoffmonetize/analysis_options.yaml new file mode 100644 index 000000000..7ccbffbb3 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/analysis_options.yaml @@ -0,0 +1,19 @@ +#Copyright 2024 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 +# +#https://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. + +include: package:lint/package.yaml + +analyzer: + exclude: + - '**.g.dart' diff --git a/packages/mediation/gma_mediation_liftoffmonetize/android/.gitignore b/packages/mediation/gma_mediation_liftoffmonetize/android/.gitignore new file mode 100644 index 000000000..161bdcdaf --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/android/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.cxx diff --git a/packages/mediation/gma_mediation_liftoffmonetize/android/build.gradle b/packages/mediation/gma_mediation_liftoffmonetize/android/build.gradle new file mode 100644 index 000000000..682160f13 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/android/build.gradle @@ -0,0 +1,79 @@ +group 'io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize' +version '1.0-SNAPSHOT' + +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.3.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +android { + if (project.android.hasProperty("namespace")) { + namespace 'io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize' + } + + compileSdkVersion 33 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + test.java.srcDirs += 'src/test/kotlin' + } + + defaultConfig { + minSdkVersion 21 + } + + dependencies { + implementation 'com.google.ads.mediation:vungle:7.3.2.0' + testImplementation 'junit:junit:4.13.2' + testImplementation 'androidx.test:core:1.5.0' + testImplementation 'androidx.test:core-ktx:1.5.0' + testImplementation 'androidx.test.ext:junit:1.1.5' + testImplementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.20' + testImplementation 'org.mockito:mockito-core:5.5.0' + testImplementation 'org.mockito.kotlin:mockito-kotlin:5.1.0' + testImplementation 'org.robolectric:robolectric:4.10.3' + } + + testOptions { + unitTests.all { + useJUnit() + + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + outputs.upToDateWhen {false} + showStandardStreams = true + } + } + unitTests { + includeAndroidResources = true + unitTests.returnDefaultValues = true + } + } +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/android/gradle/wrapper/gradle-wrapper.properties b/packages/mediation/gma_mediation_liftoffmonetize/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..62f495dfe --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/packages/mediation/gma_mediation_liftoffmonetize/android/settings.gradle b/packages/mediation/gma_mediation_liftoffmonetize/android/settings.gradle new file mode 100644 index 000000000..292dbf092 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'gma_mediation_liftoffmonetize' diff --git a/packages/mediation/gma_mediation_liftoffmonetize/android/src/main/AndroidManifest.xml b/packages/mediation/gma_mediation_liftoffmonetize/android/src/main/AndroidManifest.xml new file mode 100644 index 000000000..acc7f40d6 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + diff --git a/packages/mediation/gma_mediation_liftoffmonetize/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/GmaMediationLiftoffmonetizePlugin.kt b/packages/mediation/gma_mediation_liftoffmonetize/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/GmaMediationLiftoffmonetizePlugin.kt new file mode 100644 index 000000000..1fffe9d85 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/GmaMediationLiftoffmonetizePlugin.kt @@ -0,0 +1,23 @@ +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize + +import com.vungle.ads.VunglePrivacySettings +import io.flutter.embedding.engine.plugins.FlutterPlugin + +/** Manages LiftoffPrivacyApi and implements the needed methods. */ +class GmaMediationLiftoffmonetizePlugin: FlutterPlugin, LiftoffPrivacyApi { + override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + LiftoffPrivacyApi.setUp(flutterPluginBinding.binaryMessenger, this) + } + + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { + LiftoffPrivacyApi.setUp(binding.binaryMessenger, null) + } + + override fun setGDPRStatus(optedIn: Boolean, consentMessageVersion: String?) { + VunglePrivacySettings.setGDPRStatus(optedIn, consentMessageVersion) + } + + override fun setCCPAStatus(optedIn: Boolean) { + VunglePrivacySettings.setCCPAStatus(optedIn) + } +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/LiftoffPrivacyApi.g.kt b/packages/mediation/gma_mediation_liftoffmonetize/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/LiftoffPrivacyApi.g.kt new file mode 100644 index 000000000..059e209ce --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/LiftoffPrivacyApi.g.kt @@ -0,0 +1,105 @@ +// Autogenerated from Pigeon (v17.0.0), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize + +import android.util.Log +import io.flutter.plugin.common.BasicMessageChannel +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMessageCodec +import java.io.ByteArrayOutputStream +import java.nio.ByteBuffer + +private fun wrapResult(result: Any?): List { + return listOf(result) +} + +private fun wrapError(exception: Throwable): List { + if (exception is FlutterError) { + return listOf( + exception.code, + exception.message, + exception.details + ) + } else { + return listOf( + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) + ) + } +} + +/** + * Error class for passing custom error details to Flutter via a thrown PlatformException. + * @property code The error code. + * @property message The error message. + * @property details The error details. Must be a datatype supported by the api codec. + */ +class FlutterError ( + val code: String, + override val message: String? = null, + val details: Any? = null +) : Throwable() +/** + * The generated classes set the channels to call the methods in the corresponding kotlin LiftoffPrivacyApi interface and swift LiftoffPrivacyApi protocol from the dart layer. + * + * Generated interface from Pigeon that represents a handler of messages from Flutter. + */ +interface LiftoffPrivacyApi { + /** Used to configure GDPR status on the Android or iOS Liftoff Monetize SDK */ + fun setGDPRStatus(optedIn: Boolean, consentMessageVersion: String?) + /** Used to configure CCPA consent on the Android or iOS Liftoff Monetize SDK */ + fun setCCPAStatus(optedIn: Boolean) + + companion object { + /** The codec used by LiftoffPrivacyApi. */ + val codec: MessageCodec by lazy { + StandardMessageCodec() + } + /** Sets up an instance of `LiftoffPrivacyApi` to handle messages through the `binaryMessenger`. */ + @Suppress("UNCHECKED_CAST") + fun setUp(binaryMessenger: BinaryMessenger, api: LiftoffPrivacyApi?) { + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.gma_mediation_liftoffmonetize.LiftoffPrivacyApi.setGDPRStatus", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val optedInArg = args[0] as Boolean + val consentMessageVersionArg = args[1] as String? + var wrapped: List + try { + api.setGDPRStatus(optedInArg, consentMessageVersionArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.gma_mediation_liftoffmonetize.LiftoffPrivacyApi.setCCPAStatus", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val optedInArg = args[0] as Boolean + var wrapped: List + try { + api.setCCPAStatus(optedInArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/android/src/test/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/GmaMediationLiftoffmonetizePluginTest.kt b/packages/mediation/gma_mediation_liftoffmonetize/android/src/test/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/GmaMediationLiftoffmonetizePluginTest.kt new file mode 100644 index 000000000..6fa39a59b --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/android/src/test/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/GmaMediationLiftoffmonetizePluginTest.kt @@ -0,0 +1,54 @@ +// Copyright 2024 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 +// +// https://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. + +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import com.vungle.ads.VunglePrivacySettings +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.Mockito.mockStatic + +@RunWith(AndroidJUnit4::class) +internal class GmaMediationLiftoffmonetizePluginTest { + @Test + fun setGDPRStatus_withTruValue_invokesLiftoffSetGDPRStatus() { + val plugin = GmaMediationLiftoffmonetizePlugin() + mockStatic(VunglePrivacySettings::class.java).use { mockVunglePrivacySettings -> + + plugin.setGDPRStatus(optedIn= true, consentMessageVersion= TEST_CONSENT_STRING) + + mockVunglePrivacySettings.verify { + VunglePrivacySettings.setGDPRStatus(true, TEST_CONSENT_STRING) + } + } + } + + @Test + fun setCCPAStatus_withTruValue_invokesLiftoffSetCCPAStatus() { + val plugin = GmaMediationLiftoffmonetizePlugin() + mockStatic(VunglePrivacySettings::class.java).use { mockVunglePrivacySettings -> + + plugin.setCCPAStatus(optedIn= true) + + mockVunglePrivacySettings.verify { + VunglePrivacySettings.setCCPAStatus(true) + } + } + } + + companion object { + private const val TEST_CONSENT_STRING = "testConsentString" + } +} diff --git a/samples/admob/adaptive_banner_example/.gitignore b/packages/mediation/gma_mediation_liftoffmonetize/example/.gitignore similarity index 98% rename from samples/admob/adaptive_banner_example/.gitignore rename to packages/mediation/gma_mediation_liftoffmonetize/example/.gitignore index 24476c5d1..29a3a5017 100644 --- a/samples/admob/adaptive_banner_example/.gitignore +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/.gitignore @@ -27,7 +27,6 @@ migrate_working_dir/ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies -.packages .pub-cache/ .pub/ /build/ diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/README.md b/packages/mediation/gma_mediation_liftoffmonetize/example/README.md new file mode 100644 index 000000000..49ebf5d83 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/README.md @@ -0,0 +1,17 @@ +# gma_mediation_liftoffmonetize_example + +Learn how to integrate with your app that uses the [google_mobile_ads](https://pub.dev/packages/google_mobile_ads) plugin +by following the [development guide](https://developers.google.com/admob/flutter/mediation/liftoff-monetize). + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/analysis_options.yaml b/packages/mediation/gma_mediation_liftoffmonetize/example/analysis_options.yaml new file mode 100644 index 000000000..0d2902135 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/samples/admob/adaptive_banner_example/android/.gitignore b/packages/mediation/gma_mediation_liftoffmonetize/example/android/.gitignore similarity index 100% rename from samples/admob/adaptive_banner_example/android/.gitignore rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/.gitignore diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/build.gradle b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/build.gradle new file mode 100644 index 000000000..860988977 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/build.gradle @@ -0,0 +1,67 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +android { + namespace "io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize_example" + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize_example" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies {} diff --git a/samples/admob/adaptive_banner_example/android/app/src/debug/AndroidManifest.xml b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/debug/AndroidManifest.xml rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/debug/AndroidManifest.xml diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/AndroidManifest.xml b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/AndroidManifest.xml similarity index 79% rename from samples/admob/adaptive_banner_example/android/app/src/main/AndroidManifest.xml rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/AndroidManifest.xml index 0dbee024f..b3bdccc21 100644 --- a/samples/admob/adaptive_banner_example/android/app/src/main/AndroidManifest.xml +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" + /> - - + + - - \ No newline at end of file + diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize_example/MainActivity.kt b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize_example/MainActivity.kt new file mode 100644 index 000000000..ed84e1b1a --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize_example/MainActivity.kt @@ -0,0 +1,6 @@ +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize_example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/drawable-v21/launch_background.xml similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/main/res/drawable-v21/launch_background.xml rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/res/drawable/launch_background.xml b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/main/res/drawable/launch_background.xml rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/drawable/launch_background.xml diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/res/values-night/styles.xml b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/values-night/styles.xml similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/main/res/values-night/styles.xml rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/values-night/styles.xml diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/res/values/styles.xml b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/values/styles.xml similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/main/res/values/styles.xml rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/main/res/values/styles.xml diff --git a/samples/admob/adaptive_banner_example/android/app/src/profile/AndroidManifest.xml b/packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from samples/admob/adaptive_banner_example/android/app/src/profile/AndroidManifest.xml rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/app/src/profile/AndroidManifest.xml diff --git a/samples/admob/adaptive_banner_example/android/build.gradle b/packages/mediation/gma_mediation_liftoffmonetize/example/android/build.gradle similarity index 90% rename from samples/admob/adaptive_banner_example/android/build.gradle rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/build.gradle index f7eb7f63c..e83fb5dac 100644 --- a/samples/admob/adaptive_banner_example/android/build.gradle +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/android/build.gradle @@ -6,7 +6,6 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/samples/admob/adaptive_banner_example/android/gradle.properties b/packages/mediation/gma_mediation_liftoffmonetize/example/android/gradle.properties similarity index 64% rename from samples/admob/adaptive_banner_example/android/gradle.properties rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/gradle.properties index 94adc3a3f..598d13fee 100644 --- a/samples/admob/adaptive_banner_example/android/gradle.properties +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true diff --git a/samples/admob/adaptive_banner_example/android/gradle/wrapper/gradle-wrapper.properties b/packages/mediation/gma_mediation_liftoffmonetize/example/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from samples/admob/adaptive_banner_example/android/gradle/wrapper/gradle-wrapper.properties rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/gradle/wrapper/gradle-wrapper.properties diff --git a/samples/admob/adaptive_banner_example/android/settings.gradle b/packages/mediation/gma_mediation_liftoffmonetize/example/android/settings.gradle similarity index 72% rename from samples/admob/adaptive_banner_example/android/settings.gradle rename to packages/mediation/gma_mediation_liftoffmonetize/example/android/settings.gradle index 55c4ca8b1..7cd712855 100644 --- a/samples/admob/adaptive_banner_example/android/settings.gradle +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/android/settings.gradle @@ -10,11 +10,20 @@ pluginManagement { includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + repositories { + google() + mavenCentral() + gradlePluginPortal() + } + plugins { id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false } } -include ":app" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false +} -apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" +include ":app" diff --git a/samples/admob/adaptive_banner_example/ios/.gitignore b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/.gitignore similarity index 100% rename from samples/admob/adaptive_banner_example/ios/.gitignore rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/.gitignore diff --git a/samples/admob/adaptive_banner_example/ios/Flutter/AppFrameworkInfo.plist b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Flutter/AppFrameworkInfo.plist similarity index 96% rename from samples/admob/adaptive_banner_example/ios/Flutter/AppFrameworkInfo.plist rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Flutter/AppFrameworkInfo.plist index 9625e105d..7c5696400 100644 --- a/samples/admob/adaptive_banner_example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Flutter/Debug.xcconfig b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..ec97fc6f3 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Flutter/Release.xcconfig b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..c4855bfe2 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Podfile b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Podfile new file mode 100644 index 000000000..38b28ff0d --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner.xcodeproj/project.pbxproj b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..c493a4f4d --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,635 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* GmaMediationLiftoffmonetizePluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* GmaMediationLiftoffmonetizePluginTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* GmaMediationLiftoffmonetizePluginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GmaMediationLiftoffmonetizePluginTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 44BF27D82BA395A500DCC780 /* LiftoffMonetizeAdapter.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = LiftoffMonetizeAdapter.xcframework; path = "Pods/GoogleMobileAdsMediationVungle/LiftoffMonetizeAdapter-7.2.2.1/LiftoffMonetizeAdapter.xcframework"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EB5C0E7342D59ED601DDEAC3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1323259DB5C5C8CDE677D749 /* Pods */ = { + isa = PBXGroup; + children = ( + ); + path = Pods; + sourceTree = ""; + }; + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* GmaMediationLiftoffmonetizePluginTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 562F18C8BAA18BEFC40C5F7C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 44BF27D82BA395A500DCC780 /* LiftoffMonetizeAdapter.xcframework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + 1323259DB5C5C8CDE677D749 /* Pods */, + 562F18C8BAA18BEFC40C5F7C /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + EB5C0E7342D59ED601DDEAC3 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* GmaMediationLiftoffmonetizePluginTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationLiftoffmonetizeExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationLiftoffmonetizeExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationLiftoffmonetizeExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationLiftoffmonetizeExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationLiftoffmonetizeExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationLiftoffmonetizeExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/samples/admob/adaptive_banner_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..21a3cc14c --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/samples/admob/adaptive_banner_example/ios/Runner/AppDelegate.swift b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/AppDelegate.swift similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/AppDelegate.swift rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/AppDelegate.swift diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Base.lproj/Main.storyboard b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Base.lproj/Main.storyboard rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Info.plist b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Info.plist new file mode 100644 index 000000000..a19a70993 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Info.plist @@ -0,0 +1,58 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Gma Mediation Liftoffmonetize + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + gma_mediation_liftoffmonetize_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + GADApplicationIdentifier + ca-app-pub-3940256099942544~1458002511 + SKAdNetworkItems + + + SKAdNetworkIdentifier + cstr6suwn9.skadnetwork + + + + diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Runner-Bridging-Header.h b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from samples/admob/adaptive_banner_example/ios/Runner/Runner-Bridging-Header.h rename to packages/mediation/gma_mediation_liftoffmonetize/example/ios/Runner/Runner-Bridging-Header.h diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/ios/RunnerTests/GmaMediationLiftoffmonetizePluginTests.swift b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/RunnerTests/GmaMediationLiftoffmonetizePluginTests.swift new file mode 100644 index 000000000..91635c977 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/ios/RunnerTests/GmaMediationLiftoffmonetizePluginTests.swift @@ -0,0 +1,55 @@ +// Copyright 2024 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 +// +// https://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 UIKit +import XCTest + +@testable import gma_mediation_liftoffmonetize + +class GmaMediationLiftoffmonetizePluginTests: XCTestCase { + func testSetGDPRStatus() { + let liftoffPrivacyFake = LiftoffPrivacyFake() + + GmaMediationLiftoffmonetizePlugin(liftoffPrivacy: liftoffPrivacyFake).setGDPRStatus(optedIn: true, consentMessageVersion: "testConsentVersion") + + XCTAssertEqual(liftoffPrivacyFake.gdprOptedIn, true) + XCTAssertEqual(liftoffPrivacyFake.gdprMessageVersion, "testConsentVersion") + } + + func testSetCCPAStatus() { + let liftoffPrivacyFake = LiftoffPrivacyFake() + + GmaMediationLiftoffmonetizePlugin(liftoffPrivacy: liftoffPrivacyFake).setCCPAStatus(optedIn: true) + + XCTAssertEqual(liftoffPrivacyFake.ccpaOptedIn, true) + } +} + +class LiftoffPrivacyFake : LiftoffPrivacyProtocol { + var gdprOptedIn: Bool = false + var gdprMessageVersion: String? = "" + var ccpaOptedIn: Bool = false + + func setGDPRStatus(optedIn: Bool) { + self.gdprOptedIn = optedIn + } + + func setGDPRMessageVersion(consentMessageVersion: String?) { + self.gdprMessageVersion = consentMessageVersion + } + + func setCCPAStatus(optedIn: Bool) { + self.ccpaOptedIn = optedIn + } +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/lib/main.dart b/packages/mediation/gma_mediation_liftoffmonetize/example/lib/main.dart new file mode 100644 index 000000000..665bfe31b --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/lib/main.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatefulWidget { + const MyApp({super.key}); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('Plugin example app'), + ), + body: const Center( + child: Text('Test app'), + ), + ), + ); + } +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/example/pubspec.yaml b/packages/mediation/gma_mediation_liftoffmonetize/example/pubspec.yaml new file mode 100644 index 000000000..7a365efaf --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/example/pubspec.yaml @@ -0,0 +1,86 @@ +name: gma_mediation_liftoffmonetize_example +description: "Demonstrates how to use the gma_mediation_liftoffmonetize plugin." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +environment: + sdk: '>=3.2.5 <4.0.0' + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + google_mobile_ads: ^5.0.0 + gma_mediation_liftoffmonetize: + # When depending on this package from a real application you should use: + # gma_mediation_liftoffmonetize: ^x.y.z + # See https://dart.dev/tools/pub/dependencies#version-constraints + # The example app is bundled with the plugin so we use a path dependency on + # the parent directory to use the current plugin's version. + path: ../ + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + integration_test: + sdk: flutter + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/mediation/gma_mediation_liftoffmonetize/ios/.gitignore b/packages/mediation/gma_mediation_liftoffmonetize/ios/.gitignore new file mode 100644 index 000000000..0c885071e --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/ios/.gitignore @@ -0,0 +1,38 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig +/Flutter/ephemeral/ +/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/packages/mediation/gma_mediation_meta/lib/.gitkeep b/packages/mediation/gma_mediation_liftoffmonetize/ios/Assets/.gitkeep similarity index 100% rename from packages/mediation/gma_mediation_meta/lib/.gitkeep rename to packages/mediation/gma_mediation_liftoffmonetize/ios/Assets/.gitkeep diff --git a/packages/mediation/gma_mediation_liftoffmonetize/ios/Classes/GmaMediationLiftoffmonetizePlugin.swift b/packages/mediation/gma_mediation_liftoffmonetize/ios/Classes/GmaMediationLiftoffmonetizePlugin.swift new file mode 100644 index 000000000..68b783388 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/ios/Classes/GmaMediationLiftoffmonetizePlugin.swift @@ -0,0 +1,68 @@ +// Copyright 2024 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 +// +// https://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 Flutter +import UIKit +import VungleAdsSDK + +/// Manages LiftoffPrivacyApi and implements the needed methods. +public class GmaMediationLiftoffmonetizePlugin: NSObject, FlutterPlugin, LiftoffPrivacyApi { + let liftoffPrivacy: LiftoffPrivacyProtocol + + init (liftoffPrivacy: LiftoffPrivacyProtocol) { + self.liftoffPrivacy = liftoffPrivacy + } + + public static func register(with registrar: FlutterPluginRegistrar) { + let messenger : FlutterBinaryMessenger = registrar.messenger() + let api : LiftoffPrivacyApi& NSObjectProtocol = GmaMediationLiftoffmonetizePlugin.init(liftoffPrivacy: LiftoffPrivacyImpl()) + LiftoffPrivacyApiSetup.setUp(binaryMessenger: messenger, api: api) + } + + public func detachFromEngine(for registrar: FlutterPluginRegistrar) { + let messenger : FlutterBinaryMessenger = registrar.messenger() + LiftoffPrivacyApiSetup.setUp(binaryMessenger: messenger, api: nil) + } + + func setGDPRStatus(optedIn: Bool, consentMessageVersion: String?) { + liftoffPrivacy.setGDPRStatus(optedIn: optedIn) + liftoffPrivacy.setGDPRMessageVersion(consentMessageVersion: consentMessageVersion) + } + + func setCCPAStatus(optedIn: Bool) { + liftoffPrivacy.setCCPAStatus(optedIn: optedIn) + } +} + +protocol LiftoffPrivacyProtocol { + func setGDPRStatus(optedIn: Bool) + + func setGDPRMessageVersion(consentMessageVersion: String?) + + func setCCPAStatus(optedIn: Bool) +} + +class LiftoffPrivacyImpl : LiftoffPrivacyProtocol { + func setGDPRStatus(optedIn: Bool) { + VunglePrivacySettings.setGDPRStatus(optedIn) + } + + func setGDPRMessageVersion(consentMessageVersion: String?) { + VunglePrivacySettings.setGDPRMessageVersion(consentMessageVersion ?? "") + } + + func setCCPAStatus(optedIn: Bool) { + VunglePrivacySettings.setCCPAStatus(optedIn) + } +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/ios/Classes/LiftoffPrivacyApi.g.swift b/packages/mediation/gma_mediation_liftoffmonetize/ios/Classes/LiftoffPrivacyApi.g.swift new file mode 100644 index 000000000..9c84145d3 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/ios/Classes/LiftoffPrivacyApi.g.swift @@ -0,0 +1,90 @@ +// Autogenerated from Pigeon (v17.0.0), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] +} + +private func isNullish(_ value: Any?) -> Bool { + return value is NSNull || value == nil +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return value as! T? +} +/// The generated classes set the channels to call the methods in the corresponding kotlin LiftoffPrivacyApi interface and swift LiftoffPrivacyApi protocol from the dart layer. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol LiftoffPrivacyApi { + /// Used to configure GDPR status on the Android or iOS Liftoff Monetize SDK + func setGDPRStatus(optedIn: Bool, consentMessageVersion: String?) throws + /// Used to configure CCPA consent on the Android or iOS Liftoff Monetize SDK + func setCCPAStatus(optedIn: Bool) throws +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class LiftoffPrivacyApiSetup { + /// The codec used by LiftoffPrivacyApi. + /// Sets up an instance of `LiftoffPrivacyApi` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: LiftoffPrivacyApi?) { + /// Used to configure GDPR status on the Android or iOS Liftoff Monetize SDK + let setGDPRStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.gma_mediation_liftoffmonetize.LiftoffPrivacyApi.setGDPRStatus", binaryMessenger: binaryMessenger) + if let api = api { + setGDPRStatusChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let optedInArg = args[0] as! Bool + let consentMessageVersionArg: String? = nilOrValue(args[1]) + do { + try api.setGDPRStatus(optedIn: optedInArg, consentMessageVersion: consentMessageVersionArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setGDPRStatusChannel.setMessageHandler(nil) + } + /// Used to configure CCPA consent on the Android or iOS Liftoff Monetize SDK + let setCCPAStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.gma_mediation_liftoffmonetize.LiftoffPrivacyApi.setCCPAStatus", binaryMessenger: binaryMessenger) + if let api = api { + setCCPAStatusChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let optedInArg = args[0] as! Bool + do { + try api.setCCPAStatus(optedIn: optedInArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setCCPAStatusChannel.setMessageHandler(nil) + } + } +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/ios/gma_mediation_liftoffmonetize.podspec b/packages/mediation/gma_mediation_liftoffmonetize/ios/gma_mediation_liftoffmonetize.podspec new file mode 100644 index 000000000..51d33fa14 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/ios/gma_mediation_liftoffmonetize.podspec @@ -0,0 +1,25 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint gma_mediation_liftoffmonetize.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'gma_mediation_liftoffmonetize' + s.version = '1.0.0' + s.summary = 'Google Mobile Ads Mediation of Liftoff Monetize.' + s.description = <<-DESC +Mediation Adapter for Liftoff Monetize to use with Google Mobile Ads. + DESC + s.homepage = 'https://developers.google.com/admob/flutter/mediation/liftoff-monetize' + s.license = { :file => '../LICENSE' } + s.author = { 'Google LLC' => 'mediation-support@google.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Public/**/*.h' + s.dependency 'GoogleMobileAdsMediationVungle', '~>7.3.2.0' + s.dependency 'Flutter' + s.platform = :ios, '12.0' + + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.swift_version = '5.0' +end diff --git a/packages/mediation/gma_mediation_liftoffmonetize/lib/gma_mediation_liftoffmonetize.dart b/packages/mediation/gma_mediation_liftoffmonetize/lib/gma_mediation_liftoffmonetize.dart new file mode 100644 index 000000000..0988861b1 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/lib/gma_mediation_liftoffmonetize.dart @@ -0,0 +1,29 @@ +// Copyright 2024 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 +// +// https://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 'package:gma_mediation_liftoffmonetize/liftoff_privacy_api.g.dart'; + +/// This class has entrypoint to call Liftoff Monetize's SDK APIs. +class GmaMediationLiftoffmonetize { + Future setGDPRStatus( + bool optedIn, + String? consentMessageVersion, + ) async { + await LiftoffPrivacyApi().setGDPRStatus(optedIn, consentMessageVersion); + } + + Future setCCPAStatus(bool optedIn) async { + await LiftoffPrivacyApi().setCCPAStatus(optedIn); + } +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/lib/liftoff_privacy_api.g.dart b/packages/mediation/gma_mediation_liftoffmonetize/lib/liftoff_privacy_api.g.dart new file mode 100644 index 000000000..6803cb6eb --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/lib/liftoff_privacy_api.g.dart @@ -0,0 +1,80 @@ +// Autogenerated from Pigeon (v17.0.0), do not edit directly. +// See also: https://pub.dev/packages/pigeon +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers + +import 'dart:async'; +import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; + +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; +import 'package:flutter/services.dart'; + +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + +/// The generated classes set the channels to call the methods in the corresponding kotlin LiftoffPrivacyApi interface and swift LiftoffPrivacyApi protocol from the dart layer. +class LiftoffPrivacyApi { + /// Constructor for [LiftoffPrivacyApi]. The [binaryMessenger] named argument is + /// available for dependency injection. If it is left null, the default + /// BinaryMessenger will be used which routes to the host platform. + LiftoffPrivacyApi({BinaryMessenger? binaryMessenger}) + : __pigeon_binaryMessenger = binaryMessenger; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); + + /// Used to configure GDPR status on the Android or iOS Liftoff Monetize SDK + Future setGDPRStatus( + bool optedIn, String? consentMessageVersion) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.gma_mediation_liftoffmonetize.LiftoffPrivacyApi.setGDPRStatus'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([optedIn, consentMessageVersion]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } + + /// Used to configure CCPA consent on the Android or iOS Liftoff Monetize SDK + Future setCCPAStatus(bool optedIn) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.gma_mediation_liftoffmonetize.LiftoffPrivacyApi.setCCPAStatus'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([optedIn]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/pigeons/liftoff_privacy_api.dart b/packages/mediation/gma_mediation_liftoffmonetize/pigeons/liftoff_privacy_api.dart new file mode 100644 index 000000000..5e69401fa --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/pigeons/liftoff_privacy_api.dart @@ -0,0 +1,41 @@ +// Copyright 2024 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 +// +// https://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 'package:pigeon/pigeon.dart'; + +@ConfigurePigeon( + PigeonOptions( + dartOut: 'lib/liftoff_privacy_api.g.dart', + dartOptions: DartOptions(), + kotlinOut: + 'android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_liftoffmonetize/LiftoffPrivacyApi.g.kt', + kotlinOptions: KotlinOptions( + package: + 'io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize', + ), + swiftOut: 'ios/Classes/LiftoffPrivacyApi.g.swift', + swiftOptions: SwiftOptions(), + dartPackageName: 'gma_mediation_liftoffmonetize', + ), +) +@HostApi() + +/// The generated classes set the channels to call the methods in the corresponding kotlin LiftoffPrivacyApi interface and swift LiftoffPrivacyApi protocol from the dart layer. +abstract class LiftoffPrivacyApi { + /// Used to configure GDPR status on the Android or iOS Liftoff Monetize SDK + void setGDPRStatus(bool optedIn, String? consentMessageVersion); + + /// Used to configure CCPA consent on the Android or iOS Liftoff Monetize SDK + void setCCPAStatus(bool optedIn); +} diff --git a/packages/mediation/gma_mediation_liftoffmonetize/pubspec.yaml b/packages/mediation/gma_mediation_liftoffmonetize/pubspec.yaml new file mode 100644 index 000000000..8b28d7305 --- /dev/null +++ b/packages/mediation/gma_mediation_liftoffmonetize/pubspec.yaml @@ -0,0 +1,30 @@ +name: gma_mediation_liftoffmonetize +description: "Mediation Adapter that enables sending ad requests to the LiftoffMonetize ad network using the google_mobile_ads plugin." +version: 1.0.0 +repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/mediation/gma_mediation_liftoffmonetize + +environment: + sdk: '>=3.2.5 <4.0.0' + flutter: '>=3.3.0' + +dependencies: + flutter: + sdk: flutter + google_mobile_ads: ^5.1.0 + plugin_platform_interface: ^2.0.2 + +dev_dependencies: + flutter_lints: ^2.0.0 + flutter_test: + sdk: flutter + lint: ^2.3.0 + pigeon: ^17.0.0 + +flutter: + plugin: + platforms: + android: + package: io.flutter.plugins.googlemobileads.mediation.gma_mediation_liftoffmonetize + pluginClass: GmaMediationLiftoffmonetizePlugin + ios: + pluginClass: GmaMediationLiftoffmonetizePlugin diff --git a/packages/mediation/gma_mediation_meta/CHANGELOG.md b/packages/mediation/gma_mediation_meta/CHANGELOG.md index 1a6ebec66..070008cad 100644 --- a/packages/mediation/gma_mediation_meta/CHANGELOG.md +++ b/packages/mediation/gma_mediation_meta/CHANGELOG.md @@ -1,5 +1,15 @@ -## 1.0.0 +## Meta Audience Network Flutter Mediation Adapter Changelog + +#### 1.0.1 + +* Added dart class to allow correct compatibility analysis with host platforms +* Verified compatibility with Meta Android adapter version 6.17.0.0 +* Verified compatibility with Meta iOS adapter version 6.15.0.0 +* Built and tested with the Google Mobile Ads Flutter Plugin version 5.1.0. + +#### 1.0.0 * Initial release. * Verified compatibility with Meta Android adapter version 6.17.0.0 * Verified compatibility with Meta iOS adapter version 6.15.0.0 +* Built and tested with the Google Mobile Ads Flutter Plugin version 5.0.0. diff --git a/packages/mediation/gma_mediation_meta/LICENSE b/packages/mediation/gma_mediation_meta/LICENSE index d64569567..e58143fcc 100644 --- a/packages/mediation/gma_mediation_meta/LICENSE +++ b/packages/mediation/gma_mediation_meta/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2024 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/mediation/gma_mediation_meta/README.md b/packages/mediation/gma_mediation_meta/README.md index 0567bc8d3..49d095dff 100644 --- a/packages/mediation/gma_mediation_meta/README.md +++ b/packages/mediation/gma_mediation_meta/README.md @@ -10,7 +10,6 @@ mediation of the Meta Ad Network through the Google Mobile Ads SDK. For instructions on how to use with the google_mobile_ads plugin, refer to the developer guide for [Meta Audience Network](https://developers.google.com/admob/flutter/mediation/meta). - ## Downloads See [pub.dev](https://pub.dev/packages/gma_mediation_meta/versions) for the diff --git a/packages/mediation/gma_mediation_meta/ios/gma_mediation_meta.podspec b/packages/mediation/gma_mediation_meta/ios/gma_mediation_meta.podspec index 9c5d8d93b..b0df40b70 100644 --- a/packages/mediation/gma_mediation_meta/ios/gma_mediation_meta.podspec +++ b/packages/mediation/gma_mediation_meta/ios/gma_mediation_meta.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'gma_mediation_meta' - s.version = '1.0.0' + s.version = '1.0.1' s.summary = 'Google Mobile Ads Mediation of Meta Audience Network.' s.description = <<-DESC Mediation Adapter for Meta Audience Network to use with Google Mobile Ads. diff --git a/packages/mediation/gma_mediation_meta/lib/gma_mediation_meta.dart b/packages/mediation/gma_mediation_meta/lib/gma_mediation_meta.dart new file mode 100644 index 000000000..436fe07ac --- /dev/null +++ b/packages/mediation/gma_mediation_meta/lib/gma_mediation_meta.dart @@ -0,0 +1,16 @@ +// Copyright 2024 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 +// +// https://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. + +/// This empty class is needed to allow correct compatibility analysis with host platforms. +class GmaMediationUnity {} diff --git a/packages/mediation/gma_mediation_meta/pubspec.yaml b/packages/mediation/gma_mediation_meta/pubspec.yaml index c074a65c4..83de4f460 100644 --- a/packages/mediation/gma_mediation_meta/pubspec.yaml +++ b/packages/mediation/gma_mediation_meta/pubspec.yaml @@ -1,6 +1,6 @@ name: gma_mediation_meta description: "Mediation Adapter that enables sending ad requests to the Meta Audience Network ad network using the google_mobile_ads plugin." -version: 1.0.0 +version: 1.0.1 repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/mediation/gma_mediation_meta environment: @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - google_mobile_ads: ^5.0.0 + google_mobile_ads: ^5.1.0 plugin_platform_interface: ^2.0.2 dev_dependencies: diff --git a/packages/mediation/gma_mediation_mintegral/.gitignore b/packages/mediation/gma_mediation_mintegral/.gitignore new file mode 100644 index 000000000..ac5aa9893 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/.gitignore @@ -0,0 +1,29 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +build/ diff --git a/packages/mediation/gma_mediation_mintegral/.metadata b/packages/mediation/gma_mediation_mintegral/.metadata new file mode 100644 index 000000000..a7455847d --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/.metadata @@ -0,0 +1,33 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "300451adae589accbece3490f4396f10bdf15e6e" + channel: "stable" + +project_type: plugin + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 300451adae589accbece3490f4396f10bdf15e6e + base_revision: 300451adae589accbece3490f4396f10bdf15e6e + - platform: android + create_revision: 300451adae589accbece3490f4396f10bdf15e6e + base_revision: 300451adae589accbece3490f4396f10bdf15e6e + - platform: ios + create_revision: 300451adae589accbece3490f4396f10bdf15e6e + base_revision: 300451adae589accbece3490f4396f10bdf15e6e + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/mediation/gma_mediation_mintegral/CHANGELOG.md b/packages/mediation/gma_mediation_mintegral/CHANGELOG.md new file mode 100644 index 000000000..95d14b9e7 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/CHANGELOG.md @@ -0,0 +1,8 @@ +## Mintegral Flutter Mediation Adapter Changelog + +#### 1.0.0 + +* Initial release. +* Verified compatibility with Mintegral Android adapter version 16.7.21.0. +* Verified compatibility with Mintegral iOS adapter version 7.6.3.0. +* Built and tested with the Google Mobile Ads Flutter Plugin version 5.1.0. diff --git a/packages/mediation/gma_mediation_mintegral/LICENSE b/packages/mediation/gma_mediation_mintegral/LICENSE new file mode 100644 index 000000000..e58143fcc --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/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 2024 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. diff --git a/packages/mediation/gma_mediation_mintegral/README.md b/packages/mediation/gma_mediation_mintegral/README.md new file mode 100644 index 000000000..b91dc9771 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/README.md @@ -0,0 +1,36 @@ +# Google Mobile Ads Mediation of Mintegral for Flutter + +[![gma_mediation_mintegral](https://github.com/googleads/googleads-mobile-flutter/actions/workflows/google_mobile_ads.yaml/badge.svg)](https://github.com/googleads/googleads-mobile-flutter/actions/workflows/google_mobile_ads.yaml) + +This repository contains the source code for the Mediation Mintegral Flutter +plugin to be used with the Google Mobile Ads plugin. It enables mediation of the +Mintegral Ad Network through the Google Mobile Ads SDK. + +This plugin use the [Pigeon Flutter plugin](https://pub.dev/packages/pigeon) to +generate the classes that bridge the dart layer with each platform's code. +To add or modify the third party sdk, use the classes in the pigeons folder +following [this guide](https://github.com/flutter/packages/blob/main/packages/pigeon/example/README.md). + +## Documentation +For instructions on how to use with the google_mobile_ads plugin, refer to the +developer guide for [Mintegral](https://developers.google.com/admob/flutter/mediation/mintegral). + +## Downloads + +See [pub.dev](https://pub.dev/packages/gma_mediation_mintegral/versions) for the +latest releases of the plugin. + +## Suggesting improvements + +To file bugs, make feature requests, or to suggest other improvements, please +use [github's issue tracker](https://github.com/googleads/googleads-mobile-flutter/issues). + + +## Other resources + +* [AdMob help center](https://support.google.com/admob/?hl=en#topic=7383088) +* [Ad Manager help center](https://support.google.com/admanager/?hl=en#topic=7505988) + +## License + +[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) \ No newline at end of file diff --git a/packages/mediation/gma_mediation_mintegral/analysis_options.yaml b/packages/mediation/gma_mediation_mintegral/analysis_options.yaml new file mode 100644 index 000000000..08808f3fb --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/analysis_options.yaml @@ -0,0 +1,19 @@ +# Copyright 2021 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 +# +# https://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. + +include: package:lint/package.yaml + +analyzer: + exclude: + - '**.g.dart' diff --git a/packages/mediation/gma_mediation_mintegral/android/.gitignore b/packages/mediation/gma_mediation_mintegral/android/.gitignore new file mode 100644 index 000000000..161bdcdaf --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/android/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.cxx diff --git a/packages/mediation/gma_mediation_mintegral/android/build.gradle b/packages/mediation/gma_mediation_mintegral/android/build.gradle new file mode 100644 index 000000000..d2ef234b6 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/android/build.gradle @@ -0,0 +1,69 @@ +group 'io.flutter.plugins.googlemobileads.mediation.gma_mediation_mintegral' +version '1.0-SNAPSHOT' + +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.3.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +android { + if (project.android.hasProperty("namespace")) { + namespace 'io.flutter.plugins.googlemobileads.mediation.gma_mediation_mintegral' + } + + compileSdk 34 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + test.java.srcDirs += 'src/test/kotlin' + } + + defaultConfig { + minSdkVersion 21 + } + + dependencies { + implementation 'com.google.ads.mediation:mintegral:16.7.21.0' + testImplementation 'org.jetbrains.kotlin:kotlin-test' + testImplementation 'org.mockito:mockito-core:5.0.0' + } + + testOptions { + unitTests.all { + useJUnitPlatform() + + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + outputs.upToDateWhen {false} + showStandardStreams = true + } + } + } +} diff --git a/packages/mediation/gma_mediation_mintegral/android/gradle/wrapper/gradle-wrapper.properties b/packages/mediation/gma_mediation_mintegral/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..3fa8f862f --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/packages/mediation/gma_mediation_mintegral/android/settings.gradle b/packages/mediation/gma_mediation_mintegral/android/settings.gradle new file mode 100644 index 000000000..2506c438f --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'gma_mediation_mintegral' diff --git a/packages/mediation/gma_mediation_mintegral/android/src/main/AndroidManifest.xml b/packages/mediation/gma_mediation_mintegral/android/src/main/AndroidManifest.xml new file mode 100644 index 000000000..81318e8ea --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + diff --git a/packages/mediation/gma_mediation_mintegral/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_mintegral/GmaMediationMintegralPlugin.kt b/packages/mediation/gma_mediation_mintegral/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_mintegral/GmaMediationMintegralPlugin.kt new file mode 100644 index 000000000..3942d1435 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_mintegral/GmaMediationMintegralPlugin.kt @@ -0,0 +1,24 @@ +// Copyright 2024 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 +// +// https://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. + +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_mintegral + +import io.flutter.embedding.engine.plugins.FlutterPlugin + +/** Class that serves as bridge to get the adapter android dependency and make it available to a Flutter app. */ +class GmaMediationMintegralPlugin: FlutterPlugin { + override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {} + + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {} +} diff --git a/packages/mediation/gma_mediation_mintegral/example/.gitignore b/packages/mediation/gma_mediation_mintegral/example/.gitignore new file mode 100644 index 000000000..29a3a5017 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/packages/mediation/gma_mediation_mintegral/example/README.md b/packages/mediation/gma_mediation_mintegral/example/README.md new file mode 100644 index 000000000..c5a923a34 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/README.md @@ -0,0 +1,17 @@ +# gma_mediation_mintegral_example + +Learn how to integrate with your app that uses the [google_mobile_ads](https://pub.dev/packages/google_mobile_ads) plugin +by following the [development guide](https://developers.google.com/admob/flutter/mediation/mintegral). + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/packages/mediation/gma_mediation_mintegral/example/analysis_options.yaml b/packages/mediation/gma_mediation_mintegral/example/analysis_options.yaml new file mode 100644 index 000000000..0d2902135 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/mediation/gma_mediation_mintegral/example/android/.gitignore b/packages/mediation/gma_mediation_mintegral/example/android/.gitignore new file mode 100644 index 000000000..6f568019d --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/build.gradle b/packages/mediation/gma_mediation_mintegral/example/android/app/build.gradle new file mode 100644 index 000000000..a31107e11 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/app/build.gradle @@ -0,0 +1,67 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +android { + namespace "io.flutter.plugins.googlemobileads.mediation.gma_mediation_mintegral_example" + compileSdk flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "io.flutter.plugins.googlemobileads.mediation.gma_mediation_mintegral_example" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies {} diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/debug/AndroidManifest.xml b/packages/mediation/gma_mediation_mintegral/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/AndroidManifest.xml b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..6ff82a89a --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_mintegral_example/MainActivity.kt b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_mintegral_example/MainActivity.kt new file mode 100644 index 000000000..fe2a264cc --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_mintegral_example/MainActivity.kt @@ -0,0 +1,5 @@ +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_mintegral_example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f74085f3f --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/drawable/launch_background.xml b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..db77bb4b7 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..17987b79b Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..09d439148 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..d5f1c8d34 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..4d6372eeb Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/values-night/styles.xml b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..06952be74 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/values/styles.xml b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..cb1ef8805 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/android/app/src/profile/AndroidManifest.xml b/packages/mediation/gma_mediation_mintegral/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/android/build.gradle b/packages/mediation/gma_mediation_mintegral/example/android/build.gradle new file mode 100644 index 000000000..bc157bd1a --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/build.gradle @@ -0,0 +1,18 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/mediation/gma_mediation_mintegral/example/android/gradle.properties b/packages/mediation/gma_mediation_mintegral/example/android/gradle.properties new file mode 100644 index 000000000..598d13fee --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx4G +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/mediation/gma_mediation_mintegral/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/mediation/gma_mediation_mintegral/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..e1ca574ef --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/packages/mediation/gma_mediation_mintegral/example/android/settings.gradle b/packages/mediation/gma_mediation_mintegral/example/android/settings.gradle new file mode 100644 index 000000000..1d6d19b7f --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/android/settings.gradle @@ -0,0 +1,26 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false +} + +include ":app" diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/.gitignore b/packages/mediation/gma_mediation_mintegral/example/ios/.gitignore new file mode 100644 index 000000000..7a7f9873a --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Flutter/AppFrameworkInfo.plist b/packages/mediation/gma_mediation_mintegral/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..7c5696400 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Flutter/Debug.xcconfig b/packages/mediation/gma_mediation_mintegral/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..ec97fc6f3 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Flutter/Release.xcconfig b/packages/mediation/gma_mediation_mintegral/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..c4855bfe2 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Podfile b/packages/mediation/gma_mediation_mintegral/example/ios/Podfile new file mode 100644 index 000000000..38b28ff0d --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/samples/admob/adaptive_banner_example/ios/Runner.xcodeproj/project.pbxproj b/packages/mediation/gma_mediation_mintegral/example/ios/Runner.xcodeproj/project.pbxproj similarity index 93% rename from samples/admob/adaptive_banner_example/ios/Runner.xcodeproj/project.pbxproj rename to packages/mediation/gma_mediation_mintegral/example/ios/Runner.xcodeproj/project.pbxproj index 1798f98ee..2395b8902 100644 --- a/samples/admob/adaptive_banner_example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner.xcodeproj/project.pbxproj @@ -8,12 +8,12 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -42,6 +42,8 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -53,11 +55,16 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 7A44235209E3F3F0A75F0C6A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -68,6 +75,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -79,14 +94,6 @@ name = Flutter; sourceTree = ""; }; - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( @@ -129,8 +136,8 @@ buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( 331C807D294A63A400263BE5 /* Sources */, - 331C807E294A63A400263BE5 /* Frameworks */, 331C807F294A63A400263BE5 /* Resources */, + 7A44235209E3F3F0A75F0C6A /* Frameworks */, ); buildRules = ( ); @@ -169,7 +176,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -308,6 +315,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -337,6 +345,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -345,7 +354,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -361,13 +370,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = CSTR6SUWN9; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.adaptiveBannerExample; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationMintegralExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -377,14 +387,13 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.adaptiveBannerExample.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationMintegralExample.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -395,14 +404,13 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.adaptiveBannerExample.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationMintegralExample.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -411,14 +419,13 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.adaptiveBannerExample.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationMintegralExample.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -429,6 +436,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -458,6 +466,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -472,7 +481,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -484,6 +493,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -513,6 +523,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -521,7 +532,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -539,13 +550,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = CSTR6SUWN9; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.adaptiveBannerExample; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationMintegralExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -561,13 +573,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = CSTR6SUWN9; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.adaptiveBannerExample; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationMintegralExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/samples/admob/adaptive_banner_example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/mediation/gma_mediation_mintegral/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 71% rename from samples/admob/adaptive_banner_example/ios/Runner.xcworkspace/contents.xcworkspacedata rename to packages/mediation/gma_mediation_mintegral/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16e..919434a62 100644 --- a/samples/admob/adaptive_banner_example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/mediation/gma_mediation_mintegral/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..21a3cc14c --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/AppDelegate.swift b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..70693e4a8 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000..dc9ada472 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000..7353c41ec Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000..797d452e4 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000..6ed2d933e Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000..4cd7b0099 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000..fe730945a Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000..321773cd8 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000..797d452e4 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000..502f463a9 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000..0ec303439 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000..0ec303439 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000..e9f5fea27 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000..84ac32ae7 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000..8953cba09 Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000..0467bf12a Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Base.lproj/Main.storyboard b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Info.plist b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Info.plist new file mode 100644 index 000000000..e70f37d3a --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Gma Mediation Mintegral + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + gma_mediation_mintegral_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + GADApplicationIdentifier + ca-app-pub-3940256099942544~1458002511 + + diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Runner-Bridging-Header.h b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..308a2a560 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/mediation/gma_mediation_mintegral/example/ios/RunnerTests/RunnerTests.swift b/packages/mediation/gma_mediation_mintegral/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000..13eefdb42 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,5 @@ +import XCTest + +@testable import gma_mediation_mintegral + +class RunnerTests: XCTestCase {} diff --git a/packages/mediation/gma_mediation_mintegral/example/lib/main.dart b/packages/mediation/gma_mediation_mintegral/example/lib/main.dart new file mode 100644 index 000000000..665bfe31b --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/lib/main.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatefulWidget { + const MyApp({super.key}); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('Plugin example app'), + ), + body: const Center( + child: Text('Test app'), + ), + ), + ); + } +} diff --git a/packages/mediation/gma_mediation_mintegral/example/pubspec.yaml b/packages/mediation/gma_mediation_mintegral/example/pubspec.yaml new file mode 100644 index 000000000..a7973d0d6 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/example/pubspec.yaml @@ -0,0 +1,85 @@ +name: gma_mediation_mintegral_example +description: "Demonstrates how to use the gma_mediation_mintegral plugin." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +environment: + sdk: '>=3.3.3 <4.0.0' + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + gma_mediation_mintegral: + # When depending on this package from a real application you should use: + # gma_mediation_mintegral: ^x.y.z + # See https://dart.dev/tools/pub/dependencies#version-constraints + # The example app is bundled with the plugin so we use a path dependency on + # the parent directory to use the current plugin's version. + path: ../ + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.6 + +dev_dependencies: + integration_test: + sdk: flutter + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^3.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/mediation/gma_mediation_mintegral/ios/.gitignore b/packages/mediation/gma_mediation_mintegral/ios/.gitignore new file mode 100644 index 000000000..0c885071e --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/ios/.gitignore @@ -0,0 +1,38 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig +/Flutter/ephemeral/ +/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/packages/mediation/gma_mediation_mintegral/ios/Assets/.gitkeep b/packages/mediation/gma_mediation_mintegral/ios/Assets/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/packages/mediation/gma_mediation_mintegral/ios/Classes/GmaMediationMintegralPlugin.swift b/packages/mediation/gma_mediation_mintegral/ios/Classes/GmaMediationMintegralPlugin.swift new file mode 100644 index 000000000..7c33aea29 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/ios/Classes/GmaMediationMintegralPlugin.swift @@ -0,0 +1,20 @@ +// Copyright 2024 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 +// +// https://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 Flutter + +/// Class that serves as bridge to get the adapter iOS dependency and make it available to a Flutter app. +public class GmaMediationMintegralPlugin: NSObject, FlutterPlugin { + public static func register(with registrar: FlutterPluginRegistrar) {} +} diff --git a/packages/mediation/gma_mediation_mintegral/ios/gma_mediation_mintegral.podspec b/packages/mediation/gma_mediation_mintegral/ios/gma_mediation_mintegral.podspec new file mode 100644 index 000000000..280a45748 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/ios/gma_mediation_mintegral.podspec @@ -0,0 +1,25 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint gma_mediation_mintegral.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'gma_mediation_mintegral' + s.version = '1.0.0' + s.summary = 'Google Mobile Ads Mediation of Mintegral.' + s.description = <<-DESC +Mediation Adapter for Mintegral to use with Google Mobile Ads. + DESC + s.homepage = 'https://developers.google.com/admob/flutter/mediation/mintegral' + s.license = { :file => '../LICENSE' } + s.author = { 'Google LLC' => 'mediation-support@google.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + s.dependency 'GoogleMobileAdsMediationMintegral', '~>7.6.3.0' + s.platform = :ios, '12.0' + + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.swift_version = '5.0' +end diff --git a/packages/mediation/gma_mediation_mintegral/lib/gma_mediation_mintegral.dart b/packages/mediation/gma_mediation_mintegral/lib/gma_mediation_mintegral.dart new file mode 100644 index 000000000..149410acd --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/lib/gma_mediation_mintegral.dart @@ -0,0 +1,16 @@ +// Copyright 2024 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 +// +// https://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. + +/// This empty class is needed to allow correct compatibility analysis with host platforms. +class GmaMediationMintegral {} diff --git a/packages/mediation/gma_mediation_mintegral/pubspec.yaml b/packages/mediation/gma_mediation_mintegral/pubspec.yaml new file mode 100644 index 000000000..ffecd91f4 --- /dev/null +++ b/packages/mediation/gma_mediation_mintegral/pubspec.yaml @@ -0,0 +1,29 @@ +name: gma_mediation_mintegral +description: "Mediation Adapter that enables sending ad requests to the Mintegral ad network using the google_mobile_ads plugin." +version: 1.0.0 +repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/mediation/gma_mediation_mintegral + +environment: + sdk: '>=3.3.3 <4.0.0' + flutter: '>=3.3.0' + +dependencies: + flutter: + sdk: flutter + google_mobile_ads: ^5.1.0 + plugin_platform_interface: ^2.0.2 + +dev_dependencies: + flutter_lints: ^3.0.0 + flutter_test: + sdk: flutter + lint: ^2.3.0 + +flutter: + plugin: + platforms: + android: + package: io.flutter.plugins.googlemobileads.mediation.gma_mediation_mintegral + pluginClass: GmaMediationMintegralPlugin + ios: + pluginClass: GmaMediationMintegralPlugin diff --git a/packages/mediation/gma_mediation_unity/.gitignore b/packages/mediation/gma_mediation_unity/.gitignore new file mode 100644 index 000000000..ac5aa9893 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/.gitignore @@ -0,0 +1,29 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +build/ diff --git a/packages/mediation/gma_mediation_unity/.metadata b/packages/mediation/gma_mediation_unity/.metadata new file mode 100644 index 000000000..5a15fe0d0 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/.metadata @@ -0,0 +1,33 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "41456452f29d64e8deb623a3c927524bcf9f111b" + channel: "stable" + +project_type: plugin + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + - platform: android + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + - platform: ios + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/mediation/gma_mediation_unity/CHANGELOG.md b/packages/mediation/gma_mediation_unity/CHANGELOG.md new file mode 100644 index 000000000..da6394c99 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/CHANGELOG.md @@ -0,0 +1,6 @@ +## Unity Ads Flutter Mediation Adapter Changelog + +#### Version 1.0.0 +- Initial release. +- Verified compatibility with Unity Android adapter version 4.10.0.0 +- Verified compatibility with Unity iOS adapter version 4.10.0.0 diff --git a/packages/mediation/gma_mediation_unity/LICENSE b/packages/mediation/gma_mediation_unity/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/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 [yyyy] [name of copyright owner] + + 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/packages/mediation/gma_mediation_unity/README.md b/packages/mediation/gma_mediation_unity/README.md new file mode 100644 index 000000000..d77c3eeb0 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/README.md @@ -0,0 +1,36 @@ +# Google Mobile Ads Mediation of Unity Ads for Flutter + +[![gma_mediation_unity](https://github.com/googleads/googleads-mobile-flutter/actions/workflows/google_mobile_ads.yaml/badge.svg)](https://github.com/googleads/googleads-mobile-flutter/actions/workflows/google_mobile_ads.yaml) + +This repository contains the source code for the Mediation Unity Ads Flutter +plugin to be used with the Google Mobile Ads plugin. It enables mediation of the +Unity Ad Network through the Google Mobile Ads SDK. + +This plugin use the [Pigeon Flutter plugin](https://pub.dev/packages/pigeon) to +generate the classes that bridge the dart layer with each platform's code. +To add or modify the third party sdk, use the classes in the pigeons folder +following [this guide](https://github.com/flutter/packages/blob/main/packages/pigeon/example/README.md). + +## Documentation +For instructions on how to use with the google_mobile_ads plugin, refer to the +developer guide for [Unity Ads](https://developers.google.com/admob/flutter/mediation/unity). + +## Downloads + +See [pub.dev](https://pub.dev/packages/gma_mediation_unity/versions) for the +latest releases of the plugin. + +## Suggesting improvements + +To file bugs, make feature requests, or to suggest other improvements, please +use [github's issue tracker](https://github.com/googleads/googleads-mobile-flutter/issues). + + +## Other resources + +* [AdMob help center](https://support.google.com/admob/?hl=en#topic=7383088) +* [Ad Manager help center](https://support.google.com/admanager/?hl=en#topic=7505988) + +## License + +[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) \ No newline at end of file diff --git a/packages/mediation/gma_mediation_unity/analysis_options.yaml b/packages/mediation/gma_mediation_unity/analysis_options.yaml new file mode 100644 index 000000000..0567a049c --- /dev/null +++ b/packages/mediation/gma_mediation_unity/analysis_options.yaml @@ -0,0 +1,19 @@ +#Copyright 2024 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 +# +#https://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. + +include: package:lint/package.yaml + +analyzer: + exclude: + - '**.g.dart' \ No newline at end of file diff --git a/packages/mediation/gma_mediation_unity/android/.gitignore b/packages/mediation/gma_mediation_unity/android/.gitignore new file mode 100644 index 000000000..161bdcdaf --- /dev/null +++ b/packages/mediation/gma_mediation_unity/android/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.cxx diff --git a/packages/mediation/gma_mediation_unity/android/build.gradle b/packages/mediation/gma_mediation_unity/android/build.gradle new file mode 100644 index 000000000..cdbd8591c --- /dev/null +++ b/packages/mediation/gma_mediation_unity/android/build.gradle @@ -0,0 +1,81 @@ +group 'io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity' +version '1.0-SNAPSHOT' + +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:8.0.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +android { + if (project.android.hasProperty("namespace")) { + namespace 'io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity' + } + + compileSdkVersion 33 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + test.java.srcDirs += 'src/test/kotlin' + } + + defaultConfig { + minSdkVersion 21 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + dependencies { + implementation 'com.unity3d.ads:unity-ads:4.10.0' + implementation 'com.google.ads.mediation:unity:4.10.0.0' + testImplementation 'junit:junit:4.13.2' + testImplementation 'androidx.test:core:1.5.0' + testImplementation 'androidx.test:core-ktx:1.5.0' + testImplementation 'androidx.test.ext:junit:1.1.5' + testImplementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.20' + testImplementation 'org.mockito:mockito-core:5.5.0' + testImplementation 'org.mockito.kotlin:mockito-kotlin:5.1.0' + testImplementation 'org.robolectric:robolectric:4.10.3' + } + + testOptions { + unitTests.all { + useJUnit() + + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + outputs.upToDateWhen {false} + showStandardStreams = true + } + } + unitTests { + includeAndroidResources = true + unitTests.returnDefaultValues = true + } + } +} diff --git a/packages/mediation/gma_mediation_unity/android/gradle.properties b/packages/mediation/gma_mediation_unity/android/gradle.properties new file mode 100644 index 000000000..94e8c9d9a --- /dev/null +++ b/packages/mediation/gma_mediation_unity/android/gradle.properties @@ -0,0 +1,15 @@ +## For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx1024m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +#Fri Aug 06 00:15:03 EDT 2021 +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/mediation/gma_mediation_unity/android/gradle/wrapper/gradle-wrapper.properties b/packages/mediation/gma_mediation_unity/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..42defcc94 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +networkTimeout=10000 +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/packages/mediation/gma_mediation_unity/android/settings.gradle b/packages/mediation/gma_mediation_unity/android/settings.gradle new file mode 100644 index 000000000..287d994f2 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'gma_mediation_unity' diff --git a/packages/mediation/gma_mediation_unity/android/src/main/AndroidManifest.xml b/packages/mediation/gma_mediation_unity/android/src/main/AndroidManifest.xml new file mode 100644 index 000000000..52392445f --- /dev/null +++ b/packages/mediation/gma_mediation_unity/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + diff --git a/packages/mediation/gma_mediation_unity/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/GmaMediationUnityPlugin.kt b/packages/mediation/gma_mediation_unity/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/GmaMediationUnityPlugin.kt new file mode 100644 index 000000000..7b463e165 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/GmaMediationUnityPlugin.kt @@ -0,0 +1,61 @@ +// Copyright 2024 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 +// +// https://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. + +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity + +import android.content.Context +import com.unity3d.ads.metadata.MetaData +import io.flutter.embedding.engine.plugins.FlutterPlugin +import io.flutter.embedding.engine.plugins.activity.ActivityAware +import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding + +/** GmaMediationUnityPlugin manages UnityPrivacyApi and implements the needed methods. */ +class GmaMediationUnityPlugin: FlutterPlugin, ActivityAware, UnityPrivacyApi { + private lateinit var context: Context + + override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + context = flutterPluginBinding.applicationContext + UnityPrivacyApi.setUp(flutterPluginBinding.binaryMessenger, this) + } + + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { + UnityPrivacyApi.setUp(binding.binaryMessenger, null) + } + + override fun onDetachedFromActivity() {} + + override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {} + + override fun onAttachedToActivity(binding: ActivityPluginBinding) {} + + override fun onDetachedFromActivityForConfigChanges() {} + + override fun setGDPRConsent(gdprConsent: Boolean) { + val gdprMetaData = UnityApiWrapper.createMetaData(context) + gdprMetaData.set("gdpr.consent", gdprConsent) + gdprMetaData.commit() + } + + override fun setCCPAConsent(ccpaConsent: Boolean) { + val ccpaMetaData = UnityApiWrapper.createMetaData(context) + ccpaMetaData.set("privacy.consent", ccpaConsent) + ccpaMetaData.commit() + } +} + +/** Wrapper singleton to enable mocking of [MetaData] class for unit testing. */ +object UnityApiWrapper { + @JvmStatic + fun createMetaData(context: Context) = MetaData(context) +} diff --git a/packages/mediation/gma_mediation_unity/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/UnityPrivacyApi.g.kt b/packages/mediation/gma_mediation_unity/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/UnityPrivacyApi.g.kt new file mode 100644 index 000000000..67743bf89 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/UnityPrivacyApi.g.kt @@ -0,0 +1,105 @@ +// Autogenerated from Pigeon (v18.0.0), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity + +import android.util.Log +import io.flutter.plugin.common.BasicMessageChannel +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMessageCodec +import java.io.ByteArrayOutputStream +import java.nio.ByteBuffer + +private fun wrapResult(result: Any?): List { + return listOf(result) +} + +private fun wrapError(exception: Throwable): List { + if (exception is FlutterError) { + return listOf( + exception.code, + exception.message, + exception.details + ) + } else { + return listOf( + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) + ) + } +} + +/** + * Error class for passing custom error details to Flutter via a thrown PlatformException. + * @property code The error code. + * @property message The error message. + * @property details The error details. Must be a datatype supported by the api codec. + */ +class FlutterError ( + val code: String, + override val message: String? = null, + val details: Any? = null +) : Throwable() +/** + * The generated classes set the channels to call the methods in the corresponding kotlin UnityPrivacyApi interface and swift UnityPrivacyApi protocol from the dart layer. + * + * Generated interface from Pigeon that represents a handler of messages from Flutter. + */ +interface UnityPrivacyApi { + /** Used to configure GDPR consent on the Android or iOS Unity SDK */ + fun setGDPRConsent(gdprConsent: Boolean) + /** Used to configure CCPA consent on the Android or iOS Unity SDK */ + fun setCCPAConsent(ccpaConsent: Boolean) + + companion object { + /** The codec used by UnityPrivacyApi. */ + val codec: MessageCodec by lazy { + StandardMessageCodec() + } + /** Sets up an instance of `UnityPrivacyApi` to handle messages through the `binaryMessenger`. */ + @Suppress("UNCHECKED_CAST") + fun setUp(binaryMessenger: BinaryMessenger, api: UnityPrivacyApi?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.gma_mediation_unity.UnityPrivacyApi.setGDPRConsent$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val gdprConsentArg = args[0] as Boolean + var wrapped: List + try { + api.setGDPRConsent(gdprConsentArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.gma_mediation_unity.UnityPrivacyApi.setCCPAConsent$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val ccpaConsentArg = args[0] as Boolean + var wrapped: List + try { + api.setCCPAConsent(ccpaConsentArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } +} diff --git a/packages/mediation/gma_mediation_unity/android/src/test/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/GmaMediationUnityPluginTest.kt b/packages/mediation/gma_mediation_unity/android/src/test/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/GmaMediationUnityPluginTest.kt new file mode 100644 index 000000000..ad7fc4285 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/android/src/test/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/GmaMediationUnityPluginTest.kt @@ -0,0 +1,97 @@ +// Copyright 2024 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 +// +// https://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. + +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity + +import android.content.Context +import androidx.test.core.app.ApplicationProvider +import androidx.test.ext.junit.runners.AndroidJUnit4 +import com.unity3d.ads.metadata.MetaData +import io.flutter.embedding.engine.plugins.FlutterPlugin +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity.UnityApiWrapper.createMetaData +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.Mockito.mockStatic +import org.mockito.kotlin.doReturn +import org.mockito.kotlin.eq +import org.mockito.kotlin.mock +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever + +@RunWith(AndroidJUnit4::class) +internal class GmaMediationUnityPluginTest { + private val context = ApplicationProvider.getApplicationContext() + private val mockMetaData = mock() + private val mockBinaryMessenger = mock() + private val mockFlutterPluginBinding = mock { + on { applicationContext } doReturn context + on { binaryMessenger } doReturn mockBinaryMessenger + } + @Test + fun setGDPRConsent_withTrueValue_setsGDPRAndCommitsIt() { + val plugin = GmaMediationUnityPlugin() + mockStatic(UnityApiWrapper::class.java).use { + whenever(createMetaData(context)) doReturn mockMetaData + plugin.onAttachedToEngine(mockFlutterPluginBinding) + + plugin.setGDPRConsent(true) + + verify(mockMetaData).set(eq("gdpr.consent"), eq(true)) + verify(mockMetaData).commit() + } + } + + @Test + fun setGDPRConsent_withFalseValue_setsGDPRAndCommitsIt() { + val plugin = GmaMediationUnityPlugin() + mockStatic(UnityApiWrapper::class.java).use { + whenever(createMetaData(context)) doReturn mockMetaData + plugin.onAttachedToEngine(mockFlutterPluginBinding) + + plugin.setGDPRConsent(false) + + verify(mockMetaData).set(eq("gdpr.consent"), eq(false)) + verify(mockMetaData).commit() + } + } + + @Test + fun setCCPAConsent_withTrueValue_setsCCPAAndCommitsIt() { + val plugin = GmaMediationUnityPlugin() + mockStatic(UnityApiWrapper::class.java).use { + whenever(createMetaData(context)) doReturn mockMetaData + plugin.onAttachedToEngine(mockFlutterPluginBinding) + + plugin.setCCPAConsent(true) + + verify(mockMetaData).set(eq("privacy.consent"), eq(true)) + verify(mockMetaData).commit() + } + } + + @Test + fun setCCPAConsent_withFalseValue_setsCCPAAndCommitsIt() { + val plugin = GmaMediationUnityPlugin() + mockStatic(UnityApiWrapper::class.java).use { + whenever(createMetaData(context)) doReturn mockMetaData + plugin.onAttachedToEngine(mockFlutterPluginBinding) + + plugin.setCCPAConsent(false) + + verify(mockMetaData).set(eq("privacy.consent"), eq(false)) + verify(mockMetaData).commit() + } + } +} diff --git a/packages/mediation/gma_mediation_unity/example/.gitignore b/packages/mediation/gma_mediation_unity/example/.gitignore new file mode 100644 index 000000000..29a3a5017 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/packages/mediation/gma_mediation_unity/example/README.md b/packages/mediation/gma_mediation_unity/example/README.md new file mode 100644 index 000000000..b615ab635 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/README.md @@ -0,0 +1,17 @@ +# gma_mediation_unity_example + +Learn how to integrate with your app that uses the [google_mobile_ads](https://pub.dev/packages/google_mobile_ads) plugin +by following the [development guide](https://developers.google.com/admob/flutter/mediation/unity). + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/packages/mediation/gma_mediation_unity/example/analysis_options.yaml b/packages/mediation/gma_mediation_unity/example/analysis_options.yaml new file mode 100644 index 000000000..0d2902135 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/mediation/gma_mediation_unity/example/android/.gitignore b/packages/mediation/gma_mediation_unity/example/android/.gitignore new file mode 100644 index 000000000..6f568019d --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/samples/admob/adaptive_banner_example/android/app/build.gradle b/packages/mediation/gma_mediation_unity/example/android/app/build.gradle similarity index 77% rename from samples/admob/adaptive_banner_example/android/app/build.gradle rename to packages/mediation/gma_mediation_unity/example/android/app/build.gradle index da75643ff..d1e82dd7d 100644 --- a/samples/admob/adaptive_banner_example/android/app/build.gradle +++ b/packages/mediation/gma_mediation_unity/example/android/app/build.gradle @@ -23,17 +23,17 @@ if (flutterVersionName == null) { } android { - namespace "com.example.adaptive_banner_example" + namespace "io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity_example" compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_11.toString() } sourceSets { @@ -42,12 +42,11 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.adaptive_banner_example" + applicationId "io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity_example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion 21 - multiDexEnabled true - targetSdkVersion 33 + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -65,6 +64,4 @@ flutter { source '../..' } -dependencies { - implementation 'androidx.multidex:multidex:2.0.1' -} +dependencies {} diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/debug/AndroidManifest.xml b/packages/mediation/gma_mediation_unity/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/AndroidManifest.xml b/packages/mediation/gma_mediation_unity/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..2f4998325 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/samples/admob/adaptive_banner_example/android/app/src/main/kotlin/com/example/adaptive_banner_example/MainActivity.kt b/packages/mediation/gma_mediation_unity/example/android/app/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity_example/MainActivity.kt similarity index 54% rename from samples/admob/adaptive_banner_example/android/app/src/main/kotlin/com/example/adaptive_banner_example/MainActivity.kt rename to packages/mediation/gma_mediation_unity/example/android/app/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity_example/MainActivity.kt index 9125953d1..e9b4af123 100644 --- a/samples/admob/adaptive_banner_example/android/app/src/main/kotlin/com/example/adaptive_banner_example/MainActivity.kt +++ b/packages/mediation/gma_mediation_unity/example/android/app/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity_example/MainActivity.kt @@ -1,4 +1,4 @@ -package com.example.adaptive_banner_example +package io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity_example import io.flutter.embedding.android.FlutterActivity diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f74085f3f --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/drawable/launch_background.xml b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..db77bb4b7 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..17987b79b Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..09d439148 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..d5f1c8d34 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..4d6372eeb Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/values-night/styles.xml b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..06952be74 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/values/styles.xml b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..cb1ef8805 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/mediation/gma_mediation_unity/example/android/app/src/profile/AndroidManifest.xml b/packages/mediation/gma_mediation_unity/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/mediation/gma_mediation_unity/example/android/build.gradle b/packages/mediation/gma_mediation_unity/example/android/build.gradle new file mode 100644 index 000000000..e83fb5dac --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/build.gradle @@ -0,0 +1,30 @@ +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/mediation/gma_mediation_unity/example/android/gradle.properties b/packages/mediation/gma_mediation_unity/example/android/gradle.properties new file mode 100644 index 000000000..598d13fee --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx4G +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/mediation/gma_mediation_unity/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/mediation/gma_mediation_unity/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..3c472b99c --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/mediation/gma_mediation_unity/example/android/settings.gradle b/packages/mediation/gma_mediation_unity/example/android/settings.gradle new file mode 100644 index 000000000..7cd712855 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/android/settings.gradle @@ -0,0 +1,29 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } + + plugins { + id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false +} + +include ":app" diff --git a/packages/mediation/gma_mediation_unity/example/ios/.gitignore b/packages/mediation/gma_mediation_unity/example/ios/.gitignore new file mode 100644 index 000000000..7a7f9873a --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/mediation/gma_mediation_unity/example/ios/Flutter/AppFrameworkInfo.plist b/packages/mediation/gma_mediation_unity/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..7c5696400 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/packages/mediation/gma_mediation_unity/example/ios/Flutter/Debug.xcconfig b/packages/mediation/gma_mediation_unity/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..ec97fc6f3 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/mediation/gma_mediation_unity/example/ios/Flutter/Release.xcconfig b/packages/mediation/gma_mediation_unity/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..c4855bfe2 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/mediation/gma_mediation_unity/example/ios/Podfile b/packages/mediation/gma_mediation_unity/example/ios/Podfile new file mode 100644 index 000000000..bc006b859 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner.xcodeproj/project.pbxproj b/packages/mediation/gma_mediation_unity/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..cf7b2b53c --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,690 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* GmaMediationUnityPluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* GmaMediationUnityPluginTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* GmaMediationUnityPluginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GmaMediationUnityPluginTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 44A3A7E52B87F52500EBF1AF /* libswiftWebKit.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libswiftWebKit.tbd; path = usr/lib/swift/libswiftWebKit.tbd; sourceTree = SDKROOT; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F342EFA471C28ECE455CCD43 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* GmaMediationUnityPluginTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 44A3A7E42B87F52500EBF1AF /* Frameworks */ = { + isa = PBXGroup; + children = ( + 44A3A7E52B87F52500EBF1AF /* libswiftWebKit.tbd */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + DFB3F99572FC6F1315730A4B /* Pods */, + 44A3A7E42B87F52500EBF1AF /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + DFB3F99572FC6F1315730A4B /* Pods */ = { + isa = PBXGroup; + children = ( + ); + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + F342EFA471C28ECE455CCD43 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* GmaMediationUnityPluginTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + /usr/lib/swift, + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(SDKROOT)/usr/lib/swift", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationUnityExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "$(LD_RUNPATH_SEARCH_PATHS_SHALLOW_BUNDLE_$(SHALLOW_BUNDLE))", + /usr/lib/swift, + ); + LIBRARY_SEARCH_PATHS = ( + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + ); + MACH_O_TYPE = mh_bundle; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationUnityExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "$(LD_RUNPATH_SEARCH_PATHS_SHALLOW_BUNDLE_$(SHALLOW_BUNDLE))", + /usr/lib/swift, + ); + LIBRARY_SEARCH_PATHS = ( + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + ); + MACH_O_TYPE = mh_bundle; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationUnityExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "$(LD_RUNPATH_SEARCH_PATHS_SHALLOW_BUNDLE_$(SHALLOW_BUNDLE))", + /usr/lib/swift, + ); + LIBRARY_SEARCH_PATHS = ( + "$(SDKROOT)/usr/lib/swift", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + ); + MACH_O_TYPE = mh_bundle; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationUnityExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + /usr/lib/swift, + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(SDKROOT)/usr/lib/swift", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationUnityExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + /usr/lib/swift, + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", + "$(SDKROOT)/usr/lib/swift", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googlemobileads.mediation.gmaMediationUnityExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/mediation/gma_mediation_unity/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/mediation/gma_mediation_unity/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..21a3cc14c --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/AppDelegate.swift b/packages/mediation/gma_mediation_unity/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..70693e4a8 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000..dc9ada472 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000..7353c41ec Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000..797d452e4 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000..6ed2d933e Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000..4cd7b0099 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000..fe730945a Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000..321773cd8 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000..797d452e4 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000..502f463a9 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000..0ec303439 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000..0ec303439 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000..e9f5fea27 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000..84ac32ae7 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000..8953cba09 Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000..0467bf12a Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/mediation/gma_mediation_unity/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Base.lproj/Main.storyboard b/packages/mediation/gma_mediation_unity/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Info.plist b/packages/mediation/gma_mediation_unity/example/ios/Runner/Info.plist new file mode 100644 index 000000000..cb37746c0 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner/Info.plist @@ -0,0 +1,58 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Gma Mediation Unity + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + gma_mediation_unity_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + GADApplicationIdentifier + ca-app-pub-3940256099942544~1458002511 + SKAdNetworkItems + + + SKAdNetworkIdentifier + cstr6suwn9.skadnetwork + + + + diff --git a/packages/mediation/gma_mediation_unity/example/ios/Runner/Runner-Bridging-Header.h b/packages/mediation/gma_mediation_unity/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..308a2a560 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/mediation/gma_mediation_unity/example/ios/RunnerTests/GmaMediationUnityPluginTests.swift b/packages/mediation/gma_mediation_unity/example/ios/RunnerTests/GmaMediationUnityPluginTests.swift new file mode 100644 index 000000000..6d8599fbf --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/ios/RunnerTests/GmaMediationUnityPluginTests.swift @@ -0,0 +1,59 @@ +// Copyright 2024 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 +// +// https://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 UIKit +import XCTest + +@testable import gma_mediation_unity + +class GmaMediationUnityPluginTests: XCTestCase { + + func testSetGDPRConsent() { + let metadata = UnityMetaDataFake() + + GmaMediationUnityPlugin(unityMetaData:metadata).setGDPRConsent(gdprConsent: true) + + XCTAssertEqual(metadata.setPair?.0, "gdpr.consent") + XCTAssertEqual(metadata.setPair?.1 as! Bool, true) + XCTAssertEqual(metadata.commitCalls, 1) + } + + func testSetCCPAConsent() { + let metadata = UnityMetaDataFake() + + GmaMediationUnityPlugin(unityMetaData:metadata).setCCPAConsent(ccpaConsent: true) + + XCTAssertEqual(metadata.setPair?.0, "privacy.consent") + XCTAssertEqual(metadata.setPair?.1 as! Bool, true) + XCTAssertEqual(metadata.commitCalls, 1) + } +} + +class UnityMetaDataFake: UnityMetaDataProtocol { + var setPair: (String, Any)? + var commitCalls: Int + + init() { + setPair = nil + commitCalls = 0 + } + + func set(key: String, value: Any) { + setPair = (key, value) + } + + func commit() { + commitCalls += 1 + } +} diff --git a/packages/mediation/gma_mediation_unity/example/lib/main.dart b/packages/mediation/gma_mediation_unity/example/lib/main.dart new file mode 100644 index 000000000..665bfe31b --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/lib/main.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatefulWidget { + const MyApp({super.key}); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('Plugin example app'), + ), + body: const Center( + child: Text('Test app'), + ), + ), + ); + } +} diff --git a/packages/mediation/gma_mediation_unity/example/pubspec.yaml b/packages/mediation/gma_mediation_unity/example/pubspec.yaml new file mode 100644 index 000000000..aa56cfbfc --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/pubspec.yaml @@ -0,0 +1,27 @@ +name: gma_mediation_unity_example +description: "Demonstrates how to use the gma_mediation_unity plugin." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +environment: + sdk: '>=3.2.5 <4.0.0' + +dependencies: + flutter: + sdk: flutter + + gma_mediation_unity: + path: ../ + + cupertino_icons: ^1.0.2 + +dev_dependencies: + integration_test: + sdk: flutter + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + +flutter: + uses-material-design: true \ No newline at end of file diff --git a/packages/mediation/gma_mediation_unity/example/test/widget_test.dart b/packages/mediation/gma_mediation_unity/example/test/widget_test.dart new file mode 100644 index 000000000..eece8be95 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/example/test/widget_test.dart @@ -0,0 +1,27 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:gma_mediation_unity_example/main.dart'; + +void main() { + testWidgets('Verify Platform version', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that platform version is retrieved. + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is Text && widget.data!.startsWith('Running on:'), + ), + findsOneWidget, + ); + }); +} diff --git a/packages/mediation/gma_mediation_unity/ios/.gitignore b/packages/mediation/gma_mediation_unity/ios/.gitignore new file mode 100644 index 000000000..0c885071e --- /dev/null +++ b/packages/mediation/gma_mediation_unity/ios/.gitignore @@ -0,0 +1,38 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig +/Flutter/ephemeral/ +/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/packages/mediation/gma_mediation_unity/ios/Assets/.gitkeep b/packages/mediation/gma_mediation_unity/ios/Assets/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/packages/mediation/gma_mediation_unity/ios/Classes/GmaMediationUnityPlugin.swift b/packages/mediation/gma_mediation_unity/ios/Classes/GmaMediationUnityPlugin.swift new file mode 100644 index 000000000..e1c79646f --- /dev/null +++ b/packages/mediation/gma_mediation_unity/ios/Classes/GmaMediationUnityPlugin.swift @@ -0,0 +1,64 @@ +// Copyright 2024 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 +// +// https://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 Flutter +import UIKit +import UnityAds + +/// Manages UnityPrivacyApi and implements the needed methods. +public class GmaMediationUnityPlugin: NSObject, FlutterPlugin, UnityPrivacyApi { + let uadsMedatada: UnityMetaDataProtocol + + init (unityMetaData: UnityMetaDataProtocol) { + self.uadsMedatada = unityMetaData + } + + public static func register(with registrar: FlutterPluginRegistrar) { + let messenger : FlutterBinaryMessenger = registrar.messenger() + let api : UnityPrivacyApi & NSObjectProtocol = GmaMediationUnityPlugin.init(unityMetaData: UnityMetaDataImpl()) + UnityPrivacyApiSetup.setUp(binaryMessenger: messenger, api: api) + } + public func detachFromEngine(for registrar: FlutterPluginRegistrar) { + let messenger : FlutterBinaryMessenger = registrar.messenger() + UnityPrivacyApiSetup.setUp(binaryMessenger: messenger, api: nil) + } + func setGDPRConsent(gdprConsent: Bool) { + uadsMedatada.set(key: "gdpr.consent", value: gdprConsent) + uadsMedatada.commit() + print("GDPR Test") + } + func setCCPAConsent(ccpaConsent: Bool) { + uadsMedatada.set(key: "privacy.consent", value: ccpaConsent) + uadsMedatada.commit() + } +} + +protocol UnityMetaDataProtocol { + func set(key: String, value: Any) + + func commit() +} + +class UnityMetaDataImpl : UnityMetaDataProtocol { + let instance: UADSMetaData + init() { + self.instance = UADSMetaData() + } + func set(key: String, value: Any) { + instance.set(key, value: value) + } + func commit() { + instance.commit() + } +} diff --git a/packages/mediation/gma_mediation_unity/ios/Classes/UnityPrivacyApi.g.swift b/packages/mediation/gma_mediation_unity/ios/Classes/UnityPrivacyApi.g.swift new file mode 100644 index 000000000..ebce44e88 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/ios/Classes/UnityPrivacyApi.g.swift @@ -0,0 +1,90 @@ +// Autogenerated from Pigeon (v18.0.0), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] +} + +private func isNullish(_ value: Any?) -> Bool { + return value is NSNull || value == nil +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return value as! T? +} +/// The generated classes set the channels to call the methods in the corresponding kotlin UnityPrivacyApi interface and swift UnityPrivacyApi protocol from the dart layer. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol UnityPrivacyApi { + /// Used to configure GDPR consent on the Android or iOS Unity SDK + func setGDPRConsent(gdprConsent: Bool) throws + /// Used to configure CCPA consent on the Android or iOS Unity SDK + func setCCPAConsent(ccpaConsent: Bool) throws +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class UnityPrivacyApiSetup { + /// The codec used by UnityPrivacyApi. + /// Sets up an instance of `UnityPrivacyApi` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: UnityPrivacyApi?, messageChannelSuffix: String = "") { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + /// Used to configure GDPR consent on the Android or iOS Unity SDK + let setGDPRConsentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.gma_mediation_unity.UnityPrivacyApi.setGDPRConsent\(channelSuffix)", binaryMessenger: binaryMessenger) + if let api = api { + setGDPRConsentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let gdprConsentArg = args[0] as! Bool + do { + try api.setGDPRConsent(gdprConsent: gdprConsentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setGDPRConsentChannel.setMessageHandler(nil) + } + /// Used to configure CCPA consent on the Android or iOS Unity SDK + let setCCPAConsentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.gma_mediation_unity.UnityPrivacyApi.setCCPAConsent\(channelSuffix)", binaryMessenger: binaryMessenger) + if let api = api { + setCCPAConsentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let ccpaConsentArg = args[0] as! Bool + do { + try api.setCCPAConsent(ccpaConsent: ccpaConsentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setCCPAConsentChannel.setMessageHandler(nil) + } + } +} diff --git a/packages/mediation/gma_mediation_unity/ios/gma_mediation_unity.podspec b/packages/mediation/gma_mediation_unity/ios/gma_mediation_unity.podspec new file mode 100644 index 000000000..093edf278 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/ios/gma_mediation_unity.podspec @@ -0,0 +1,26 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint gma_mediation_unity.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'gma_mediation_unity' + s.version = '1.0.0' + s.summary = 'Google Mobile Ads Mediation of Unity Ads.' + s.description = <<-DESC +Mediation Adapter for Unity Ads to use with Google Mobile Ads. + DESC + s.homepage = 'https://developers.google.com/admob/flutter/mediation/unity' + s.license = { :file => '../LICENSE' } + s.author = { 'Google LLC' => 'mediation-support@google.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + s.dependency 'GoogleMobileAdsMediationUnity', '~>4.10.0.0' + s.platform = :ios, '12.0' + + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.swift_version = '5.0' + +end diff --git a/packages/mediation/gma_mediation_unity/lib/gma_mediation_unity.dart b/packages/mediation/gma_mediation_unity/lib/gma_mediation_unity.dart new file mode 100644 index 000000000..dff883419 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/lib/gma_mediation_unity.dart @@ -0,0 +1,26 @@ +// Copyright 2024 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 +// +// https://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 'package:gma_mediation_unity/unity_privacy_api.g.dart'; + +/// This class has entrypoint to call Unity's SDK APIs. +class GmaMediationUnity { + Future setGDPRConsent(bool gdprConsent) async { + UnityPrivacyApi().setGDPRConsent(gdprConsent); + } + + Future setCCPAConsent(bool ccpaConsent) async { + UnityPrivacyApi().setCCPAConsent(ccpaConsent); + } +} diff --git a/packages/mediation/gma_mediation_unity/lib/unity_privacy_api.g.dart b/packages/mediation/gma_mediation_unity/lib/unity_privacy_api.g.dart new file mode 100644 index 000000000..776272d66 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/lib/unity_privacy_api.g.dart @@ -0,0 +1,84 @@ +// Autogenerated from Pigeon (v18.0.0), do not edit directly. +// See also: https://pub.dev/packages/pigeon +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers + +import 'dart:async'; +import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; + +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; +import 'package:flutter/services.dart'; + +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + +/// The generated classes set the channels to call the methods in the corresponding kotlin UnityPrivacyApi interface and swift UnityPrivacyApi protocol from the dart layer. +class UnityPrivacyApi { + /// Constructor for [UnityPrivacyApi]. The [binaryMessenger] named argument is + /// available for dependency injection. If it is left null, the default + /// BinaryMessenger will be used which routes to the host platform. + UnityPrivacyApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); + + final String __pigeon_messageChannelSuffix; + + /// Used to configure GDPR consent on the Android or iOS Unity SDK + Future setGDPRConsent(bool gdprConsent) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.gma_mediation_unity.UnityPrivacyApi.setGDPRConsent$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([gdprConsent]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } + + /// Used to configure CCPA consent on the Android or iOS Unity SDK + Future setCCPAConsent(bool ccpaConsent) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.gma_mediation_unity.UnityPrivacyApi.setCCPAConsent$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([ccpaConsent]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } +} diff --git a/packages/mediation/gma_mediation_unity/pigeons/unity_privacy_api.dart b/packages/mediation/gma_mediation_unity/pigeons/unity_privacy_api.dart new file mode 100644 index 000000000..8bfa84978 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/pigeons/unity_privacy_api.dart @@ -0,0 +1,41 @@ +// Copyright 2024 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 +// +// https://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 'package:pigeon/pigeon.dart'; + +@ConfigurePigeon( + PigeonOptions( + dartOut: 'lib/unity_privacy_api.g.dart', + dartOptions: DartOptions(), + kotlinOut: + 'android/src/main/kotlin/io/flutter/plugins/googlemobileads/mediation/gma_mediation_unity/UnityPrivacyApi.g.kt', + kotlinOptions: KotlinOptions( + package: + "io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity", + ), + swiftOut: 'ios/Classes/UnityPrivacyApi.g.swift', + swiftOptions: SwiftOptions(), + dartPackageName: 'gma_mediation_unity', + ), +) +@HostApi() + +/// The generated classes set the channels to call the methods in the corresponding kotlin UnityPrivacyApi interface and swift UnityPrivacyApi protocol from the dart layer. +abstract class UnityPrivacyApi { + /// Used to configure GDPR consent on the Android or iOS Unity SDK + void setGDPRConsent(bool gdprConsent); + + /// Used to configure CCPA consent on the Android or iOS Unity SDK + void setCCPAConsent(bool ccpaConsent); +} diff --git a/packages/mediation/gma_mediation_unity/pubspec.yaml b/packages/mediation/gma_mediation_unity/pubspec.yaml new file mode 100644 index 000000000..e6718f636 --- /dev/null +++ b/packages/mediation/gma_mediation_unity/pubspec.yaml @@ -0,0 +1,30 @@ +name: gma_mediation_unity +description: "Mediation Adapter that enables sending ad requests to the Unity ad network using the google_mobile_ads plugin." +version: 1.0.0 +repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/mediation/gma_mediation_unity + +environment: + sdk: '>=3.2.5 <4.0.0' + flutter: '>=3.3.0' + +dependencies: + flutter: + sdk: flutter + google_mobile_ads: ^5.0.0 + plugin_platform_interface: ^2.0.2 + +dev_dependencies: + flutter_lints: ^3.0.0 + flutter_test: + sdk: flutter + lint: ^2.3.0 + pigeon: ^18.0.0 + +flutter: + plugin: + platforms: + android: + package: io.flutter.plugins.googlemobileads.mediation.gma_mediation_unity + pluginClass: GmaMediationUnityPlugin + ios: + pluginClass: GmaMediationUnityPlugin diff --git a/samples/admob/adaptive_banner_example/README.md b/samples/admob/adaptive_banner_example/README.md deleted file mode 100644 index 91c27d589..000000000 --- a/samples/admob/adaptive_banner_example/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# adaptive_banner_example - -An example project that demonstrates loading and showing adaptive banner ads. - -## Always test with test ads - -When building and testing your apps, make sure you use test ads rather than -live, production ads. Failure to do so can lead to suspension of your account. - -## Implementation - -The main steps to integrate banner ads are: - -1. Determine the ad width -2. Load an ad -3. Display an ad - -### Determine the ad width -If you use a hardcoded width, you're done. To use our preferred [Adaptive Banner](https://developers.google.com/admob/flutter/banner/anchored-adaptive) format, the sample shows how to get the size of the window containing your app to determine the ad width. - -``` -final size = await AdSize. - getCurrentOrientationAnchoredAdaptiveBannerAdSize( - MediaQuery.of(context).size.width.truncate()); -``` - - -### Load an ad -The sample shows how to load an adaptive banner ad. - -``` -BannerAd( - adUnitId: _adUnitId, - request: const AdRequest(), - size: size, - listener: BannerAdListener( - // Called when an ad is successfully received. - onAdLoaded: (ad) { - setState(() { - _bannerAd = ad as BannerAd; - _isLoaded = true; - }); - }, - ... - ), - ).load(); - ``` - - ### Display an ad - The sample shows how to display a banner ad. - - ``` -Widget build(BuildContext context) { - return MaterialApp( - ... - body: Stack( - children: [ - if (_bannerAd != null && _isLoaded) - Align( - alignment: Alignment.bottomCenter, - child: SafeArea( - child: SizedBox( - width: _bannerAd!.size.width.toDouble(), - height: _bannerAd!.size.height.toDouble(), - child: AdWidget(ad: _bannerAd!), - ), - ), - ) - ], - ) - ), - ); -} - ``` diff --git a/samples/admob/adaptive_banner_example/analysis_options.yaml b/samples/admob/adaptive_banner_example/analysis_options.yaml deleted file mode 100644 index f9b303465..000000000 --- a/samples/admob/adaptive_banner_example/analysis_options.yaml +++ /dev/null @@ -1 +0,0 @@ -include: package:flutter_lints/flutter.yaml diff --git a/samples/admob/adaptive_banner_example/ios/Flutter/Debug.xcconfig b/samples/admob/adaptive_banner_example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index 592ceee85..000000000 --- a/samples/admob/adaptive_banner_example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/samples/admob/adaptive_banner_example/ios/Flutter/Release.xcconfig b/samples/admob/adaptive_banner_example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 592ceee85..000000000 --- a/samples/admob/adaptive_banner_example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/samples/admob/adaptive_banner_example/ios/Runner/Info.plist b/samples/admob/adaptive_banner_example/ios/Runner/Info.plist deleted file mode 100644 index 01a2ee7e5..000000000 --- a/samples/admob/adaptive_banner_example/ios/Runner/Info.plist +++ /dev/null @@ -1,254 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Adaptive Banner Example - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - adaptive_banner_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - GADApplicationIdentifier - ca-app-pub-3940256099942544~1458002511 - SKAdNetworkItems - - - SKAdNetworkIdentifier - cstr6suwn9.skadnetwork - - - SKAdNetworkIdentifier - 4fzdc2evr5.skadnetwork - - - SKAdNetworkIdentifier - 4pfyvq9l8r.skadnetwork - - - SKAdNetworkIdentifier - 2fnua5tdw4.skadnetwork - - - SKAdNetworkIdentifier - ydx93a7ass.skadnetwork - - - SKAdNetworkIdentifier - 5a6flpkh64.skadnetwork - - - SKAdNetworkIdentifier - p78axxw29g.skadnetwork - - - SKAdNetworkIdentifier - v72qych5uu.skadnetwork - - - SKAdNetworkIdentifier - ludvb6z3bs.skadnetwork - - - SKAdNetworkIdentifier - cp8zw746q7.skadnetwork - - - SKAdNetworkIdentifier - c6k4g5qg8m.skadnetwork - - - SKAdNetworkIdentifier - s39g8k73mm.skadnetwork - - - SKAdNetworkIdentifier - 3qy4746246.skadnetwork - - - SKAdNetworkIdentifier - 3sh42y64q3.skadnetwork - - - SKAdNetworkIdentifier - f38h382jlk.skadnetwork - - - SKAdNetworkIdentifier - hs6bdukanm.skadnetwork - - - SKAdNetworkIdentifier - prcb7njmu6.skadnetwork - - - SKAdNetworkIdentifier - v4nxqhlyqp.skadnetwork - - - SKAdNetworkIdentifier - wzmmz9fp6w.skadnetwork - - - SKAdNetworkIdentifier - yclnxrl5pm.skadnetwork - - - SKAdNetworkIdentifier - t38b2kh725.skadnetwork - - - SKAdNetworkIdentifier - 7ug5zh24hu.skadnetwork - - - SKAdNetworkIdentifier - 9rd848q2bz.skadnetwork - - - SKAdNetworkIdentifier - y5ghdn5j9k.skadnetwork - - - SKAdNetworkIdentifier - n6fk4nfna4.skadnetwork - - - SKAdNetworkIdentifier - v9wttpbfk9.skadnetwork - - - SKAdNetworkIdentifier - n38lu8286q.skadnetwork - - - SKAdNetworkIdentifier - 47vhws6wlr.skadnetwork - - - SKAdNetworkIdentifier - kbd757ywx3.skadnetwork - - - SKAdNetworkIdentifier - 9t245vhmpl.skadnetwork - - - SKAdNetworkIdentifier - a2p9lx4jpn.skadnetwork - - - SKAdNetworkIdentifier - 22mmun2rn5.skadnetwork - - - SKAdNetworkIdentifier - 4468km3ulz.skadnetwork - - - SKAdNetworkIdentifier - 2u9pt9hc89.skadnetwork - - - SKAdNetworkIdentifier - 8s468mfl3y.skadnetwork - - - SKAdNetworkIdentifier - av6w8kgt66.skadnetwork - - - SKAdNetworkIdentifier - klf5c3l5u5.skadnetwork - - - SKAdNetworkIdentifier - ppxm28t8ap.skadnetwork - - - SKAdNetworkIdentifier - 424m5254lk.skadnetwork - - - SKAdNetworkIdentifier - ecpz2srf59.skadnetwork - - - SKAdNetworkIdentifier - uw77j35x4d.skadnetwork - - - SKAdNetworkIdentifier - mlmmfzh3r3.skadnetwork - - - SKAdNetworkIdentifier - 578prtvx9j.skadnetwork - - - SKAdNetworkIdentifier - 4dzt52r2t5.skadnetwork - - - SKAdNetworkIdentifier - gta9lk7p23.skadnetwork - - - SKAdNetworkIdentifier - e5fvkxwrpn.skadnetwork - - - SKAdNetworkIdentifier - 8c4e2ghe7u.skadnetwork - - - SKAdNetworkIdentifier - zq492l623r.skadnetwork - - - SKAdNetworkIdentifier - 3rd42ekr43.skadnetwork - - - SKAdNetworkIdentifier - 3qcr597p9d.skadnetwork - - - - diff --git a/samples/admob/adaptive_banner_example/ios/RunnerTests/RunnerTests.swift b/samples/admob/adaptive_banner_example/ios/RunnerTests/RunnerTests.swift deleted file mode 100644 index 86a7c3b1b..000000000 --- a/samples/admob/adaptive_banner_example/ios/RunnerTests/RunnerTests.swift +++ /dev/null @@ -1,12 +0,0 @@ -import Flutter -import UIKit -import XCTest - -class RunnerTests: XCTestCase { - - func testExample() { - // If you add code to the Runner application, consider adding tests here. - // See https://developer.apple.com/documentation/xctest for more information about using XCTest. - } - -} diff --git a/samples/admob/adaptive_banner_example/lib/main.dart b/samples/admob/adaptive_banner_example/lib/main.dart deleted file mode 100644 index 0840473b9..000000000 --- a/samples/admob/adaptive_banner_example/lib/main.dart +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2022 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 -// -// https://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. - -// ignore_for_file: public_member_api_docs - -import 'dart:io'; - -import 'package:flutter/material.dart'; -import 'package:google_mobile_ads/google_mobile_ads.dart'; - -void main() { - WidgetsFlutterBinding.ensureInitialized(); - MobileAds.instance.initialize(); - runApp(const MaterialApp( - home: AdaptiveBannerExample(), - )); -} - -/// A simple app that loads an adaptive banner ad. -class AdaptiveBannerExample extends StatefulWidget { - const AdaptiveBannerExample({super.key}); - - @override - AdaptiveBannerExampleState createState() => AdaptiveBannerExampleState(); -} - -class AdaptiveBannerExampleState extends State { - BannerAd? _bannerAd; - bool _isLoaded = false; - Orientation? _currentOrientation; - - final String _adUnitId = Platform.isAndroid - ? 'ca-app-pub-3940256099942544/9214589741' - : 'ca-app-pub-3940256099942544/2435281174'; - - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Adaptive Banner Example', - home: Scaffold( - appBar: AppBar( - title: const Text('Adaptive Banner Example'), - ), - body: OrientationBuilder( - builder: (context, orientation) { - if (_currentOrientation != orientation) { - _isLoaded = false; - _loadAd(); - _currentOrientation = orientation; - } - - return Stack( - children: [ - if (_bannerAd != null && _isLoaded) - Align( - alignment: Alignment.bottomCenter, - child: SafeArea( - child: SizedBox( - width: _bannerAd!.size.width.toDouble(), - height: _bannerAd!.size.height.toDouble(), - child: AdWidget(ad: _bannerAd!), - ), - ), - ) - ], - ); - }, - ))); - } - - /// Loads and shows a banner ad. - /// - /// Dimensions of the ad are determined by the width of the screen. - void _loadAd() async { - // Get an AnchoredAdaptiveBannerAdSize before loading the ad. - final size = await AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize( - MediaQuery.sizeOf(context).width.truncate()); - - if (size == null) { - // Unable to get width of anchored banner. - return; - } - - BannerAd( - adUnitId: _adUnitId, - request: const AdRequest(), - size: size, - listener: BannerAdListener( - // Called when an ad is successfully received. - onAdLoaded: (ad) { - setState(() { - _bannerAd = ad as BannerAd; - _isLoaded = true; - }); - }, - // Called when an ad request failed. - onAdFailedToLoad: (ad, err) { - ad.dispose(); - }, - // Called when an ad opens an overlay that covers the screen. - onAdOpened: (Ad ad) {}, - // Called when an ad removes an overlay that covers the screen. - onAdClosed: (Ad ad) {}, - // Called when an impression occurs on the ad. - onAdImpression: (Ad ad) {}, - ), - ).load(); - } - - @override - void dispose() { - _bannerAd?.dispose(); - super.dispose(); - } -} diff --git a/samples/admob/adaptive_banner_example/pubspec.yaml b/samples/admob/adaptive_banner_example/pubspec.yaml deleted file mode 100644 index 4acbc5476..000000000 --- a/samples/admob/adaptive_banner_example/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: adaptive_banner_example -description: Example project for demoing adaptive banner ads. -publish_to: 'none' -version: 1.0.0+1 - -environment: - sdk: '>=3.1.5 <4.0.0' - -dependencies: - flutter: - sdk: flutter - google_mobile_ads: ^5.0.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.0 - -flutter: - uses-material-design: true diff --git a/samples/admob/banner_example/README.md b/samples/admob/banner_example/README.md index 722bbe062..f6f8eebad 100644 --- a/samples/admob/banner_example/README.md +++ b/samples/admob/banner_example/README.md @@ -11,8 +11,19 @@ live, production ads. Failure to do so can lead to suspension of your account. The main steps to integrate banner ads are: -1. Load an ad -2. Display an ad +1. Determine the ad width +2. Load an ad +3. Display an ad + +### Determine the ad width +If you use a hardcoded width, you're done. To use our preferred [Banner](https://developers.google.com/admob/flutter/banner/anchored-adaptive) format, the sample shows how to get the size of the window containing your app to determine the ad width. + +``` +final size = await AdSize. + getCurrentOrientationAnchoredAdaptiveBannerAdSize( + MediaQuery.of(context).size.width.truncate()); +``` + ### Load an ad The sample shows how to load a banner ad. @@ -21,12 +32,13 @@ The sample shows how to load a banner ad. BannerAd( adUnitId: _adUnitId, request: const AdRequest(), - size: AdSize.Banner, + size: size, listener: BannerAdListener( // Called when an ad is successfully received. onAdLoaded: (ad) { setState(() { _bannerAd = ad as BannerAd; + _isLoaded = true; }); }, ... @@ -34,8 +46,8 @@ BannerAd( ).load(); ``` - ### Display an ad - The sample shows how to display a banner ad. +### Display an ad +The sample shows how to display a banner ad. ``` Widget build(BuildContext context) { @@ -43,7 +55,7 @@ Widget build(BuildContext context) { ... body: Stack( children: [ - if (_bannerAd != null) + if (_bannerAd != null && _isLoaded) Align( alignment: Alignment.bottomCenter, child: SafeArea( diff --git a/samples/admob/banner_example/lib/main.dart b/samples/admob/banner_example/lib/main.dart index 02737aa66..d12107fda 100644 --- a/samples/admob/banner_example/lib/main.dart +++ b/samples/admob/banner_example/lib/main.dart @@ -21,56 +21,71 @@ class BannerExample extends StatefulWidget { class BannerExampleState extends State { BannerAd? _bannerAd; + bool _isLoaded = false; + Orientation? _currentOrientation; final String _adUnitId = Platform.isAndroid - ? 'ca-app-pub-3940256099942544/6300978111' - : 'ca-app-pub-3940256099942544/2934735716'; - - @override - void initState() { - super.initState(); - _loadAd(); - } + ? 'ca-app-pub-3940256099942544/9214589741' + : 'ca-app-pub-3940256099942544/2435281174'; @override Widget build(BuildContext context) { return MaterialApp( - title: 'Banner Example', - home: Scaffold( - appBar: AppBar( - title: const Text('Banner Example'), - ), - body: Stack( - children: [ - if (_bannerAd != null) - Align( - alignment: Alignment.bottomCenter, - child: SafeArea( - child: SizedBox( - width: _bannerAd!.size.width.toDouble(), - height: _bannerAd!.size.height.toDouble(), - child: AdWidget(ad: _bannerAd!), - ), - ), - ) - ], - )), - ); + title: 'Banner Example', + home: Scaffold( + appBar: AppBar( + title: const Text('Banner Example'), + ), + body: OrientationBuilder( + builder: (context, orientation) { + if (_currentOrientation != orientation) { + _isLoaded = false; + _loadAd(); + _currentOrientation = orientation; + } + + return Stack( + children: [ + if (_bannerAd != null && _isLoaded) + Align( + alignment: Alignment.bottomCenter, + child: SafeArea( + child: SizedBox( + width: _bannerAd!.size.width.toDouble(), + height: _bannerAd!.size.height.toDouble(), + child: AdWidget(ad: _bannerAd!), + ), + ), + ) + ], + ); + }, + ))); } /// Loads and shows a banner ad. /// - /// Dimensions of the ad are determined by the AdSize class. + /// Dimensions of the ad are determined by the width of the screen. void _loadAd() async { + // Get an AnchoredAdaptiveBannerAdSize before loading the ad. + final size = await AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize( + MediaQuery.sizeOf(context).width.truncate()); + + if (size == null) { + // Unable to get width of anchored banner. + return; + } + BannerAd( adUnitId: _adUnitId, request: const AdRequest(), - size: AdSize.banner, + size: size, listener: BannerAdListener( // Called when an ad is successfully received. onAdLoaded: (ad) { setState(() { _bannerAd = ad as BannerAd; + _isLoaded = true; }); }, // Called when an ad request failed. diff --git a/samples/admob/interstitial_example/lib/consent_manager.dart b/samples/admob/interstitial_example/lib/consent_manager.dart new file mode 100644 index 000000000..c64afd1be --- /dev/null +++ b/samples/admob/interstitial_example/lib/consent_manager.dart @@ -0,0 +1,51 @@ +import 'dart:async'; + +import 'package:google_mobile_ads/google_mobile_ads.dart'; + +typedef OnConsentGatheringCompleteListener = void Function(FormError? error); + +/// The Google Mobile Ads SDK provides the User Messaging Platform (Google's IAB +/// Certified consent management platform) as one solution to capture consent for +/// users in GDPR impacted countries. This is an example and you can choose +/// another consent management platform to capture consent. +class ConsentManager { + /// Helper variable to determine if the app can request ads. + Future canRequestAds() async { + return await ConsentInformation.instance.canRequestAds(); + } + + /// Helper variable to determine if the privacy options form is required. + Future isPrivacyOptionsRequired() async { + return await ConsentInformation.instance + .getPrivacyOptionsRequirementStatus() == + PrivacyOptionsRequirementStatus.required; + } + + /// Helper method to call the Mobile Ads SDK to request consent information + /// and load/show a consent form if necessary. + void gatherConsent( + OnConsentGatheringCompleteListener onConsentGatheringCompleteListener) { + // For testing purposes, you can force a DebugGeography of Eea or NotEea. + ConsentDebugSettings debugSettings = ConsentDebugSettings( + // debugGeography: DebugGeography.debugGeographyEea, + ); + ConsentRequestParameters params = + ConsentRequestParameters(consentDebugSettings: debugSettings); + + // Requesting an update to consent information should be called on every app launch. + ConsentInformation.instance.requestConsentInfoUpdate(params, () async { + ConsentForm.loadAndShowConsentFormIfRequired((loadAndShowError) { + // Consent has been gathered. + onConsentGatheringCompleteListener(loadAndShowError); + }); + }, (FormError formError) { + onConsentGatheringCompleteListener(formError); + }); + } + + /// Helper method to call the Mobile Ads SDK method to show the privacy options form. + void showPrivacyOptionsForm( + OnConsentFormDismissedListener onConsentFormDismissedListener) { + ConsentForm.showPrivacyOptionsForm(onConsentFormDismissedListener); + } +} diff --git a/samples/admob/interstitial_example/lib/main.dart b/samples/admob/interstitial_example/lib/main.dart index 27269ec6c..7ba3528b7 100644 --- a/samples/admob/interstitial_example/lib/main.dart +++ b/samples/admob/interstitial_example/lib/main.dart @@ -4,9 +4,10 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:google_mobile_ads/google_mobile_ads.dart'; +import 'consent_manager.dart'; + void main() { WidgetsFlutterBinding.ensureInitialized(); - MobileAds.instance.initialize(); runApp(const MaterialApp( home: InterstitialExample(), )); @@ -21,9 +22,16 @@ class InterstitialExample extends StatefulWidget { } class InterstitialExampleState extends State { + static const privacySettingsText = 'Privacy Settings'; + InterstitialAd? _interstitialAd; + final _consentManager = ConsentManager(); final _gameLength = 5; + var _gamePaused = false; + var _gameOver = false; + var _isMobileAdsInitializeCalled = false; late var _counter = _gameLength; + Timer? _timer; final String _adUnitId = Platform.isAndroid ? 'ca-app-pub-3940256099942544/1033173712' @@ -33,14 +41,46 @@ class InterstitialExampleState extends State { void initState() { super.initState(); - _startNewGame(); + _consentManager.gatherConsent((consentGatheringError) { + if (consentGatheringError != null) { + // Consent not obtained in current session. + debugPrint( + "${consentGatheringError.errorCode}: ${consentGatheringError.message}"); + } + + // Kick off the first play of the "game". + _startNewGame(); + + // Attempt to initialize the Mobile Ads SDK. + _initializeMobileAdsSDK(); + }); + + // This sample attempts to load ads using consent obtained in the previous session. + _initializeMobileAdsSDK(); } void _startNewGame() { setState(() => _counter = _gameLength); - _loadAd(); - _starTimer(); + _startTimer(); + _gameOver = false; + _gamePaused = false; + } + + void _pauseGame() { + if (_gameOver || _gamePaused) { + return; + } + _timer?.cancel(); + _gamePaused = true; + } + + void _resumeGame() { + if (_gameOver || !_gamePaused) { + return; + } + _startTimer(); + _gamePaused = false; } @override @@ -50,6 +90,9 @@ class InterstitialExampleState extends State { home: Scaffold( appBar: AppBar( title: const Text('Interstitial Example'), + actions: _isMobileAdsInitializeCalled + ? _privacySettingsAppBarAction() + : null, ), body: Stack( children: [ @@ -74,6 +117,7 @@ class InterstitialExampleState extends State { child: TextButton( onPressed: () { _startNewGame(); + _loadAd(); }, child: const Text('Play Again'), ), @@ -85,8 +129,48 @@ class InterstitialExampleState extends State { ); } + List _privacySettingsAppBarAction() { + return [ + // Regenerate the options menu to include a privacy setting. + FutureBuilder( + future: _consentManager.isPrivacyOptionsRequired(), + builder: (context, snapshot) { + final bool visibility = snapshot.data ?? false; + return Visibility( + visible: visibility, + child: PopupMenuButton( + onSelected: (String result) { + if (result == privacySettingsText) { + _pauseGame(); + _consentManager.showPrivacyOptionsForm((formError) { + if (formError != null) { + debugPrint( + "${formError.errorCode}: ${formError.message}"); + } + _resumeGame(); + }); + } + }, + itemBuilder: (BuildContext context) => + >[ + const PopupMenuItem( + value: privacySettingsText, + child: Text(privacySettingsText)) + ], + )); + }) + ]; + } + /// Loads an interstitial ad. - void _loadAd() { + void _loadAd() async { + // Only load an ad if the Mobile Ads SDK has gathered consent aligned with + // the app's configured messages. + var canRequestAds = await _consentManager.canRequestAds(); + if (!canRequestAds) { + return; + } + InterstitialAd.load( adUnitId: _adUnitId, request: const AdRequest(), @@ -138,17 +222,38 @@ class InterstitialExampleState extends State { )); } - void _starTimer() { - Timer.periodic(const Duration(seconds: 1), (timer) { + void _startTimer() { + _timer = Timer.periodic(const Duration(seconds: 1), (timer) { setState(() => _counter--); if (_counter == 0) { + _gameOver = true; _showAlert(context); timer.cancel(); } }); } + /// Initialize the Mobile Ads SDK if the SDK has gathered consent aligned with + /// the app's configured messages. + void _initializeMobileAdsSDK() async { + if (_isMobileAdsInitializeCalled) { + return; + } + + var canRequestAds = await _consentManager.canRequestAds(); + if (canRequestAds) { + setState(() { + _isMobileAdsInitializeCalled = true; + }); + + // Initialize the Mobile Ads SDK. + MobileAds.instance.initialize(); + // Load an ad. + _loadAd(); + } + } + @override void dispose() { _interstitialAd?.dispose(); diff --git a/samples/admob/interstitial_example/pubspec.yaml b/samples/admob/interstitial_example/pubspec.yaml index 1701dcb3e..7844263e7 100644 --- a/samples/admob/interstitial_example/pubspec.yaml +++ b/samples/admob/interstitial_example/pubspec.yaml @@ -9,7 +9,7 @@ environment: dependencies: flutter: sdk: flutter - google_mobile_ads: ^4.0.0 + google_mobile_ads: ^5.1.0 dev_dependencies: flutter_test: