Early Access - Android SDK 6.5.0 API Changes

This document has been prepared for publishers updating their existing v6 Vungle SDK integration as Android SDK 6.5.0 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.

New onError callback API for v6.5.0
InitCallback LoadAdCallback PlayAdCallback
Vungle.init("VUNGLE_APP_ID", getApplicationContext(), new InitCallback() {
  ...
  @Override
  public void onError(VungleException exception) { }
  ...
});
Deprecated onError callback for legacy v6
InitCallback LoadAdCallback PlayAdCallback
Vungle.init("VUNGLE_APP_ID", getApplicationContext(), new InitCallback() {
  ...
  @Override
  public void onError(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.

New setAdOrientation for v6.5.0
AdConfig adConfig = new AdConfig();
adConfig.setAdOrientation(AdConfig.AUTO_ROTATE) // AdConfig.PORTRAIT, AdConfig.LANDSCAPE
Vungle.playAd("PLACEMENT_ID", adConfig, vunglePlayAdCallback);
Deprecated setAutoRotate for legacy v6
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.

New In-feed type getNativeAd API for v6.5.0
Vungle.getNativeAd("INFEED_ID", new AdConfig(), vunglePlayAdCallback);
Deprecated In-feed type getNativeAd API for legacy v6
Vungle.getNativeAd("INFEED_ID", vunglePlayAdCallback);
Was this article helpful?

Questions?

Need further assistance, feel free to reach out to us, we’re here to help!