UnityAds class
Unity Ads plugin for Flutter applications.
Constructors
- UnityAds()
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
-
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 Methods
-
init(
{required String gameId, bool testMode = false, FirebaseTestLabMode firebaseTestLabMode = FirebaseTestLabMode.disableAds, Function? onComplete, dynamic onFailed(UnityAdsInitializationError error, String errorMessage)?}) → Future< void> - Initializes UnityAds. UnityAds should be initialized when app starts.
-
isInitialized(
) → Future< bool> - Returns true if the SDK is initialized successfully, and false if it isn't.
-
load(
{required String placementId, dynamic onComplete(String placementId)?, dynamic onFailed(String placementId, UnityAdsLoadError error, String errorMessage)?}) → Future< void> - Load a placement to make it available to show. Ads generally take a few seconds to finish loading before they can be shown.
-
setPrivacyConsent(
PrivacyConsentType privacyConsentType, bool value) → Future< bool> - Pass privacy consent flag to unity sdk.
-
showVideoAd(
{required String placementId, String? serverId, dynamic onStart(String placementId)?, dynamic onSkipped(String placementId)?, dynamic onClick(String placementId)?, dynamic onComplete(String placementId)?, dynamic onFailed(String placementId, UnityAdsShowError error, String errorMessage)?}) → Future< void> - Show an ad using the provided placement ID.