大家好,我正在集成 Flurry 广告网络并尝试显示测试广告,但它给了我以下错误
12-12 11:09:58.669 17082-17627/cpp.eminosoft.com.adserver E/FlurryAgent: Ad server responded but sent no ad units.
12-12 11:09:58.686 17082-17243/cpp.eminosoft.com.adserver E/FlurryAgent: AdRequest: url:https://ads.flurry.com/v16/getAds.do
这是我的代码
new FlurryAgent.Builder()
.withLogEnabled(true)
// .withListener(flurryListener)
.build(this, Keys.FlurryAPIkey);
mFlurryAdInterstitial = new FlurryAdInterstitial(this, "TestNew");
FlurryAdTargeting adTargeting = new FlurryAdTargeting();
adTargeting.setEnableTestAds(true);
mFlurryAdInterstitial.setTargeting(adTargeting);
mFlurryAdInterstitial.fetchAd();
flurryAdInterstitialListener=new FlurryAdInterstitialListener() {
@Override
public void onFetched(FlurryAdInterstitial flurryAdInterstitial) {
Toast.makeText(getApplicationContext(),"Flurry Fetched",Toast.LENGTH_SHORT).show();
mFlurryAdInterstitial.displayAd();
}
@Override
public void onRendered(FlurryAdInterstitial flurryAdInterstitial) {
}
@Override
public void onDisplay(FlurryAdInterstitial flurryAdInterstitial) {
}
@Override
public void onClose(FlurryAdInterstitial flurryAdInterstitial) {
mFlurryAdInterstitial.fetchAd();
}
@Override
public void onAppExit(FlurryAdInterstitial flurryAdInterstitial) {
}
@Override
public void onClicked(FlurryAdInterstitial flurryAdInterstitial) {
}
@Override
public void onVideoCompleted(FlurryAdInterstitial flurryAdInterstitial) {
}
@Override
public void onError(FlurryAdInterstitial flurryAdInterstitial, FlurryAdErrorType flurryAdErrorType, int i) {
Toast.makeText(getApplicationContext(),"Flurry not Fetched error",Toast.LENGTH_SHORT).show();
}
};
mBanner = (FrameLayout)findViewById(R.id.Flurry_banner);
mFlurryAdBanner = new FlurryAdBanner(this, mBanner, mAdSpaceName);
mFlurryAdBanner.fetchAd();
FlurryAdBannerListener bannerAdListener = new FlurryAdBannerListener() {
@Override
public void onFetched(FlurryAdBanner adBanner) {
adBanner.displayAd();
}
@Override
public void onError(FlurryAdBanner adBanner, FlurryAdErrorType adErrorType, int errorCode)
{
Toast.makeText(getApplicationContext(),"Flurry Banner Failed To Load",Toast.LENGTH_SHORT).show();
adBanner.destroy();
}
@Override
public void onRendered(FlurryAdBanner adBanner) {
}
@Override
public void onShowFullscreen(FlurryAdBanner adBanner) {
}
@Override
public void onCloseFullscreen(FlurryAdBanner adBanner) {
}
@Override
public void onAppExit(FlurryAdBanner adBanner) {
}
@Override
public void onClicked(FlurryAdBanner adBanner) {
}
@Override
public void onVideoCompleted(FlurryAdBanner adBanner) {
} };
mFlurryAdBanner.setListener(bannerAdListener);
在按钮单击时,我试图显示插页式并再次获取
mFlurryAdInterstitial.setListener(flurryAdInterstitialListener);
mFlurryAdInterstitial = new FlurryAdInterstitial(this, mAdSpaceName);
FlurryAdTargeting adTargeting = new FlurryAdTargeting();
adTargeting.setEnableTestAds(true);
mFlurryAdInterstitial.setTargeting(adTargeting);
mFlurryAdInterstitial.fetchAd();
Flurry 会话已正确初始化
我已经看过这个问题但没有帮助。如何让广告显示?提前致谢