use of com.my.target.ads.InterstitialAd in project mytarget-android by myTargetSDK.
the class MyTargetMopubCustomEventRewardedVideo method checkAndInitializeSdk.
@Override
protected boolean checkAndInitializeSdk(@NonNull Activity launcherActivity, @NonNull Map<String, Object> localExtras, @NonNull Map<String, String> serverExtras) throws Exception {
int slotId = 0;
if (serverExtras.size() == 0 || !serverExtras.containsKey(SLOT_ID_KEY)) {
Log.i(TAG, "Unable to get slotId from parameter json. Probably Admob mediation " + "misconfiguration.");
return false;
}
try {
slotId = Integer.parseInt(serverExtras.get(SLOT_ID_KEY));
} catch (NumberFormatException e) {
Log.d(TAG, "Wrong slotId");
return false;
}
ad = new InterstitialAd(slotId, launcherActivity);
MopubCustomParamsUtils.fillCustomParams(ad.getCustomParams(), localExtras);
ad.setListener(new RewardedListener());
return true;
}
Aggregations