Parental gate
You can optionally add the AwesomeAds Parental gate to an ad placement. The Parental gate is a dialog that appears when a user clicks on an ad. It is designed to prevent very young users from clicking on an ad without their parent’s assistance.
When the user clicks on the ad, the Parental gate dialog is displayed. It presents a math challenge which the user must solve to proceed to the ad.
The Parental gate is disabled by default. To use the Parental gate, see the following code and examples.
Configure the Parental gate
You can enable the Parental gate on a banner ad using the configuration methods shown here. This example uses a single instance of an ad:
myBanner.enableParentalGate(); // Simple config method
myBanner.setParentalGate(true); // Alternative method with parameter
To disable the Parental gate:
myBanner.disableParentalGate(); // Simple config method
myBanner.setParentalGate(false); // Alternative method
You can configure the Parental gate on all instances of a particular ad type in your app:
// Enabled for all interstitials...
SAInterstitialAd.enableParentalGate();
// Disabled for all videos...
SAVideoAd.disableParentalGate();
Example
using tv.superawesome.sdk.publisher;
public class MainScript : MonoBehaviour {
private SABannerAd banner = null;
void Start() {
// Initialise the SDK (Skip this if you already initialised it elsewhere...)
AwesomeAds.init(true); // In production usages set logging parameter to false
banner = SABannerAd.createInstance();
// Enables the Parental gate for your banner
banner.enableParentalGate();
banner.setCallback ((placementId, evt) => {
if (evt == SAEvent.adLoaded) {
banner.play();
}
});
banner.load(11111); // Replace parameter with your own placement ID
}
}