protected override void InternalInit() { #if EM_CHARTBOOST mAdSettings = EM_Settings.Advertising.Chartboost; Chartboost.didCacheInterstitial += CBDidCacheInterstitial; Chartboost.didClickInterstitial += CBDidClickInterstitial; Chartboost.didCloseInterstitial += CBDidCloseInterstitial; Chartboost.didDismissInterstitial += CBDidDismissInterstitial; Chartboost.didFailToLoadInterstitial += CBDidFailToLoadInterstitial; Chartboost.didCacheRewardedVideo += CBDidCacheRewardedVideo; Chartboost.didClickRewardedVideo += CBDidClickRewardedVideo; Chartboost.didCloseRewardedVideo += CBDidCloseRewardedVideo; Chartboost.didDismissRewardedVideo += CBDidDismissRewardedVideo; Chartboost.didFailToLoadRewardedVideo += CBDidFailToLoadRewardedVideo; Chartboost.didCompleteRewardedVideo += CBDidCompleteRewardedVideo; // Create Chartboost object. // We'll handle ad loading, so turning off Chartboost's autocache feature. Chartboost.Create(); Chartboost.setAutoCacheAds(false); // Set GDPR consent (if any) *after* the SDK is started, // as recommended by the "restrictDataCollection* method. var consent = GetApplicableDataPrivacyConsent(); ApplyDataPrivacyConsent(consent); // Done initialization. mIsInitialized = true; Debug.Log("Chartboost client has been initialized."); #endif }
//------------------------------------------------------------ // Init. //------------------------------------------------------------ public void Init(AdSettings settings) { #if EM_CHARTBOOST if (isInitialized) { Debug.Log("Chartboost client is already initialized. Ignoring this call."); return; } Chartboost.didCacheInterstitial += CBDidCacheInterstitial; Chartboost.didClickInterstitial += CBDidClickInterstitial; Chartboost.didCloseInterstitial += CBDidCloseInterstitial; Chartboost.didDismissInterstitial += CBDidDismissInterstitial; Chartboost.didFailToLoadInterstitial += CBDidFailToLoadInterstitial; Chartboost.didCacheRewardedVideo += CBDidCacheRewardedVideo; Chartboost.didClickRewardedVideo += CBDidClickRewardedVideo; Chartboost.didCloseRewardedVideo += CBDidCloseRewardedVideo; Chartboost.didDismissRewardedVideo += CBDidDismissRewardedVideo; Chartboost.didFailToLoadRewardedVideo += CBDidFailToLoadRewardedVideo; Chartboost.didCompleteRewardedVideo += CBDidCompleteRewardedVideo; // Create Chartboost object. Even if Chartboost is not listed as one of default ad networks, // it should still be created so that we can use it with the API as an "undefault" network. // We'll also handle ad loading, so turning off Chartboost's autocache feature. Chartboost.setAutoCacheAds(false); Chartboost.Create(); isInitialized = true; Debug.Log("Chartboost client has been initialized"); #else Debug.LogError(NO_SDK_MESSAGE); #endif }
protected override void OnEnable() { base.OnEnable(); if (string.IsNullOrEmpty(context.location)) { context.location = "Default"; } SetChartboostData(); SetModeAndDelegates(); Chartboost.Create(); // loads a gameObject with script into the scene Chartboost.setAutoCacheAds(true); PrepareAdvertisement(); }
void Start() { delegateHistory = new List <string>(); #if UNITY_IPHONE Chartboost.setShouldPauseClickForConfirmation(ageGate); Chartboost.setStatusBarBehavior(statusBar); #endif Chartboost.setAutoCacheAds(autocache); Chartboost.setMediation(CBMediation.AdMob, "1.0"); AddLog("Is Initialized: " + Chartboost.isInitialized()); // Create the Chartboost gameobject with the editor AppId and AppSignature Chartboost.Create(); }
public void Init() { if (_inited) { return; } #if CHARTBOOST_ENABLED Chartboost.Create(); Chartboost.didCacheInterstitial += OnDidCacheInterstitial; Chartboost.didCloseInterstitial += OnDidCloseInterstitial; Chartboost.didCompleteRewardedVideo += OnDidCloseRewardedVideo; Chartboost.didCacheRewardedVideo += OnDidCacheRewardedVideo; _inited = true; #endif }
void Awake() { // Create the Chartboost gameobject with the editor AppId and AppSignature Chartboost.Create(); }