【发布时间】:2019-12-26 22:16:32
【问题描述】:
我有一个 Cordova/Android 混合应用程序,它使用一个自定义 - 内部 - 插件。除其他外,该插件会获取并显示 AdMob 广告。在我的调试版本中,当我测试东西时,我正在使用 Google 的测试广告,使用
String deviceID = Settings.Secure.getString(context.getContentResolver(),Settings.Secure.ANDROID_ID);
AdRequest.Builder builder = new AdRequest.Builder();
builder.addTestDevice(deviceID);
到目前为止没有问题 - 在我测试应用程序时,我看到了预期的安全测试广告。但是,我想防止有一天我创建发布版本并使用该测试广告代码将其发送到 Play 商店。我想知道...有没有办法将该代码放入条件编译块中,仅当它检测到有问题的构建是 Cordova 调试构建时才会分叉 - cordova build android --debug?
【问题讨论】:
标签: java android cordova conditional-compilation