This document has been prepared for publishers updating their existing v6 Vungle SDK integration since Android SDK 6.5.1 has API changes. Publisher updating from Vungle SDK 6.3.24 or 6.4.11 must make following API changes, but only the first item should affect most integration, second item affecting some publishers and last item should affect very few integration.
1. onError
callback from InitCallback,
LoadAdCallback
and PlayAdCallback
now passes VungleException
that contains error message and code instead of Throwable
.
Vungle.init("VUNGLE_APP_ID", getApplicationContext(), new InitCallback() {
...
@Override
public void onError(VungleException exception) { }
...
});
Vungle.loadAd("PLACEMENT_ID", new LoadAdCallback() {
...
@Override
public void onError(final String placementReferenceId, VungleException exception) { }
...
});
Vungle.playAd("PLACEMENT_ID", adConfig, new PlayAdCallback() {
...
@Override
public void onError(final String placementReferenceId, VungleException exception) { }
...
});
Vungle.init("VUNGLE_APP_ID", getApplicationContext(), new InitCallback() {
...
@Override
public void onError(Throwable throwable) { }
...
});
Vungle.loadAd("PLACEMENT_ID", new LoadAdCallback() {
...
@Override
public void onError(final String placementReferenceId, Throwable throwable) { }
...
});
Vungle.playAd("PLACEMENT_ID", adConfig, new PlayAdCallback() {
...
@Override
public void onError(final String placementReferenceId, Throwable throwable) { }
...
});
2. This is only applicable if you were previously using setAutoRotate
feature by passing an AdConfig
object during playAd. Previous SDK had setAutoRotate
method that controls whether video ad can be rotated depending the ad orientation or this feature disabled. v6.5.0 has changed this feature to setAdOrientation
method that configure ad to play in portrait and landscape only or set to auto-rotate.
AdConfig adConfig = new AdConfig();
adConfig.setAdOrientation(AdConfig.AUTO_ROTATE) // AdConfig.PORTRAIT, AdConfig.LANDSCAPE
Vungle.playAd("PLACEMENT_ID", adConfig, vunglePlayAdCallback);
AdConfig adConfig = new AdConfig();
adConfig.setAutoRotate(false); // true by default
Vungle.playAd("PLACEMENT_ID", adConfig, vunglePlayAdCallback);
3. This is only applicable for In-feed type ad which is not commonly used. The getNativeAd
API for In-feed type ad now takes an additional AdConfig
object.
Vungle.getNativeAd("INFEED_ID", new AdConfig(), vunglePlayAdCallback);
Vungle.getNativeAd("INFEED_ID", vunglePlayAdCallback);