Non rewarded Ads
levching edited this page Apr 14, 2020
·
3 revisions
First of all the ads has to be loaded before you can display it. See the code snippet below:
using SA.CrossPlatform.Advertisement;
...
//You can use any configured UM_AdPlatform here
//This example will use Unity ads, that's why we get client with UM_AdPlatform.Unity
UM_iAdsClient client = UM_AdvertisementService.GetClient(UM_AdPlatform.Unity);
client.NonRewardedAds.Load((result) => {
if (result.IsSucceeded) {
Debug.Log("NonRewardedAds loaded");
} else {
Debug.Log("Failed to load NonRewardedAds: " + result.Error.Message);
}
});
The load status can always be accessed via IsReady property.
bool ready = client.NonRewardedAds.IsReady;
Once ad content is loaded, you may show it:
m_adsClient.NonRewardedAds.Show(() => {
Debug.Log("Non Rewarded Ads closed");
});
Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Application
- Dark Mode
- Native Dialogs
- Native Preloader
- Date Picker Dialog
- Time Picker Dialog
- Rate Us Dialog
- Build Info
- Locale
- Permissions
- Wheel Picker Dialog
- Getting Started
- Connecting to The Service
- Purchase flow
- Transactions Validation
- Test Inside the Editor
- Advanced use cases
- Getting Started
- Enabling the Ads Service
- Banner Ads
- Non-rewarded Ads
- Rewarded Ads
- Unity Ads
- Google AdMob
- Chartboost
- Getting Started
- Analytics API
- Automatic Tracking
- Unity Analytics
- Firebase Analytics
- Facebook Analytics