コード例 #1
0
ファイル: AdMobClientImpl.cs プロジェクト: artemy0/Quiz
        protected override void InternalInit()
        {
#if EM_ADMOB
            mAdSettings = EM_Settings.Advertising.AdMob;

            // Set GDPR consent if any.
            var consent = GetApplicableDataPrivacyConsent();
            ApplyDataPrivacyConsent(consent);

            MobileAds.Initialize(mAdSettings.AppId.Id);

            mCustomBannerAds       = new Dictionary <AdPlacement, KeyValuePair <BannerAdSize, BannerView> >();
            mCustomInterstitialAds = new Dictionary <AdPlacement, InterstitialAd>();

            if (mAdSettings.EnableTestMode)
            {
#if UNITY_ANDROID
                testDeviceID = SystemInfo.deviceUniqueIdentifier.ToUpper();
#elif UNITY_IOS
                testDeviceID = UnityEngine.iOS.Device.advertisingIdentifier;
                testDeviceID = CreateMD5(testDeviceID);
                testDeviceID = testDeviceID.ToLower();
#endif
            }

            mIsInitialized = true;

            Debug.Log("AdMob client has been initialized.");
#endif
        }
コード例 #2
0
        protected override void InternalInit()
        {
            #if EM_ADMOB
            mAdSettings = EM_Settings.Advertising.AdMob;

            // Set GDPR consent if any.
            var consent = GetApplicableDataPrivacyConsent();
            ApplyDataPrivacyConsent(consent);

            MobileAds.Initialize(mAdSettings.AppId.Id);

            mCustomBannerAds       = new Dictionary <AdPlacement, KeyValuePair <BannerAdSize, BannerView> >();
            mCustomInterstitialAds = new Dictionary <AdPlacement, InterstitialAd>();

            mIsInitialized = true;

            Debug.Log("AdMob client has been initialized.");
            #endif
        }