GoogleAdsSDK iOS 是否可以捕获作为内联横幅一部分的网址,然后决定如何打开它?

发布于 2025-01-10 19:58:41 字数 1953 浏览 0 评论 0原文

这不是最常见的情况,但我已经安装了适用于 iOS 的 GoogleAdsSDK,并且它在 Google 提供的测试横幅上运行正常。当我单击横幅时,它会打开其他应用程序/ safari 视图。

我想知道是否可以配置 GoogleAdsSDK,以便我可以检查提供的 URL 是否是我想要在属于我的应用程序一部分的网络视图中本地打开的某个链接。例如,每个链接都应该在外部打开,但是以 www.myshop... 开头的链接应该在属于我的应用程序一部分的 Web 视图中打开吗?

例如 GadBannerViewDelegate 有这些方法:

@protocol GADBannerViewDelegate <NSObject>

@optional

#pragma mark Ad Request Lifecycle Notifications

/// Tells the delegate that an ad request successfully received an ad. The delegate may want to add
/// the banner view to the view hierarchy if it hasn't been added yet.
- (void)bannerViewDidReceiveAd:(nonnull GADBannerView *)bannerView;

/// Tells the delegate that an ad request failed. The failure is normally due to network
/// connectivity or ad availablility (i.e., no fill).
- (void)bannerView:(nonnull GADBannerView *)bannerView
    didFailToReceiveAdWithError:(nonnull NSError *)error;

/// Tells the delegate that an impression has been recorded for an ad.
- (void)bannerViewDidRecordImpression:(nonnull GADBannerView *)bannerView;

/// Tells the delegate that a click has been recorded for the ad.
- (void)bannerViewDidRecordClick:(nonnull GADBannerView *)bannerView;

#pragma mark Click-Time Lifecycle Notifications

/// Tells the delegate that a full screen view will be presented in response to the user clicking on
/// an ad. The delegate may want to pause animations and time sensitive interactions.
- (void)bannerViewWillPresentScreen:(nonnull GADBannerView *)bannerView;

/// Tells the delegate that the full screen view will be dismissed.
- (void)bannerViewWillDismissScreen:(nonnull GADBannerView *)bannerView;

/// Tells the delegate that the full screen view has been dismissed. The delegate should restart
/// anything paused while handling bannerViewWillPresentScreen:.
- (void)bannerViewDidDismissScreen:(nonnull GADBannerView *)bannerView;

这里没有任何内容表明我可以对横幅的点击做出反应并处理该操作,或者甚至是曾经打算支持它,但也许我错过了一些东西?

It is not the most common case, but I have installed GoogleAdsSDK for iOS, and its working ok on test banners supplied by Google. When I click on banner it opens other app / safari view.

What I was wondering is it possible to configure GoogleAdsSDK, so that I can check if URL provided is some link that I want open locally inside web view that is part of my app. For example, every link should be opened externally, but links starting with www.myshop... should be opened in web view that is part of my application?

For example GadBannerViewDelegate has these methods:

@protocol GADBannerViewDelegate <NSObject>

@optional

#pragma mark Ad Request Lifecycle Notifications

/// Tells the delegate that an ad request successfully received an ad. The delegate may want to add
/// the banner view to the view hierarchy if it hasn't been added yet.
- (void)bannerViewDidReceiveAd:(nonnull GADBannerView *)bannerView;

/// Tells the delegate that an ad request failed. The failure is normally due to network
/// connectivity or ad availablility (i.e., no fill).
- (void)bannerView:(nonnull GADBannerView *)bannerView
    didFailToReceiveAdWithError:(nonnull NSError *)error;

/// Tells the delegate that an impression has been recorded for an ad.
- (void)bannerViewDidRecordImpression:(nonnull GADBannerView *)bannerView;

/// Tells the delegate that a click has been recorded for the ad.
- (void)bannerViewDidRecordClick:(nonnull GADBannerView *)bannerView;

#pragma mark Click-Time Lifecycle Notifications

/// Tells the delegate that a full screen view will be presented in response to the user clicking on
/// an ad. The delegate may want to pause animations and time sensitive interactions.
- (void)bannerViewWillPresentScreen:(nonnull GADBannerView *)bannerView;

/// Tells the delegate that the full screen view will be dismissed.
- (void)bannerViewWillDismissScreen:(nonnull GADBannerView *)bannerView;

/// Tells the delegate that the full screen view has been dismissed. The delegate should restart
/// anything paused while handling bannerViewWillPresentScreen:.
- (void)bannerViewDidDismissScreen:(nonnull GADBannerView *)bannerView;

Nothing here suggest that I can react to clicks to banner and handle that action, or even that is was ever intended to support it, but maybe I missed something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

毅然前行 2025-01-17 19:58:41

没有直接的方法来处理bannerview的点击,并且不提供选项(禁止无效流量或误导用户)是有意义的。

不过,您可以通过查看移动会话流量日志中的移动流量来监控点击标签/跟踪 URL。

对于 iOS

启用网络跟踪,请在 plist 文件中将 GADEnableNetworkTracing 键设置为 YES

您可以在控制台日志中使用这些 GMA Debug BEGIN、GMA Debug CONTENT 或 GMA Debug FINISH 命令来查看网络跟踪。

或使用 https://www.charlesproxy.com/

参考

  1. https://developers.google.com/admob/ios/network-tracing
  2. https://support.google.com/admob/answer/7671795?hl=en< /a>

There is no direct way to process click of bannerview and it makes sense to not provide an option (to prohibit invalid traffic or misguiding users).

You can however monitor click tags / tracking URLs by reviewing mobile traffic in a mobile session traffic log.

For iOS

Enable network tracing, set the GADEnableNetworkTracing key to YES in your plist file.

You can use these GMA Debug BEGIN, GMA Debug CONTENT, or GMA Debug FINISH commands in console log to view network tracing.

or use https://www.charlesproxy.com/

Ref

  1. https://developers.google.com/admob/ios/network-tracing
  2. https://support.google.com/admob/answer/7671795?hl=en
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文