Class AdInstance
Represents an instance of an ad.
Inherited Members
Namespace: Meta.InstantGames
Assembly: Unity.Meta.InstantGames.Sdk.dll
Syntax
public class AdInstance : JsObjectConstructors
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. |