简体   繁体   English

Firebase 远程配置:控制广告

[英]Firebase Remote Config: controlling ads

Does anyone know how to turn ads on and off in Android using firebase Remote Config?有谁知道如何使用 firebase 远程配置在 Android 中打开和关闭广告? I have been given an assignment in which i have to place native ads in android app and then turn them on and off using firebase remote config.我被分配了一项任务,我必须在 android 应用程序中放置原生广告,然后使用 firebase 远程配置打开和关闭它们。

You need to use Firebase Remote Config SDK for your application.您需要为您的应用程序使用 Firebase 远程配置 SDK。

You make a call to this SDK to fetch the data from Firebase servers in the needed place (in most cases it's an app initialization stage) and use the actual value for splitting your in-app logic to decide whether you need to show an ad.您调用此 SDK 以从 Firebase 服务器在所需位置(大多数情况下是应用程序初始化阶段)获取数据,并使用实际值拆分应用程序内逻辑来决定是否需要展示广告。

If the request to fetch data failed (for instance, if the app is launching without internet), it will use the data from the last successful fetch.如果获取数据的请求失败(例如,如果应用程序在没有互联网的情况下启动),它将使用上次成功获取的数据。 If this is the first launch and it's not connected to the Internet, the default values will be used which you set in the client-side code when integrating Firebase Remote Config SDK.如果这是首次启动且未连接到 Internet,则将使用您在集成 Firebase 远程配置 SDK 时在客户端代码中设置的默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM