【问题标题】:iAd intersitial loaded only onceiAd 插页式广告仅加载一次
【发布时间】:2015-09-01 22:45:01
【问题描述】:

我需要在加载 ViewController 时随机加载插页式广告。为了实现这一点,我使用以下代码:

self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyAutomatic;

问题是插页式广告被加载一次,然后就不再显示了。

有什么问题?

【问题讨论】:

    标签: ios iad


    【解决方案1】:

    来自the documentationADInterstitialPresentationPolicyAutomatic 表示:

    自动策略。 框架决定何时展示插页式广告。

    (强调我的)。

    如果你希望它是随机的,我认为你需要ADInterstitialPresentationPolicyManual,它可以让你控制何时显示插页式广告:

    手动策略。该应用决定何时展示插页式广告。使用requestInterstitialAdPresentation 请求在适当的时间展示插页式广告。

    因此,请使用ADInterstitialPresentationPolicyManual,并在您希望展示广告时调用requestInterstitialAdPresentation

    不清楚您所说的“随机加载插页式广告”是什么意思,但通过手动方法,您可以控制何时显示。例如,您可以使用this question 中的方法生成一个介于 0 和 1 之间的数字(包括 0 和 1),如果是 1,则显示广告。否则不显示。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多