A Flutter plugin for integrating Unity Ads into your mobile applications. Easily display Unity Banner Ads and Unity Video Ads (Rewarded & Interstitial) with simple Dart APIs.
Features
Display Unity Banner, Rewarded, and Interstitial Video Ads
Android: the ad shows up as a separate app in Recent Apps
Symptom. While a fullscreen ad is playing, Recent Apps shows two cards for your app — your
app and the ad. Users can swipe the ad away before it completes, so the impression is lost.
Fix. Remove one line from your app's android/app/src/main/AndroidManifest.xml:
Flutter's template adds that blank affinity; Unity's ad screen keeps the default one. Android
puts screens with different affinities in different tasks
— hence the second card. Removing it puts the ad back in your app's task.
Trade-off. The attribute guards against task hijacking
(flutter#144018), which Android patches at the
OS level from API 30. On
minSdk 30+ removing it costs nothing; below that, users on Android 7–10 lose partial
protection — raising minSdk to 30 fixes both concerns at once.
Adding excludeFromRecents to Unity's ad activity does not work as an alternative.
See issue #70.
Donate
If you find this package helpful and would like to support its continued development, please consider making a donation. Your contributions are greatly appreciated and motivate the further enhancement of this and other plugins.
Your support helps maintain and improve this package, ensuring it remains up-to-date and useful for the community.