我遵循MoPub文档在MoPub中设置Chartboost Network的中介。
我已经成功地分别集成了Chartboost和MoPub。
我有一个应用程序,其中MoPub集成已经完成并正在运行。现在我也想设置Chartboost中介。
这就是我迄今为止所做的。
- 我在Chartboost上创建了一个应用程序,并获得了应用程序Id和应用程序签名
- 在Mopub Networks中添加了Chartboost Network,其状态为"正在运行"one_answers"已连接">
- 在MoPub网络中添加了Chartboost的AppId和应用签名设置
- 关注https://developers.mopub.com/publishers/mediation/integrate/集成chartboost,建议导入chartboost-jar和以下依赖项
// Chartboost
// This mediated network SDK is not available on JCenter. Ensure you have downloaded and imported it manually into your app project.
implementation 'com.mopub.mediation:chartboost:7.5.0.3'
我还应该做些什么来完成这个集成。因为我的Chartboost仪表板没有启用"请求发布权限"按钮,因为它需要SDK才能成功集成。
附言:我的应用程序已经在谷歌播放上直播
您的build.gradle应该导入Chartboost SDK和Chartboost MoPub适配器。
implementation 'com.chartboost:chartboost-sdk:8.2.0'
implementation 'com.mopub.mediation:chartboost:8.2.0.3'
使用Chartboost作为中介网络初始化MoPub SDK。
Map<String, String> chartboostSettings = new HashMap<>();
chartboostSettings.put("APP_ID_KEY", "my app id");
chartboostSettings.put("APP_SIGNATURE_KEY", "my app signature");
SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder(activity.getString("mopubBannerID"))
.withLogLevel(BuildConfig.DEBUG ? MoPubLog.LogLevel.DEBUG : MoPubLog.LogLevel.NONE)
.withMediatedNetworkConfiguration(ChartboostAdapterConfiguration.class.getName(), chartboostSettings)
.build();
MoPub.initializeSdk(activity, sdkConfiguration, listener or null);
在你的日志中,你会看到类似的内容。
I/MoPub: [com.mopub.common.AdapterConfigurationManager][onNetworkInitializationFinished] SDK Log - class com.mopub.mobileads.ChartboostAdapterConfiguration initialized with error code AdapterConfiguration initialization success.
您的Chartboost SDK现已初始化。祝你好运