Unity Ads Api Reference
Unity Ads Api Reference
3.0.1
1 Namespace Documentation 1
1.1 UnityEngine Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 UnityEngine.Advertisements Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2.1 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 UnityEngine.Monetization Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Class Documentation 3
2.1 UnityEngine.Advertisements.Advertisement Class Reference . . . . . . . . . . . . . . . . . . . . . 3
2.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.3 Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 UnityEngine.Advertisements.Advertisement.Banner Class Reference . . . . . . . . . . . . . . . . . 7
2.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 UnityEngine.Advertisements.BannerLoadOptions Class Reference . . . . . . . . . . . . . . . . . . 8
2.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.2 Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 UnityEngine.Advertisements.BannerOptions Class Reference . . . . . . . . . . . . . . . . . . . . . 9
2.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4.2 Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5 UnityEngine.Advertisements.MetaData Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.5.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.5.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.5.4 Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.6 UnityEngine.Advertisements.ShowOptions Class Reference . . . . . . . . . . . . . . . . . . . . . . 12
2.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.6.2 Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Index 13
1 Namespace Documentation
Classes
• class Advertisement
Unity Ads Asset Store Package
• class BannerLoadOptions
Options that can be passed to [[[]]]
• class BannerOptions
Collection of options that can be passed to [[Advertisements.Banner.Show]] to be notified of events within the banner.
• class MetaData
Class for sending various metadata to UnityAds.
• class ShowOptions
Collection of options that can be passed to [[Advertisements.Show]] to modify advertisement behaviour.
Enumerations
• enum BannerPosition
Banner position
• enum PlacementState {
PlacementState.Ready, PlacementState.NotAvailable, PlacementState.Disabled, PlacementState.Waiting,
PlacementState.NoFill }
Various states that Unity Ads placements can be in.
• enum ShowResult { ShowResult.Failed, ShowResult.Skipped, ShowResult.Finished }
ShowResult is passed to [[ShowOptions.resultCallback]] after the advertisement has completed.
1.2.1.1 BannerPosition
Banner position
1.2.1.2 PlacementState
Enumerator
Ready Placement is ready to show ads.
NotAvailable Placement is not available.
Disabled Placement has been disabled.
Waiting Placement is waiting to be ready.
NoFill Placement has no advertisements to show.
1.2.1.3 ShowResult
Enumerator
Failed Indicates that the advertisement failed to complete.
Skipped Indicates that the advertisement was skipped.
Finished Indicates that the advertisement completed successfully.
2 Class Documentation
Classes
• class Banner
Unity Ads Banner
Properties
Parameters
placement←- Placement identifier.
Id
Parameters
game←- Game identifier.
Id
Parameters
gameId Game identifier.
testMode Test mode.
Returns whether an advertisement is ready to be shown for the default placement. Placements are configured per
game in the UnityAds admin site, where you can also set your default placement.
Returns whether an advertisement is ready to be shown for specified placement. Placements are configured per
game in the UnityAds admin site.
Parameters
placement←- Placement identifier.
Id
2.1.2.7 SetMetaData()
Parameters
metaData Metadata container
Show the default placement if it is ready and returns the result in name="finishCallback".
Parameters
showOptions Various show options, including resultCallback.
Parameters
placement←- Placement identifier.
Id
Show the specified placement if it is ready and returns the result in name="finishCallback".
Parameters
placementId Placement identifier.
showOptions Various show options, including resultCallback.
2.1.3.1 debugMode
2.1.3.2 isInitialized
2.1.3.3 isShowing
2.1.3.4 isSupported
2.1.3.5 version
The documentation for this class was generated from the following file:
• /Users/stevenb/Desktop/git/com.unity.ads(cds)/Runtime/Advertisement/Advertisement.cs
Shows the banner with the default placement ID and will fire the callback name="showCallback" on show, and
name="hideCallback" on hide.
Shows the banner with the givden placement ID and no callbacks. and name="hideCallback" on hide.
The documentation for this class was generated from the following file:
• /Users/stevenb/Desktop/git/com.unity.ads(cds)/Runtime/Advertisement/Advertisement.cs
Properties
2.3.2.1 errorCallback
Callback that is fired when an error occurs during banner loading. If this callback is invoked, one should assume
that the banner is not loaded and one may call Load again at a later point in time.
2.3.2.2 loadCallback
Callback that is fired when when the banner is loaded and available to show.
The documentation for this class was generated from the following file:
• /Users/stevenb/Desktop/git/com.unity.ads(cds)/Runtime/Advertisement/BannerOptions.cs
Collection of options that can be passed to [[Advertisements.Banner.Show]] to be notified of events within the
banner.
Properties
Collection of options that can be passed to [[Advertisements.Banner.Show]] to be notified of events within the
banner.
2.4.2.1 hideCallback
2.4.2.2 showCallback
Callback that is fired when when the banner is visible to the gamer.
The documentation for this class was generated from the following file:
• /Users/stevenb/Desktop/git/com.unity.ads(cds)/Runtime/Advertisement/BannerOptions.cs
Properties
2.5.2.1 MetaData()
UnityEngine.Advertisements.MetaData.MetaData (
string category )
2.5.3.1 Get()
object UnityEngine.Advertisements.MetaData.Get (
string key )
2.5.3.2 Set()
void UnityEngine.Advertisements.MetaData.Set (
string key,
object value )
Parameters
key Metadata key.
value Metadata value. Must be JSON serializable.
2.5.3.3 Values()
2.5.4.1 category
Metadata category.
The documentation for this class was generated from the following file:
• /Users/stevenb/Desktop/git/com.unity.ads(cds)/Runtime/Advertisement/MetaData.cs
Properties
2.6.2.1 gamerSid
2.6.2.2 resultCallback
The documentation for this class was generated from the following file:
• /Users/stevenb/Desktop/git/com.unity.ads(cds)/Runtime/Advertisement/ShowOptions.cs
category Set
UnityEngine.Advertisements.MetaData, 12 UnityEngine.Advertisements.MetaData, 11
SetMetaData
debugMode UnityEngine.Advertisements.Advertisement, 5
UnityEngine.Advertisements.Advertisement, 7 Show
Disabled UnityEngine.Advertisements.Advertisement, 6
UnityEngine.Advertisements, 2 UnityEngine.Advertisements.Advertisement.Banner,
8
errorCallback
showCallback
UnityEngine.Advertisements.BannerLoadOptions,
UnityEngine.Advertisements.BannerOptions, 10
9
ShowResult
UnityEngine.Advertisements, 2
Failed
Skipped
UnityEngine.Advertisements, 3
UnityEngine.Advertisements, 3
Finished
UnityEngine.Advertisements, 3
UnityEngine, 1
gamerSid UnityEngine.Advertisements, 1
UnityEngine.Advertisements.ShowOptions, 12 BannerPosition, 2
Get Disabled, 2
UnityEngine.Advertisements.MetaData, 11 Failed, 3
GetPlacementState Finished, 3
UnityEngine.Advertisements.Advertisement, 4 NoFill, 2
NotAvailable, 2
hideCallback PlacementState, 2
UnityEngine.Advertisements.BannerOptions, 10 Ready, 2
ShowResult, 2
Initialize Skipped, 3
UnityEngine.Advertisements.Advertisement, 4, 5 Waiting, 2
isInitialized UnityEngine.Advertisements.Advertisement, 3
UnityEngine.Advertisements.Advertisement, 7 debugMode, 7
IsReady GetPlacementState, 4
UnityEngine.Advertisements.Advertisement, 5 Initialize, 4, 5
isShowing isInitialized, 7
UnityEngine.Advertisements.Advertisement, 7 IsReady, 5
isSupported isShowing, 7
UnityEngine.Advertisements.Advertisement, 7 isSupported, 7
SetMetaData, 5
loadCallback Show, 6
UnityEngine.Advertisements.BannerLoadOptions, version, 7
9 UnityEngine.Advertisements.Advertisement.Banner, 7
Show, 8
MetaData
UnityEngine.Advertisements.BannerLoadOptions, 8
UnityEngine.Advertisements.MetaData, 11
errorCallback, 9
loadCallback, 9
NoFill
UnityEngine.Advertisements.BannerOptions, 9
UnityEngine.Advertisements, 2
hideCallback, 10
NotAvailable
showCallback, 10
UnityEngine.Advertisements, 2
UnityEngine.Advertisements.MetaData, 10
PlacementState category, 12
UnityEngine.Advertisements, 2 Get, 11
MetaData, 11
Ready Set, 11
UnityEngine.Advertisements, 2 Values, 11
14 INDEX
UnityEngine.Advertisements.ShowOptions, 12
gamerSid, 12
resultCallback, 12
UnityEngine.Monetization, 3
Values
UnityEngine.Advertisements.MetaData, 11
version
UnityEngine.Advertisements.Advertisement, 7
Waiting
UnityEngine.Advertisements, 2