FirebaseAdMob class

Support for Google AdMob mobile ads.

Before loading or showing an ad the plugin must be initialized with an AdMob app id:

FirebaseAdMob.instance.initialize(appId: myAppId);

Apps can create, load, and show mobile ads. For example:

BannerAd myBanner = BannerAd(unitId: myBannerAdUnitId)
  ..load()
  ..show();

See also:

  • The example associated with this plugin.
  • BannerAd, a small rectangular ad displayed at the bottom of the screen.
  • InterstitialAd, a full screen ad that must be dismissed by the user.
  • RewardedVideoAd, a full screen video ad that provides in-app user rewards.

Constructors

FirebaseAdMob.private(MethodChannel? channel)

Properties

hashCode int?
The hash code for this object.
no setterinherited
runtimeType Type?
A representation of the runtime type of the object.
no setterinherited

Methods

initialize({String? appId, String? trackingId, bool? analyticsEnabled = false}) Future<bool?>?
Initialize this plugin for the AdMob app specified by appId.
noSuchMethod(Invocation? invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String?
A string representation of this object.
inherited

Operators

operator ==(Object? other) bool?
The equality operator.
inherited

Static Properties

instance FirebaseAdMob?
The single shared instance of this plugin.
no setter
testAppId String?
A platform-specific AdMob test ad unit ID. This ad unit has been specially configured to always return test ads, and developers are encouraged to use it while building and testing their apps.
final