docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class AdInstance

    Represents an instance of an ad.

    Inheritance
    object
    JsObject
    AdInstance
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Meta.InstantGames.v8
    Assembly: Unity.Meta.InstantGames.Sdk.v8.dll
    Syntax
    public class AdInstance : JsObject

    Constructors

    AdInstance()

    Construct an instance of AdInstance

    Declaration
    public AdInstance()

    Methods

    GetPlacementID()

    Return the Audience Network placement ID of this ad instance.

    Declaration
    public string GetPlacementID()
    Returns
    Type Description
    string

    The Audience Network placement ID of this ad instance.

    LoadAsync()

    Preload the ad. The returned WebTask resolves when the preload completes, and rejects if it failed. Exceptions: ADS_FREQUENT_LOAD, ADS_NO_FILL, INVALID_PARAM, NETWORK_FAILURE

    Declaration
    public WebTask LoadAsync()
    Returns
    Type Description
    WebTask

    A WebTask that resolves when the ad is preloaded.

    ShowAsync()

    Present the ad. The returned WebTask resolves when user finished watching the ad, and rejects if it failed to present or was closed during the ad. Exceptions: ADS_NOT_LOADED, INVALID_PARAM, NETWORK_FAILURE, INVALID_OPERATION, RATE_LIMITED, USER_INPUT

    Declaration
    public WebTask ShowAsync()
    Returns
    Type Description
    WebTask

    A WebTask that resolves when the user finishes watching the ad.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)