【问题标题】:Interstitial Ads are not displayed after fetching in iOS using Delphi 10.3.3使用 Delphi 10.3.3 在 iOS 中获取后不显示插页式广告
【发布时间】:2020-04-13 12:47:54
【问题描述】:

我试图在我的应用中使用 AdMob 插页式广告。在各种互联网资源和自学的指导和帮助下,我能够在 android 版本中实现这一点。我遇到了 iOS 实现的问题。

经过一番努力,我能够使用适用于 iOS 的“移动广告 SDK”来加载“广告”。我的测试应用程序编译,它甚至获取广告。但是,在将广告展示到屏幕上时,它似乎不起作用。

我尝试使用以下命令显示广告。

procedure TForm8.btnShowAdClick(Sender: TObject);
begin
  {$ifdef android}
  FInterstitial.show;
  {$endif}
  {$ifdef ios}
  if FInterstitial.isReady
  then begin
       ShowMessage ('Showing');
       FInterstitial.presentFromRootViewController
                     (TiOSHelper.SharedApplication.keyWindow.rootViewController);

  end
  else ShowMessage ('Not Ready');
  {$endif}
end;

对此没有任何反应。根据文档,广告应在致电 presentFromRootViewController 后立即显示。我收到“显示”消息,但没有任何反应。我还可以看到,我的interstitialWillPresentScreen 的侦听器正在被调用;这意味着它正在尝试展示广告,但出于某种原因,它没有。

我尝试通过nil 而不是TiOSHelper.SharedApplication.keyWindow.rootViewController,但没有成功。

我正在使用 Google 的 iOS 测试广告单元 ID ca-app-pub-3940256099942544/4411468910 进行测试。我 100% 确定我正在获取广告。每次获取广告时,我都会通过检查FInterstitial.responseInfo.responseIdentifier 来确认这一点。它不只是显示出来...帮助!!!

【问题讨论】:

    标签: ios delphi ads interstitial


    【解决方案1】:

    我想我找到了自己问题的答案。删除该信息 Showmessage 后,我就能看到广告。似乎它以某种方式阻止了广告的视图。但不知道为什么!

    【讨论】:

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