扑扑Firebase Admob我需要这个吗?

时间:2018-12-03 09:14:56

标签: flutter

我想知道在使用firebase_admob时需要此代码吗? 如果是这样,在发布应用程序时,我应该为keywordscontentUrltestDevices写什么? 我的意思是,发布应用程序时,甚至有必要testDevices

  MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
      keywords: <String>['flutterio', 'beautiful apps'],
      contentUrl: 'https://flutter.io',
      birthday: DateTime.now(),
      childDirected: false,
      designedForFamilies: false,
      gender: MobileAdGender.male, // or MobileAdGender.female, MobileAdGender.unknown
      testDevices: <String>[], // Android emulators are considered test devices
    )

;

2 个答案:

答案 0 :(得分:2)

此信息用于向用户展示广告。

您应使用与您的应用程序相关的关键字。例如:如果您的申请与医院有关,那么您可以使用药物作为关键词。

如果您为特定应用程序开发任何网站,都可以将其添加为 contentUrl

testDevices 是要在其中进行测试的设备的ID。如果要在真实设备上测试应用程序,则必须添加测试设备ID,因为它有助于避免广告暴动。

答案 1 :(得分:0)

MobileAdTargetingInfo类属性反映了本地AdRequest API

您将在AdRequest.BuilderRequestConfiguration.Builder的文档中找到有关这些属性的更多信息。

AdRequest.Builder

公共AdRequest.Builder addKeyword(字符串关键字

添加用于定位的关键字。

公共AdRequest.Builder setContentUrl(字符串 contentUrl

设置内容与应用程序主要内容匹配的网站的内容URL。该网站内容用于定位和品牌安全。

在撰写问题时,某些问题的参数已被弃用,如下面的参数已替换为其他方法,而另一些参数已移至RequestConfiguration.Builder

公共AdRequest.Builder setIsDesignedForFamilies(布尔 isDesignedForFamilies

已弃用。使用广告内容过滤。

RequestConfiguration.Builder

public RequestConfiguration.Builder setTagForChildDirectedTreatment(int tagForChildDirectedTreatment

此方法可让您指定是否出于儿童在线隐私保护法(COPPA)的目的将您的应用视为面向儿童的内容

公共RequestConfiguration.Builder setTestDeviceIds(列表 testDeviceIds

设置与将始终请求测试广告的测试设备相对应的测试设备ID的列表。发出第一个广告请求时,当前设备的测试设备ID将记录在logcat中。

相关问题