Hello Guys我正在整合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会话已正确初始化
我已经看过This问题,但没有帮助。如何才能展示广告?提前致谢
答案 0 :(得分:0)
这不是编码方面的问题,出现此问题是因为当前位置没有广告,请尝试将手机VPN
更改为US
并查看。广告应该开始显示。如果您仍然遇到问题,可以通过support@flurry.com
向flurry支持小组发邮件。他们帮我们解决了问题。