我正在尝试将Vungle广告整合到我的Android项目中。我的代码中的所有内容都类似于Vungle SDK中提到的内容 - Developer Guide和Advanced Settings。
但是当我致电vunglePub.playAd();
时,onAdUnavailable(String reason)
会被调用结果“没有缓存或流式广告可用”。无论我是否连接到Internet,每次我想要添加时都会发生这种情况。互联网无处不在,浏览器,Play商店,其他所有广告,甚至其他应用上的Vungle Ads都可以播放。
我的听众看起来像这样:
private final EventListener vungleListener = new EventListener() {
@Override
public void onVideoView(boolean isCompletedView, int watchedMillis, int videoDurationMillis) {
Log.d(MY_LOGS, "onVideoView");
}
@Override
public void onAdStart() {
Log.d(MY_LOGS, "onAdStart");
// Called before playing an ad
}
@Override
public void onAdEnd(boolean wasCallToActionClicked) {
Log.d(MY_LOGS, "wasCallToActionClicked");
// Called when the user leaves the ad and control is returned to your application
}
@Override
public void onCachedAdAvailable() {
Log.d(MY_LOGS, "onCachedAdAvailable");
// Called when an ad is downloaded and may be played
}
@Override
public void onAdUnavailable(String reason) {
Log.d(MY_LOGS, "onAdUnavailable, reason: " + reason);
// Called when VunglePub.playAd() was called, but no ad was available to play
}
};
P.S。我的问题与此问题完全相同,Vungle ads not available: