docs.unity3d.com
    Show / Hide Table of Contents

    Class Advertisement.Banner

    A static class for implementing banner ads.

    Inheritance
    Object
    Advertisement.Banner
    Namespace: UnityEngine.Advertisements
    Syntax
    public static class Banner

    Properties

    isLoaded

    Returns true if a banner is currently available, and false if it isn't.

    Declaration
    public static bool isLoaded { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Hide(Boolean)

    Allows you to hide a banner ad, instead of destroying it altogether.

    Declaration
    public static void Hide(bool destroy = false)
    Parameters
    Type Name Description
    Boolean destroy

    Load()

    Loads the banner ad with the default Placement, and no callbacks.

    Declaration
    public static void Load()

    Load(String)

    Loads the banner ad with a specified Placement, and no callbacks.

    Declaration
    public static void Load(string placementId)
    Parameters
    Type Name Description
    String placementId

    The unique identifier for a specific Placement, found on the developer dashboard.

    Load(String, BannerLoadOptions)

    Loads the banner ad with a specified Placement, but fires the loadCallback callback on successful load, and the errorCallback callback on failure to load.

    Declaration
    public static void Load(string placementId, BannerLoadOptions options)
    Parameters
    Type Name Description
    String placementId

    The unique identifier for a specific Placement, found on the developer dashboard.

    BannerLoadOptions options

    A collection of options that notify the SDK of events when loading the banner.

    Load(BannerLoadOptions)

    Loads the banner ad with the default Placement, but fires the loadCallback callback on successful load, and the errorCallback callback on failure to load.

    Declaration
    public static void Load(BannerLoadOptions options)
    Parameters
    Type Name Description
    BannerLoadOptions options

    A collection of options that notify the SDK of events when loading the banner.

    SetPosition(BannerPosition)

    Sets the position of the banner ad, using the BannerPosition enum.

    Banner position defaults to BannerPosition.BOTTOM_CENTER.

    Declaration
    public static void SetPosition(BannerPosition position)
    Parameters
    Type Name Description
    BannerPosition position

    An enum representing the on-screen anchor position of the banner ad.

    Show(String)

    Displays the banner ad with a specified Placement, and no callbacks.

    Declaration
    public static void Show(string placementId)
    Parameters
    Type Name Description
    String placementId

    The unique identifier for a specific Placement, found on the developer dashboard.

    Show(String, BannerOptions)

    Displays the banner ad with a specified Placement, but fires the showCallback callback if the banner is visible, and the hideCallback if it isn't.

    Declaration
    public static void Show(string placementId, BannerOptions options)
    Parameters
    Type Name Description
    String placementId

    The unique identifier for a specific Placement, found on the developer dashboard.

    BannerOptions options

    A collection of options that notify the SDK of events when displaying the banner.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023