Skip to content

Commit

Permalink
Merge pull request #37 from googleads/main
Browse files Browse the repository at this point in the history
sync fork
  • Loading branch information
atrope authored Jan 9, 2025
2 parents b77b8c8 + 406add0 commit 26de162
Show file tree
Hide file tree
Showing 191 changed files with 3,369 additions and 291 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- "samples/admob/rewarded_example"
- "samples/admob/rewarded_interstitial_example"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- "samples/admob/rewarded_example"
- "samples/admob/rewarded_interstitial_example"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- "samples/admob/rewarded_example"
- "samples/admob/rewarded_interstitial_example"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gma_mediation_applovin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/setup-java@v4
Expand All @@ -56,7 +56,7 @@ jobs:
- uses: swift-actions/setup-swift@v2
with:
swift-version: "5.7.2"
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand All @@ -82,7 +82,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gma_mediation_dtexchange.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/setup-java@v4
Expand All @@ -56,7 +56,7 @@ jobs:
- uses: swift-actions/setup-swift@v2
with:
swift-version: "5.7.2"
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand All @@ -82,7 +82,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gma_mediation_inmobi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gma_mediation_ironsource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/setup-java@v4
Expand All @@ -55,7 +55,7 @@ jobs:
- uses: swift-actions/setup-swift@v2
with:
swift-version: "5.7.2"
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand All @@ -81,7 +81,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gma_mediation_liftoffmonetize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/setup-java@v4
Expand All @@ -56,7 +56,7 @@ jobs:
- uses: swift-actions/setup-swift@v2
with:
swift-version: "5.7.2"
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand All @@ -83,7 +83,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gma_mediation_meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gma_mediation_mintegral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gma_mediation_pangle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gma_mediation_unity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/setup-java@v4
Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: macos-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand All @@ -80,7 +80,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/google_mobile_ads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- uses: actions/setup-java@v4
Expand All @@ -56,7 +56,7 @@ jobs:
runs-on: macos-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand All @@ -83,7 +83,7 @@ jobs:
if: github.event_name == 'pull_request'
timeout-minutes: 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: "Install Flutter"
Expand Down
10 changes: 10 additions & 0 deletions packages/google_mobile_ads/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## Next Version
* Updated WebView Flutter Android dependency

## 5.2.0
* Removed use of rootViewController for iOS GMA SDK which solved issues like
https://github.com/googleads/googleads-mobile-flutter/issues/1146 and https://github.com/googleads/googleads-mobile-flutter/issues/700.
* Android GMA SDK is now initialized on a background thread.
* Updates GMA [iOS](https://developers.google.com/admob/ios/rel-notes) dependency to 11.10.0
* Updates GMA [Android](https://developers.google.com/admob/android/rel-notes) dependency to 23.4.0

## 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.
Expand Down
4 changes: 2 additions & 2 deletions packages/google_mobile_ads/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.android.gms:play-services-ads:23.0.0'
implementation 'com.google.android.ump:user-messaging-platform:2.2.0'
api 'com.google.android.gms:play-services-ads:23.4.0'
implementation 'com.google.android.ump:user-messaging-platform:3.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-process:2.6.2'
implementation 'com.google.errorprone:error_prone_annotations:2.16'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.0";
public static final String REQUEST_AGENT_PREFIX_VERSIONED = "Flutter-GMA-5.2.0";
/** Prefix for news template */
public static final String REQUEST_AGENT_NEWS_TEMPLATE_PREFIX = "News";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ public FlutterMobileAdsWrapper() {}
/** Initializes the sdk. */
public void initialize(
@NonNull Context context, @NonNull OnInitializationCompleteListener listener) {
MobileAds.initialize(context, listener);
new Thread(
new Runnable() {
@Override
public void run() {
MobileAds.initialize(context, listener);
}
})
.start();
}

/** Wrapper for setAppMuted. */
Expand Down
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ target 'Runner' do
inherit! :search_paths

# Matches test_spec dependency.
pod 'OCMock', '3.6'
pod 'OCMock', '3.9.3'
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ - (void)testLoadShowGAMRequest {
// Helper method for testing with FLTAdRequest and FLTGAMAdRequest.
- (void)testLoadShowAppOpenAd:(FLTAdRequest *)request
gadOrGAMRequest:(GADRequest *)gadOrGAMRequest {
UIViewController *mockRootViewController =
OCMClassMock([UIViewController class]);
FLTAppOpenAd *ad =
[[FLTAppOpenAd alloc] initWithAdUnitId:@"testId"
request:request
rootViewController:mockRootViewController
adId:@1];
FLTAppOpenAd *ad = [[FLTAppOpenAd alloc] initWithAdUnitId:@"testId"
request:request
adId:@1];
ad.manager = mockManager;

// Stub the load call to invoke successful load callback.
Expand Down Expand Up @@ -130,8 +126,7 @@ - (void)testLoadShowAppOpenAd:(FLTAdRequest *)request

[ad show];

OCMVerify([appOpenClassMock
presentFromRootViewController:[OCMArg isEqual:mockRootViewController]]);
OCMVerify([appOpenClassMock presentFromRootViewController:[OCMArg isNil]]);

// Verify full screen callbacks.
OCMVerify([mockManager adWillPresentFullScreenContent:[OCMArg isEqual:ad]]);
Expand Down Expand Up @@ -162,13 +157,9 @@ - (void)testFailedToLoadGAMRequest {

// Helper for testing failed to load.
- (void)testFailedToLoad:(FLTAdRequest *)request {
UIViewController *mockRootViewController =
OCMClassMock([UIViewController class]);
FLTAppOpenAd *ad =
[[FLTAppOpenAd alloc] initWithAdUnitId:@"testId"
request:request
rootViewController:mockRootViewController
adId:@1];
FLTAppOpenAd *ad = [[FLTAppOpenAd alloc] initWithAdUnitId:@"testId"
request:request
adId:@1];
ad.manager = mockManager;

id appOpenClassMock = OCMClassMock([GADAppOpenAd class]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ - (void)testLoadShowInterstitialAd {
GAMRequest *gadRequest = OCMClassMock([GAMRequest class]);
OCMStub([request asGAMRequest:[OCMArg any]]).andReturn(gadRequest);

UIViewController *mockRootViewController =
OCMClassMock([UIViewController class]);
FLTGAMInterstitialAd *ad =
[[FLTGAMInterstitialAd alloc] initWithAdUnitId:@"testId"
request:request
rootViewController:mockRootViewController
adId:@1];
ad.manager = mockManager;

Expand Down Expand Up @@ -120,8 +117,8 @@ - (void)testLoadShowInterstitialAd {
// Show the ad
[ad show];

OCMVerify([interstitialClassMock
presentFromRootViewController:[OCMArg isEqual:mockRootViewController]]);
OCMVerify(
[interstitialClassMock presentFromRootViewController:[OCMArg isNil]]);

// Verify full screen callbacks.
OCMVerify([mockManager adWillPresentFullScreenContent:[OCMArg isEqual:ad]]);
Expand All @@ -145,12 +142,9 @@ - (void)testFailToLoad {
GAMRequest *gadRequest = OCMClassMock([GAMRequest class]);
OCMStub([request asGAMRequest:[OCMArg any]]).andReturn(gadRequest);

UIViewController *mockRootViewController =
OCMClassMock([UIViewController class]);
FLTGAMInterstitialAd *ad =
[[FLTGAMInterstitialAd alloc] initWithAdUnitId:@"testId"
request:request
rootViewController:mockRootViewController
adId:@1];
ad.manager = mockManager;

Expand Down
Loading

0 comments on commit 26de162

Please sign in to comment.