public void LoadAd(AdRequest request) { IntPtr requestPtr = Externs.GADUCreateRequest(); foreach (string keyword in request.Keywords) { Externs.GADUAddKeyword(requestPtr, keyword); } foreach (string deviceId in request.TestDevices) { Externs.GADUAddTestDevice(requestPtr, deviceId); } if (request.Birthday.HasValue) { DateTime birthday = request.Birthday.GetValueOrDefault(); Externs.GADUSetBirthday(requestPtr, birthday.Year, birthday.Month, birthday.Day); } if (request.Gender.HasValue) { Externs.GADUSetGender(requestPtr, (int)request.Gender.GetValueOrDefault()); } if (request.TagForChildDirectedTreatment.HasValue) { Externs.GADUTagForChildDirectedTreatment( requestPtr, request.TagForChildDirectedTreatment.GetValueOrDefault()); } foreach (KeyValuePair<string, string> entry in request.Extras) { Externs.GADUSetExtra(requestPtr, entry.Key, entry.Value); } // Indicate that the request is coming from this Unity plugin. Externs.GADUSetExtra(requestPtr, "unity", "1"); Externs.GADURequestInterstitial(InterstitialPtr, requestPtr); Externs.GADURelease(requestPtr); }
// Load an ad. public void LoadAd(AdRequest request, string adUnitId) { IntPtr requestPtr = Utils.BuildAdRequest(request); Externs.GADURequestRewardBasedVideoAd( RewardBasedVideoAdPtr, requestPtr, adUnitId); Externs.GADURelease(requestPtr); }
// Creates an ad request. public static IntPtr BuildAdRequest(AdRequest request) { IntPtr requestPtr = Externs.GADUCreateRequest(); foreach (string keyword in request.Keywords) { Externs.GADUAddKeyword(requestPtr, keyword); } foreach (string deviceId in request.TestDevices) { Externs.GADUAddTestDevice(requestPtr, deviceId); } if (request.Birthday.HasValue) { DateTime birthday = request.Birthday.GetValueOrDefault(); Externs.GADUSetBirthday(requestPtr, birthday.Year, birthday.Month, birthday.Day); } if (request.Gender.HasValue) { Externs.GADUSetGender(requestPtr, (int)request.Gender.GetValueOrDefault()); } if (request.TagForChildDirectedTreatment.HasValue) { Externs.GADUTagForChildDirectedTreatment( requestPtr, request.TagForChildDirectedTreatment.GetValueOrDefault()); } foreach (KeyValuePair<string, string> entry in request.Extras) { Externs.GADUSetExtra(requestPtr, entry.Key, entry.Value); } return requestPtr; }
// Loads an ad. public void LoadAd(AdRequest request) { IntPtr requestPtr = Utils.BuildAdRequest(request); Externs.GADURequestInterstitial(InterstitialPtr, requestPtr); Externs.GADURelease(requestPtr); }
// Loads a native express ad. public void LoadAd(AdRequest request) { this.client.LoadAd(request); }
// Load an ad. public void LoadAd(AdRequest request) { bannerView.Call("loadAd", Utils.GetAdRequestJavaObject(request)); }
public void LoadAd(AdRequest request) { Debug.Log("Dummy " + MethodBase.GetCurrentMethod().Name); }
public static AndroidJavaObject GetAdRequestJavaObject(AdRequest request) { AndroidJavaObject adRequestBuilder = new AndroidJavaObject(AdRequestBuilderClassName); foreach (string keyword in request.Keywords) { adRequestBuilder.Call<AndroidJavaObject>("addKeyword", keyword); } foreach (string deviceId in request.TestDevices) { if (deviceId == AdRequest.TestDeviceSimulator) { string emulatorDeviceId = new AndroidJavaClass(AdRequestClassName) .GetStatic<string>("DEVICE_ID_EMULATOR"); adRequestBuilder.Call<AndroidJavaObject>("addTestDevice", emulatorDeviceId); } else { adRequestBuilder.Call<AndroidJavaObject>("addTestDevice", deviceId); } } if (request.Birthday.HasValue) { DateTime birthday = request.Birthday.GetValueOrDefault(); AndroidJavaObject birthdayObject = new AndroidJavaObject( DateClassName, birthday.Year, birthday.Month, birthday.Day); adRequestBuilder.Call<AndroidJavaObject>("setBirthday", birthdayObject); } if (request.Gender.HasValue) { int? genderCode = null; switch(request.Gender.GetValueOrDefault()) { case Gender.Unknown: genderCode = new AndroidJavaClass(AdRequestClassName) .GetStatic<int>("GENDER_UNKNOWN"); break; case Gender.Male: genderCode = new AndroidJavaClass(AdRequestClassName) .GetStatic<int>("GENDER_MALE"); break; case Gender.Female: genderCode = new AndroidJavaClass(AdRequestClassName) .GetStatic<int>("GENDER_FEMALE"); break; } if (genderCode.HasValue) { adRequestBuilder.Call<AndroidJavaObject>("setGender", genderCode); } } if (request.TagForChildDirectedTreatment.HasValue) { adRequestBuilder.Call<AndroidJavaObject>( "tagForChildDirectedTreatment", request.TagForChildDirectedTreatment.GetValueOrDefault()); } // Denote that the request is coming from this Unity plugin. adRequestBuilder.Call<AndroidJavaObject>("setRequestAgent", "unity-" + AdRequest.Version); AndroidJavaObject bundle = new AndroidJavaObject(BundleClassName); foreach (KeyValuePair<string, string> entry in request.Extras) { bundle.Call("putString", entry.Key, entry.Value); } AndroidJavaObject extras = new AndroidJavaObject(AdMobExtrasClassName, bundle); adRequestBuilder.Call<AndroidJavaObject>("addNetworkExtras", extras); return adRequestBuilder.Call<AndroidJavaObject>("build"); }
// Loads a new rewarded ad. public void LoadAd(AdRequest request) { client.LoadAd(this.adUnitId, request); }
public void LoadAd(AdRequest request) { }
// Loads an ad. public void LoadAd(AdRequest request) { IntPtr requestPtr = Utils.BuildAdRequest(request); Externs.GADURequestNativeExpressAd(this.NativeExpressAdViewPtr, requestPtr); Externs.GADURelease(requestPtr); }
// Loads a new reward based video ad request public void LoadAd(AdRequest request, string adUnitId) { client.LoadAd(request, adUnitId); }
// Load an ad. public void LoadAd(AdRequest request) { IntPtr requestPtr = GADUCreateRequest(); foreach (string keyword in request.Keywords) { GADUAddKeyword(requestPtr, keyword); } foreach (string deviceId in request.TestDevices) { GADUAddTestDevice(requestPtr, deviceId); } if (request.Birthday.HasValue) { DateTime birthday = request.Birthday.GetValueOrDefault(); GADUSetBirthday(requestPtr, birthday.Year, birthday.Month, birthday.Day); } if (request.Gender.HasValue) { GADUSetGender(requestPtr, (int)request.Gender.GetValueOrDefault()); } if (request.TagForChildDirectedTreatment.HasValue) { GADUTagForChildDirectedTreatment( requestPtr, request.TagForChildDirectedTreatment.GetValueOrDefault()); } foreach (KeyValuePair<string, string> entry in request.Extras) { GADUSetExtra(requestPtr, entry.Key, entry.Value); } GADURequestBannerAd(BannerViewPtr, requestPtr); GADURelease(requestPtr); }
// Load an ad. public void LoadAd(AdRequest request, string adUnitId) { IntPtr requestPtr = Externs.GADUCreateRequest(); foreach (string keyword in request.Keywords) { Externs.GADUAddKeyword(requestPtr, keyword); } foreach (string deviceId in request.TestDevices) { Externs.GADUAddTestDevice(requestPtr, deviceId); } if (request.Birthday.HasValue) { DateTime birthday = request.Birthday.GetValueOrDefault(); Externs.GADUSetBirthday(requestPtr, birthday.Year, birthday.Month, birthday.Day); } if (request.Gender.HasValue) { Externs.GADUSetGender(requestPtr, (int)request.Gender.GetValueOrDefault()); } if (request.TagForChildDirectedTreatment.HasValue) { Externs.GADUTagForChildDirectedTreatment( requestPtr, request.TagForChildDirectedTreatment.GetValueOrDefault()); } foreach (KeyValuePair<string, string> entry in request.Extras) { Externs.GADUSetExtra(requestPtr, entry.Key, entry.Value); } Externs.GADURequestRewardBasedVideoAd( RewardBasedVideoAdPtr, requestPtr, adUnitId, userId); Externs.GADURelease(requestPtr); }
public void LoadAd(AdRequest request, string adUnitId) { Debug.Log("Dummy LoadAd"); }
public void LoadAd(AdRequest request) { adLoaderClient.LoadAd(request); }
public void LoadAd(AdRequest request) { adLoader.Call("loadAd", Utils.GetAdRequestJavaObject(request)); }
public void LoadAd(AdRequest request) { adLoaderClient.LoadAd(request); }
public void LoadAd(AdRequest request) { Debug.Log("Dummy LoadAd"); }
// Loads an ad. public void LoadAd(AdRequest request) { this.nativeExpressAdView.Call("loadAd", Utils.GetAdRequestJavaObject(request)); }
// Loads an ad. public void LoadAd(AdRequest request) { IntPtr requestPtr = Utils.BuildAdRequest(request); Externs.GADURequestBannerAd(this.BannerViewPtr, requestPtr); Externs.GADURelease(requestPtr); }
// Loads an ad. public void LoadAd(AdRequest request) { interstitial.Call("loadAd", Utils.GetAdRequestJavaObject(request)); }
// Loads an ad into the BannerView. public void LoadAd(AdRequest request) { client.LoadAd(request); }
// Loads a new reward based video ad request public void LoadAd(AdRequest request, string adUnitId) { client.LoadAd(request, adUnitId); }
public void LoadAd(AdRequest request) { IntPtr requestPtr = Utils.BuildAdRequest(request); Externs.GADURequestNativeAd(this.AdLoaderPtr, requestPtr); Externs.GADURelease(requestPtr); }
public void LoadAd(AdRequest request, string adUnitId) { androidRewardBasedVideo.Call("loadAd", Utils.GetAdRequestJavaObject(request), adUnitId); }