AdRequest

Ad Service

Class

Operation to request an ad to show up

Properties

adType

The type of ad that was requested.

hasStarted

Returns true if the request has started.

succeeded

True if the award request succeeded

Methods

InvokeStartedEvent()

Invokes the completion event.

SetStartedEvent(Action<SpatialAsyncOperation>)

Sets the started event, same as setting the event using the started property, but returns the operation itself.

Events

started

Event that is invoked when the operation has started.

Inherited Members

InvokeCompletionEvent()

Invokes the completion event.

completed

Event that is invoked when the operation is completed.

isDone

Returns true if the operation is done.

keepWaiting

Returns true if the operation is not done.

Extension Methods

SetCompletedEvent<T>(T, Action<T>)

Sets the completion event, same as setting the event using the completed property, but returns the operation itself.

Examples

public void WatchAd()
{
if (!SpatialBridge.adService.isSupported)
return;

SpatialBridge.adService.RequestAd(SpatialAdType.Rewarded).SetCompletedEvent((request) => {
if (request.succeeded)
{
Debug.Log("Ad succeeded");
}
});
}
public void WatchAd()
{
if (!SpatialBridge.adService.isSupported)
return;

SpatialBridge.adService.RequestAd(SpatialAdType.Rewarded).SetCompletedEvent((request) => {
if (request.succeeded)
{
Debug.Log("Ad succeeded");
}
});
}