This is unreleased documentation for Taro 文档 Next version.
For up-to-date documentation, see the latest version (3.x).
Version: Next
InterstitialAd
Interstitial ad component. This is a native component at a higher layer than normal components. Each time the interstitial ad component is created, a new instance (interstitial ad instances on the Mini Program cannot be used across pages) is returned. Interstitial ads are hidden by default, and InterstitialAd.show() must be called to display them.
If an interstitial ad fails to display. the InterstitialAd.show() method returns a rejected Promise, which allows the developer to obtain the error code and the error message.
Code
Exception
Cause
2001
Rate limit triggered
Interstitial ads cannot be displayed for a certain time after the Mini Program starts.
2002
Rate limit triggered
Interstitial ads cannot be displayed until a specified interval elapses after the display of a previous interstitial ad or rewarded video ad.
2003
Rate limit triggered
Interstitial ads cannot be displayed when a rewarded video ad or another interstitial ad is being displayed.
2004
Failed to render ad
This error is not caused by the developer's abnormal operation. It may be a result of switching between Mini Program pages.
2005
Unusual ad call
Cross-page calls are not allowed for interstitial ad instances.