android - 亚马逊设备的 Admob 问题
问题描述
我有一个带有 admob 广告的 android 应用程序提交给 google play,并且运行良好。我还向亚马逊应用商店提交了相同的应用程序。在亚马逊方面,该应用程序不显示任何广告!我应该在我的应用程序上寻找问题,还是让谷歌 admob 停止在亚马逊设备上显示广告?!
解决方案
问题似乎出在设备上,因为它可能没有安装 google playservices,您可以使用以下代码进行检查。
private boolean checkPlayServices() {
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS) {
if (apiAvailability.isUserResolvableError(resultCode)) {
apiAvailability.getErrorDialog(this, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST)
.show();
} else {
Log.i(TAG, "This device is not supported.");
finish();
}
return false;
}
return true;
}
推荐阅读
- laravel - Laravel Eloquent 中两个表的连接结果错误?
- github-actions - GitHub Actions 工作
- python - 任何py文件都可以称为模块吗?
- python - 如何将变量和 UOM 插入为 ManyToManyField
- python-3.x - 将多个文件合并为单个文件,新文件文件应合并到输出文件中的新行
- arrays - 如何使用 jsonb_set 改变 jsonb 中的值
- autocomplete - Visual Studio 或 ReSharper 的自定义自动完成功能
- python - Python:如何将数据框导出到现有 Excel 工作表但不创建新工作表
- python - 无法用python读取文件
- pine-script - 将夏令时构建到脚本中以定义交易开放时间 Pinescript