capacitor-unity-ads
v1.0.0
Published
Capacitor plugin for Unity Ads integration with support for rewarded video and interstitial ads
Maintainers
Readme
capacitor-unity-ads
plugin per gestire ads unity
Install
npm install capacitor-unity-ads
npx cap syncAPI
initialize(...)loadRewardedVideo(...)showRewardedVideo()isRewardedVideoLoaded()loadInterstitial(...)showInterstitial()isInterstitialLoaded()setTestMode(...)getVersion()- Interfaces
initialize(...)
initialize(options: { gameId: string; testMode?: boolean; }) => Promise<void>Initialize Unity Ads SDK
| Param | Type |
| ------------- | ---------------------------------------------------- |
| options | { gameId: string; testMode?: boolean; } |
loadRewardedVideo(...)
loadRewardedVideo(options: { placementId: string; }) => Promise<void>Load a rewarded video ad
| Param | Type |
| ------------- | ------------------------------------- |
| options | { placementId: string; } |
showRewardedVideo()
showRewardedVideo() => Promise<{ success: boolean; reward?: RewardInfo; }>Show a rewarded video ad
Returns: Promise<{ success: boolean; reward?: RewardInfo; }>
isRewardedVideoLoaded()
isRewardedVideoLoaded() => Promise<{ loaded: boolean; }>Check if rewarded video ad is loaded
Returns: Promise<{ loaded: boolean; }>
loadInterstitial(...)
loadInterstitial(options: { placementId: string; }) => Promise<void>Load an interstitial ad
| Param | Type |
| ------------- | ------------------------------------- |
| options | { placementId: string; } |
showInterstitial()
showInterstitial() => Promise<{ success: boolean; }>Show an interstitial ad
Returns: Promise<{ success: boolean; }>
isInterstitialLoaded()
isInterstitialLoaded() => Promise<{ loaded: boolean; }>Check if interstitial ad is loaded
Returns: Promise<{ loaded: boolean; }>
setTestMode(...)
setTestMode(options: { enabled: boolean; }) => Promise<void>Set test mode
| Param | Type |
| ------------- | ---------------------------------- |
| options | { enabled: boolean; } |
getVersion()
getVersion() => Promise<{ version: string; }>Get Unity Ads version
Returns: Promise<{ version: string; }>
Interfaces
RewardInfo
| Prop | Type |
| ------------ | ------------------- |
| type | string |
| amount | number |
