Skip to content

Conversation

@jjliu15
Copy link
Collaborator

@jjliu15 jjliu15 commented Sep 22, 2021

Description

This is a partial fix for #265. This allows you to load ads from a cached flutter engine in the add to app scenario. Note this does not allow for reusing the cached flutter engine after dismissing its flutter activity, since redisplaying platform views is currently not supported.

  • Moves most of GoogleMobileAdsPlugin initialization from onAttachedToActivity to onAttachedToEngine.
  • The application context is used to load ads, which allows ads to be loaded from a cached flutter engine that has not been attached to an activity.
  • The activity is still required to show ads.
  • Adds roboletric to unit tests.

Related Issues

#265

*Replace this paragraph with a list of issues related to this PR from the issue database. Indicate, which of these issues are resolved or fixed by this PR.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@jjliu15 jjliu15 requested a review from blasten as a code owner September 27, 2021 21:30
@jjliu15 jjliu15 merged commit ee50d22 into googleads:master Sep 28, 2021
envercc pushed a commit to esuljic/googleads-mobile-flutter that referenced this pull request Nov 9, 2021
* upstream/master: (29 commits)
  Issue-404: Add App state event stream for app open ads (googleads#425)
  Issue 330: Android 12 crash (googleads#423)
  Remove unused dep. (googleads#424)
  Update inline adaptive example (googleads#419)
  Update anchored adaptive example (googleads#418)
  Fix ios warnings (googleads#416)
  Add support for getRequestConfiguration API (googleads#395)
  Add support for current orientation in AnchoredAdaptiveBannerAdSize (googleads#397)
  Set location and pub provided id (googleads#367)
  Adaptive inline banners (googleads#394)
  Fix issue 369 - setAppVolume (googleads#392)
  Add support for Fluid AdSize (AdManager Only) (googleads#375)
  Use application context to load ads - Android only (googleads#381)
  App open (googleads#360)
  Bump version to 0.13.4 (googleads#353)
  Refactor as per @luo86 review comments and add disableSDKCrashReporting, disableMediationInitialization and getVersionString APIs (googleads#345)
  Add support for Immersive Mode in Rewarded and Interstitial ads for Android (googleads#343)
  Add setAppMuted and setAppVolume implementations to MobileAds Flutter SDK (googleads#326)
  Fix typos and style issues (googleads#327)
  docs: Make it clear that the app must be registered to show live ads in the published app. (googleads#325)
  ...
@jjliu15 jjliu15 deleted the add_to_app_android_cached_engine branch November 14, 2022 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants