Class Advertising
Inheritance
Namespace: EasyMobile
Assembly: cs.temp.dll.dll
Syntax
public class Advertising : MonoBehaviour
Properties
AdColonyClient
Gets the AdColony client.
Declaration
public static AdColonyClientImpl AdColonyClient { get; }
Property Value
Type | Description |
---|---|
AdColonyClientImpl | The ad colony client. |
AdMobClient
Gets the AdMob client.
Declaration
public static AdMobClientImpl AdMobClient { get; }
Property Value
Type | Description |
---|---|
AdMobClientImpl | The ad mob client. |
AppLovinClient
Gets the AppLovin client.
Declaration
public static AppLovinClientImpl AppLovinClient { get; }
Property Value
Type | Description |
---|---|
AppLovinClientImpl | The AppLovin client. |
AudienceNetworkClient
Gets the Facebook Audience Network client.
Declaration
public static AudienceNetworkClientImpl AudienceNetworkClient { get; }
Property Value
Type | Description |
---|---|
AudienceNetworkClientImpl | The audience network client. |
AutoAdLoadingMode
Gets or sets auto ad-loading mode.
Declaration
public static AutoAdLoadingMode AutoAdLoadingMode { get; set; }
Property Value
Type | Description |
---|---|
AutoAdLoadingMode |
ChartboostClient
Gets the Chartboost client.
Declaration
public static ChartboostClientImpl ChartboostClient { get; }
Property Value
Type | Description |
---|---|
ChartboostClientImpl | The chartboost client. |
DataPrivacyConsent
The module-level data privacy consent status, default to ConsentStatus.Unknown.
Declaration
public static ConsentStatus DataPrivacyConsent { get; }
Property Value
Type | Description |
---|---|
ConsentStatus |
HeyzapClient
Gets the Heyzap client.
Declaration
public static HeyzapClientImpl HeyzapClient { get; }
Property Value
Type | Description |
---|---|
HeyzapClientImpl | The heyzap client. |
Instance
Declaration
public static Advertising Instance { get; }
Property Value
Type | Description |
---|---|
Advertising |
IronSourceClient
Gets the ironSource client.
Declaration
public static IronSourceClientImpl IronSourceClient { get; }
Property Value
Type | Description |
---|---|
IronSourceClientImpl | The iron source client. |
MoPubClient
Gets the MoPub client.
Declaration
public static MoPubClientImpl MoPubClient { get; }
Property Value
Type | Description |
---|---|
MoPubClientImpl | The mo pub client. |
TapjoyClient
Gets the Tapjoy client.
Declaration
public static TapjoyClientImpl TapjoyClient { get; }
Property Value
Type | Description |
---|---|
TapjoyClientImpl | The tap joy client. |
UnityAdsClient
Gets the Unity Ads client.
Declaration
public static UnityAdsClientImpl UnityAdsClient { get; }
Property Value
Type | Description |
---|---|
UnityAdsClientImpl | The unity ads client. |
Methods
DestroyBannerAd()
Destroys the default banner ad.
Declaration
public static void DestroyBannerAd()
DestroyBannerAd(BannerAdNetwork, AdPlacement)
Destroys the banner ad of the specified ad network at the specified placement.
Declaration
public static void DestroyBannerAd(BannerAdNetwork adNetwork, AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
BannerAdNetwork | adNetwork | Ad network. |
AdPlacement | placement | Placement. Pass |
GetDataPrivacyConsent(AdNetwork)
Gets the data privacy consent status for the specified ad network.
Declaration
public static ConsentStatus GetDataPrivacyConsent(AdNetwork adNetwork)
Parameters
Type | Name | Description |
---|---|---|
AdNetwork | adNetwork | Ad network. |
Returns
Type | Description |
---|---|
ConsentStatus | The data privacy consent. |
GrantDataPrivacyConsent()
Grants module-level data privacy consent. This consent persists across app launches.
Declaration
public static void GrantDataPrivacyConsent()
Remarks
This method is a wrapper of AdvertisingConsentManager.Instance.GrantDataPrivacyConsent
.
GrantDataPrivacyConsent(AdNetwork)
Grants the provider-level data privacy consent for the specified ad network.
Declaration
public static void GrantDataPrivacyConsent(AdNetwork adNetwork)
Parameters
Type | Name | Description |
---|---|---|
AdNetwork | adNetwork | Ad network. |
HideBannerAd()
Hides the default banner ad.
Declaration
public static void HideBannerAd()
HideBannerAd(BannerAdNetwork, AdPlacement)
Hides the banner ad of the specified ad network at the specified placement.
Declaration
public static void HideBannerAd(BannerAdNetwork adNetwork, AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
BannerAdNetwork | adNetwork | Ad network. |
AdPlacement | placement | Placement. Pass |
IsAdRemoved()
Determines whether ads were removed.
Declaration
public static bool IsAdRemoved()
Returns
Type | Description |
---|---|
System.Boolean |
|
IsInterstitialAdReady()
Determines whether the default interstitial ad is ready to show.
Declaration
public static bool IsInterstitialAdReady()
Returns
Type | Description |
---|---|
System.Boolean |
|
IsInterstitialAdReady(AdPlacement)
Determines whether the interstitial ad of the default interstitial ad network at the specified placement is ready to show.
Declaration
public static bool IsInterstitialAdReady(AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
AdPlacement | placement | Placement. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsInterstitialAdReady(InterstitialAdNetwork, AdPlacement)
Determines whether the interstitial ad of the specified ad network at the specified placement is ready to show.
Declaration
public static bool IsInterstitialAdReady(InterstitialAdNetwork adNetwork, AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
InterstitialAdNetwork | adNetwork | Ad network. |
AdPlacement | placement | Placement. Pass |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsRewardedAdReady()
Determines whether the default rewarded ad is ready to show.
Declaration
public static bool IsRewardedAdReady()
Returns
Type | Description |
---|---|
System.Boolean |
|
IsRewardedAdReady(AdPlacement)
Determines whether the rewarded ad of the default rewarded ad network at the specified placement is ready to show.
Declaration
public static bool IsRewardedAdReady(AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
AdPlacement | placement | Placement. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsRewardedAdReady(RewardedAdNetwork, AdPlacement)
Determines whether the rewarded ad of the specified ad network at the specified placement is ready to show.
Declaration
public static bool IsRewardedAdReady(RewardedAdNetwork adNetwork, AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
RewardedAdNetwork | adNetwork | Ad network. |
AdPlacement | placement | Placement. Pass |
Returns
Type | Description |
---|---|
System.Boolean |
|
LoadInterstitialAd()
Loads the default interstitial ad.
Declaration
public static void LoadInterstitialAd()
LoadInterstitialAd(AdPlacement)
Loads the interstitial ad of the default interstitial ad network at the specified placement.
Declaration
public static void LoadInterstitialAd(AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
AdPlacement | placement | Placement. |
LoadInterstitialAd(InterstitialAdNetwork, AdPlacement)
Loads the interstitial ad of the specified ad network at the specified placement.
Declaration
public static void LoadInterstitialAd(InterstitialAdNetwork adNetwork, AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
InterstitialAdNetwork | adNetwork | Ad network. |
AdPlacement | placement | Placement. Pass |
LoadRewardedAd()
Loads the default rewarded ad.
Declaration
public static void LoadRewardedAd()
LoadRewardedAd(AdPlacement)
Loads the rewarded ad of the default rewarded ad network at the specified placement.
Declaration
public static void LoadRewardedAd(AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
AdPlacement | placement | Placement. |
LoadRewardedAd(RewardedAdNetwork, AdPlacement)
Loads the rewarded ad of the specified ad network at the specified placement.
Declaration
public static void LoadRewardedAd(RewardedAdNetwork adNetwork, AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
RewardedAdNetwork | adNetwork | Ad network. |
AdPlacement | placement | Placement. Pass |
RemoveAds(Boolean)
Removes ads permanently. This is intended to be used with the "Remove Ads" button.
This will hide any banner ad if it is being shown and
prohibit future loading and showing of all ads, except rewarded ads.
You can pass true
to revokeConsents
to also revoke the data privacy consent
of the Advertising module and all supported networks (which may be desirable as rewarded ads are still available).
Note that this method uses PlayerPrefs to store the ad removal status with no encryption/scrambling.
Declaration
public static void RemoveAds(bool revokeConsents = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | revokeConsents | If set to |
ResetRemoveAds()
Resets the ads removal status and allows showing ads again. This is intended for testing purpose only. Note that this method doesn't restore the data privacy consent of the Advertising module and the supported networks.
Declaration
public static void ResetRemoveAds()
RevokeDataPrivacyConsent()
Revokes the module-level data privacy consent. This consent persists across app launches.
Declaration
public static void RevokeDataPrivacyConsent()
Remarks
This method is a wrapper of AdvertisingConsentManager.Instance.RevokeDataPrivacyConsent
.
RevokeDataPrivacyConsent(AdNetwork)
Revokes the provider-level data privacy consent of the specified ad network.
Declaration
public static void RevokeDataPrivacyConsent(AdNetwork adNetwork)
Parameters
Type | Name | Description |
---|---|---|
AdNetwork | adNetwork | Ad network. |
ShowBannerAd(BannerAdNetwork, AdPlacement, BannerAdPosition, BannerAdSize)
Shows the banner ad with the specified parameters.
Declaration
public static void ShowBannerAd(BannerAdNetwork adNetwork, AdPlacement placement, BannerAdPosition position, BannerAdSize size)
Parameters
Type | Name | Description |
---|---|---|
BannerAdNetwork | adNetwork | Ad network. |
AdPlacement | placement | Placement. |
BannerAdPosition | position | Position. |
BannerAdSize | size | Size. |
ShowBannerAd(BannerAdNetwork, BannerAdPosition, BannerAdSize)
Shows a banner ad of the specified ad network at the specified position and size using the default placement.
Declaration
public static void ShowBannerAd(BannerAdNetwork adNetwork, BannerAdPosition position, BannerAdSize size)
Parameters
Type | Name | Description |
---|---|---|
BannerAdNetwork | adNetwork | Ad network. |
BannerAdPosition | position | Position. |
BannerAdSize | size | Ad size, applicable for AdMob banner only. |
ShowBannerAd(BannerAdPosition)
Shows the default banner ad at the specified position.
Declaration
public static void ShowBannerAd(BannerAdPosition position)
Parameters
Type | Name | Description |
---|---|---|
BannerAdPosition | position | Position. |
ShowBannerAd(BannerAdPosition, BannerAdSize)
Shows a banner ad of the default banner ad network at the specified position and size using the default placement.
Declaration
public static void ShowBannerAd(BannerAdPosition position, BannerAdSize size)
Parameters
Type | Name | Description |
---|---|---|
BannerAdPosition | position | Position. |
BannerAdSize | size | Banner ad size. |
ShowInterstitialAd()
Shows the default interstitial ad.
Declaration
public static void ShowInterstitialAd()
ShowInterstitialAd(AdPlacement)
Shows the interstitial ad of the default interstitial ad network at the specified placement.
Declaration
public static void ShowInterstitialAd(AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
AdPlacement | placement | Placement. |
ShowInterstitialAd(InterstitialAdNetwork, AdPlacement)
Shows the interstitial ad of the specified ad network at the specified placement.
Declaration
public static void ShowInterstitialAd(InterstitialAdNetwork adNetwork, AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
InterstitialAdNetwork | adNetwork | Ad network. |
AdPlacement | placement | Placement. Pass |
ShowRewardedAd()
Shows the default rewarded ad.
Declaration
public static void ShowRewardedAd()
ShowRewardedAd(AdPlacement)
Shows the rewarded ad of the default rewarded ad network at the specified placement.
Declaration
public static void ShowRewardedAd(AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
AdPlacement | placement | Placement. |
ShowRewardedAd(RewardedAdNetwork, AdPlacement)
Shows the rewarded ad of the specified ad network at the specified placement.
Declaration
public static void ShowRewardedAd(RewardedAdNetwork adNetwork, AdPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
RewardedAdNetwork | adNetwork | Ad network. |
AdPlacement | placement | Placement. Pass |
Events
AdsRemoved
Occurs when ads have been removed.
Declaration
public static event Action AdsRemoved
Event Type
Type | Description |
---|---|
System.Action |
DataPrivacyConsentUpdated
Raised when the module-level data privacy consent is changed.
Declaration
public static event Action<ConsentStatus> DataPrivacyConsentUpdated
Event Type
Type | Description |
---|---|
System.Action<ConsentStatus> |
InterstitialAdCompleted
Occurs when an interstitial ad is closed.
Declaration
public static event Action<InterstitialAdNetwork, AdPlacement> InterstitialAdCompleted
Event Type
Type | Description |
---|---|
System.Action<InterstitialAdNetwork, AdPlacement> |
RewardedAdCompleted
Occurs when a rewarded ad completed and the user should be rewarded.
Declaration
public static event Action<RewardedAdNetwork, AdPlacement> RewardedAdCompleted
Event Type
Type | Description |
---|---|
System.Action<RewardedAdNetwork, AdPlacement> |
RewardedAdSkipped
Occurs when a rewarded ad is skipped (the user didn't complete watching the ad and therefore is not entitled to the reward).
Declaration
public static event Action<RewardedAdNetwork, AdPlacement> RewardedAdSkipped
Event Type
Type | Description |
---|---|
System.Action<RewardedAdNetwork, AdPlacement> |