public void loadNative() { Debug.Log("Developer load native, placementId = " + mPlacementId_native_all); if (callbackListener == null) { callbackListener = new ATNativeCallbackListener(); ATNativeAd.Instance.setListener(callbackListener); } //new in v5.6.6 Dictionary <string, object> jsonmap = new Dictionary <string, object>(); #if UNITY_ANDROID ATSize nativeSize = new ATSize(960, 600); jsonmap.Add(ATNativeAdLoadingExtra.kATNativeAdLoadingExtraNativeAdSizeStruct, nativeSize); #elif UNITY_IOS || UNITY_IPHONE ATSize nativeSize = new ATSize(320, 250, false); jsonmap.Add(ATNativeAdLoadingExtra.kATNativeAdLoadingExtraNativeAdSizeStruct, nativeSize); #endif ATNativeAd.Instance.loadNativeAd(mPlacementId_native_all, jsonmap); }
public void loadBannerAd() { if (bannerCallback == null) { bannerCallback = new BannerCallback(); ATBannerAd.Instance.setListener(bannerCallback); } Dictionary <string, object> jsonmap = new Dictionary <string, object>(); #if UNITY_ANDROID ATSize bannerSize = new ATSize(960, 150, true); jsonmap.Add(ATBannerAdLoadingExtra.kATBannerAdLoadingExtraBannerAdSizeStruct, bannerSize); jsonmap.Add(ATBannerAdLoadingExtra.kATBannerAdLoadingExtraAdaptiveWidth, bannerSize.width); jsonmap.Add(ATBannerAdLoadingExtra.kATBannerAdLoadingExtraAdaptiveOrientation, ATBannerAdLoadingExtra.kATBannerAdLoadingExtraAdaptiveOrientationPortrait); #elif UNITY_IOS || UNITY_IPHONE ATSize bannerSize = new ATSize(320, 50, false); jsonmap.Add(ATBannerAdLoadingExtra.kATBannerAdLoadingExtraBannerAdSizeStruct, bannerSize); jsonmap.Add(ATBannerAdLoadingExtra.kATBannerAdLoadingExtraAdaptiveWidth, bannerSize.width); jsonmap.Add(ATBannerAdLoadingExtra.kATBannerAdLoadingExtraAdaptiveOrientation, ATBannerAdLoadingExtra.kATBannerAdLoadingExtraAdaptiveOrientationPortrait); #endif ATBannerAd.Instance.loadBannerAd(mPlacementId_banner_all, jsonmap); }