我的代码:
final VunglePub vunglePub = VunglePub.getInstance();
[...]
final AdConfig globalAdConfig = vunglePub.getGlobalAdConfig();
[...]
final VungleAdEventListener vungleListener = new VungleAdEventListener(){
@Override
public void onAdEnd(String placementReferenceId, boolean wasSuccessfulView, boolean wasCallToActionClicked) {
Toast.makeText(Start.this, "1", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdStart(String placemetReferenceId) {
Toast.makeText(Start.this, "2", Toast.LENGTH_SHORT).show();
}
@Override
public void onUnableToPlayAd(String placementReferenceId, String reason) {
Toast.makeText(Start.this, "3", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdAvailabilityUpdate(String placementReferenceId, boolean isAdAvailable) {
Toast.makeText(Start.this, "4", Toast.LENGTH_SHORT).show();
}
};
[...]
创建:
// initialize Publisher SDK with app id, placement reference id list and init callback handler
vunglePub.init(this, "XXXXX", new String[] { "PLACEMEXXXXXX" }, new VungleInitListener() {
@Override
public void onSuccess() {
}
@Override
public void onFailure(Throwable e){
}
});
vunglePub.clearAndSetEventListeners(vungleListener);
globalAdConfig.setSoundEnabled(false);
globalAdConfig.setOrientation(Orientation.autoRotate);
vunglePub.playAd("PLACEMEXXXXX", globalAdConfig);
我的应用程序显示了一个 vungle 广告,但我没有从 vungleListener 获得 onAdEnd 的 Toasts“1”。我找不到我的错误