💡 Pangle SDK supports App Open Ads from version 4300 and above, this doc is for developers who use Pangle SDK directly, if you use mediation to integrate Pangle, please jump to the link.
App open ads are a special ad format intended for publishers wishing to monetize their app load screens. App open ads can be closed at any time, and are designed to be shown when your users bring your app to the foreground.
Create an app and App Open ad placement on Pangle platform
The main steps to integrate App Open ads are:
AppOpenAdListener
AppOpenAdInteractionListener
set the host app icon when initializing the Pangle SDK.
The app open ad is requested by the loadAppOpenAd()
method of the TTAdNative
class. The loadAppOpenAd method requires an AdSlot
object, an AppOpenAdListener
and a timeout parameter. AdSlot
is the information requested by the user, AppOpenAdListener
is a callback indicating whether the loading succeeds or fails, and timeout
is a parameter that needs to be set for the request timeout.
TTAdNative
is an Ad Loading Manager. It is recommended to be the member variable of the Activity.
App Open Ads fill the entire screen by default.
Call the loadAppOpenAd()
method of the TTAdNative class to load the ad. AdSlot
, AppOpenAdListener
, timeout
objects are required. The TTAppOpenAd object is returned as a parameter in the onAppOpenAdLoaded
callback.
AppOpenAdListener Callback | Description |
onError() | This method is invoked when an ad fails to load. It includes an error parameter of type Error that indicates what type of failure occurred. For more information, refer to the ErrorCode section. |
onAppOpenAdLoaded() | This method is executed when an ad material is loaded successfully. |
App Open ad timeout recommended >=3000ms
After the loading is successful, you need to call the showAppOpenAd()
method to render the ad.
Warning:
AppOpenAdInteractionListener
object to the ad's setter. AppOpenAdInteractionListener
provides some ad event methods to get notified of ads.showAppOpenAd()
method is called. If you don't call the showAppOpenAd()
method, you don't need to set up a listener for the interaction.onAdSkip, onAdCountdownToZero
callbacks empty appOpenAd and call the request ad method to load ads in advance for quick start.AppOpenAdInteractionListener callback | Description |
onAdShow() | This method is invoked when the ad is displayed, covering the device's screen. |
onAdClicked() | This method is invoked when the ad is clicked by the user. |
onAdSkip() | This method is called when the user clicks the skip button. |
onAdCountdownToZero() | Ad countdown ends |
Call the showAppOpenAd()
method to render the ad and it needs to pass in activity.
showAppOpenAd()
method is called. If you don't call the showAppOpenAd()
method, you don't need to set up a listener for the interaction.onAdSkip, onAdCountdownToZero
callbacks empty appOpenAd and call the request ad method to load ads in advance for quick start.For a specific example of loading APP Open Ads, see AppOpenAdActivity
、PangleAppOpenAdManager
in Demo.
Now you have finished the integration. If you wanna test your apps, make sure you use test ads rather than live, production ads. The easiest way to load test ads is to use test mode. It's specially configured to return test ads for every request, and you're free to use it in your own apps while coding, testing, and debugging.
Refer to the How to add a test device? to add your device to the test devices on Pangle platform.