我需要在ViewController加载时随机加载插页式广告。为了实现这一点,我使用以下代码:
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyAutomatic;
问题在于,该间隙被加载一次,然后不再显示。
问题是什么?
最佳答案
在the documentation中,ADInterstitialPresentationPolicyAutomatic
表示:
自动政策。 该框架确定何时展示插页式广告。
(强调我的)。
如果您希望它是随机的,我认为您需要ADInterstitialPresentationPolicyManual
,它可以让您控制何时显示插页式广告:
手动政策。该应用程序确定何时应展示插页式广告。使用requestInterstitialAdPresentation
在适当的时间请求展示插页式广告。
因此,请使用ADInterstitialPresentationPolicyManual
,并在需要展示广告时调用requestInterstitialAdPresentation
。
目前尚不清楚“随机加载插页式广告”的含义,但是通过手动方法,您可以控制何时显示它。例如,您可以使用this question中的方法来生成介于0和1之间(包括0和1)的数字,如果数字为1,则显示广告。否则,请勿显示。
关于ios - iAd插页式广告仅加载一次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26146768/