Exemple #1
0
        public void Initialize(AdsSDKs sdk, List <string> gameIds, List <AdIdsPerPlatform> adIdsPerPlatform)
        {
            Debug.Log("<color=red>Admob Initialize</color>");
#if UNITY_ANDROID
            CurrentPlatform = Platforms.Android;
            Application.RequestAdvertisingIdentifierAsync(
                (string advertisingId, bool trackingEnabled, string error) => {
                deviceId = advertisingId;
                Debug.Log("advertisingId " + advertisingId + " " + trackingEnabled + " " + error);
            }
                );
#elif UNITY_IOS
            CurrentPlatform = Platforms.IOS;
            deviceId        = Md5Sum(Device.advertisingIdentifier);

            Debug.Log("Device = " + deviceId);
#endif

            SDK = sdk;
            Debug.Log("App ID = " + ReturnAdID(adIdsPerPlatform, CurrentPlatform, AdType.AppId));
            MobileAds.Initialize(ReturnAdID(adIdsPerPlatform, CurrentPlatform, AdType.AppId));

            RequestBannerAd(adIdsPerPlatform);
            RequestInterstitialAd(adIdsPerPlatform);
            RequestRewardAd(adIdsPerPlatform);
        }
Exemple #2
0
        public void Initialize(AdsSDKs sdk, List <string> gameIds, List <AdIdsPerPlatform> adIdsPerPlatform)
        {
            #if UNITY_ANDROID
            CurrentPlatform = Platforms.Android;
            #elif UNITY_IOS
            CurrentPlatform = Platforms.IOS;
            #endif

            SDK = sdk;
            Advertisement.Initialize(gameIds[0], true);
        }
Exemple #3
0
 public void ShowAds(AdsSDKs sdk, AdType type, Action OnFailed, Action OnSucceeded, Action OnSkipped)
 {
     for (int i = 0; i < adSDKs.Count; i++)
     {
         if (adSDKs[i].SDK == sdk)
         {
             adSDKs[i].ShowAds(type);
             adSDKs[i].BindCallback(OnFailed, OnSucceeded, OnSkipped);
             break;
         }
     }
 }
Exemple #4
0
        public void Initialize(AdsSDKs sdk, List <string> gameIds, List <AdIdsPerPlatform> adIdsPerPlatform)
        {
            SDK = sdk;

            if (Chartboost.isInitialized())
            {
                Debug.Log("Chartboost is initialized");
            }
            else
            {
                Chartboost.CreateWithAppId(gameIds[0], gameIds[1]);
            }
            Chartboost.setAutoCacheAds(true);
            CacheAds();
        }
Exemple #5
0
        public void Initialize(AdsSDKs sdk, List <string> gameIds, List <AdIdsPerPlatform> adIdsPerPlatform)
        {
            #if UNITY_ANDROID
            CurrentPlatform = Platforms.Android;
#elif UNITY_IOS
            CurrentPlatform = Platforms.IOS;
#endif

            SDK = sdk;

            MobileAds.Initialize(ReturnAdID(adIdsPerPlatform, CurrentPlatform, AdType.AppId));

            RequestBannerAd(adIdsPerPlatform);
            RequestInterstitialAd(adIdsPerPlatform);
            RequestRewardAd(adIdsPerPlatform);
        }
        public void ShowAds(AdsSDKs sdk, AdType type, Action OnFailed, Action OnSucceeded, Action OnSkipped)
        {
            //TODO remove
//            return;
            //remove
            Debug.Log("Show Ads");
            Debug.Log(sdk);
            Debug.Log(type);
            for (int i = 0; i < adSDKs.Count; i++)
            {
                if (adSDKs[i].SDK == sdk)
                {
                    adSDKs[i].ShowAds(type);
                    adSDKs[i].BindCallback(OnFailed, OnSucceeded, OnSkipped);
                    break;
                }
            }
        }