ios - 应用中存在多个广告实例

标签 ios firebase admob

我使用 Firebase AdMob 模块在我的应用程序中显示插页式广告。我关注这个guide创建它们。我的应用程序在几个地方显示广告。

最佳做法是什么?我应该为显示广告的每个地方创建单独的 GADInterstitialadUnitID 还是创建一个并在它们之间共享?

最佳答案

最好的方法可能是只有一个您在 AppDelegate 中设置的 GADInterstitial 或可能使用 Singleton,这样您就可以在整个应用程序中使用相同的 Ad 实例。这样一来,您只需从要在其上显示广告的 View Controller 访问 AppDelegate 来显示广告,并且还可以避免在任何地方重复您的代码。

关于ios - 应用中存在多个广告实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46217311/

相关文章:

android - 如何将 'Google Consent ' 添加到 flutter 应用程序

ios - 如何让一个 block 运行一次,但每次我启动 viewController 时?

ios - 为什么我收到错误 : 'PFObject' does not have a member named 'subscript' ?

android - 火力地堡数据库 : How to set default value (Timestamp) to field

javascript - Firebase - 对于目录中的项目

list - Flutter:将 Firestore 快照转换为流构建器中的列表

java - 将 Admob 添加到 Android 应用程序 : AdView

ios - Google Advance 原生广告显示问题

iOS9 自定义 UITableViewCell 中的错误分隔符插入

ios - 从 UIUserNotificationTypeNone 传递到 UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeBadge | UI用户通知类型声音