Search in sources :

Example 1 with CustomParams

use of com.my.target.common.CustomParams in project mytarget-android by myTargetSDK.

the class MyTargetMopubCustomEventBanner method loadBanner.

@Override
protected void loadBanner(Context context, CustomEventBannerListener customEventBannerListener, Map<String, Object> stringObjectMap, Map<String, String> stringStringMap) {
    int slotId;
    if (stringStringMap == null || stringStringMap.size() == 0 || !stringStringMap.containsKey(SLOT_ID_KEY)) {
        Tracer.i("Unable to get slotId from parameter json. Probably Mopub mediation misconfiguration.");
        if (customEventBannerListener != null) {
            customEventBannerListener.onBannerFailed(MoPubErrorCode.NO_FILL);
        }
        return;
    }
    slotId = Integer.parseInt(stringStringMap.get(SLOT_ID_KEY));
    bannerListener = customEventBannerListener;
    if (myTargetView == null) {
        myTargetView = new MyTargetView(context);
        myTargetView.init(slotId, MyTargetView.AdSize.BANNER_320x50, false);
        final CustomParams customParams = myTargetView.getCustomParams();
        if (customParams != null) {
            MopubCustomParamsUtils.fillCustomParams(customParams, stringObjectMap);
        }
        myTargetView.setListener(myTargetViewListener);
    }
    myTargetView.load();
}
Also used : MyTargetView(com.my.target.ads.MyTargetView) CustomParams(com.my.target.common.CustomParams)

Aggregations

MyTargetView (com.my.target.ads.MyTargetView)1 CustomParams (com.my.target.common.CustomParams)1