private void Awake()
 {
     if (ATTrackingStatusBinding.GetAuthorizationTrackingStatus() == ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
     {
         ATTrackingStatusBinding.RequestAuthorizationTracking(CallbackReceived);
     }
 }
    // Use this for initialization
    void Start()
    {
#if UNITY_IOS
        if (float.Parse(UnityEngine.iOS.Device.systemVersion) >= 14.0f)
        {
            Debug.Log("Unity iOS Support: Requesting iOS App Tracking Transparency native dialog.");

            ATTrackingStatusBinding.RequestAuthorizationTracking();
        }
#endif
    }
        private IEnumerator WatchAttStatus()
        {
            ATTrackingStatusBinding.RequestAuthorizationTracking();

            while (!_isReady)
            {
                yield return(new WaitForSeconds(0.1f));

                GetAttStatus();
            }
        }
Exemplo n.º 4
0
    public void Start()
    {
        PlatformInterface.instance.logger.Log("PlatformAdMobAdsInit.Start()");

        // Initialize the Google Mobile Ads SDK.
        MobileAds.Initialize(status => { });

        var testDeviceList       = new List <string> {
            //"751709a03251817c6a3d7d3f7072ec57" // iPhone 6s
        };
        var requestConfiguration = new RequestConfiguration.Builder().SetTestDeviceIds(testDeviceList).build();

        MobileAds.SetRequestConfiguration(requestConfiguration);

        // 광고 사운드 끄기
        MobileAds.SetApplicationMuted(true);

        var adUnitId = PlatformInterface.instance.config.GetAdMobRewardVideoAdUnitId();

        // Get singleton reward based video ad reference.
        rewardBasedVideo = new RewardedAd(adUnitId);

        rewardBasedVideo.OnAdLoaded              += HandleOnAdLoaded;
        rewardBasedVideo.OnAdFailedToLoad        += HandleAdFailedToLoad;
        rewardBasedVideo.OnAdOpening             += HandleAdOpening;
        rewardBasedVideo.OnAdClosed              += HandleAdClosed;
        rewardBasedVideo.OnAdFailedToShow        += HandleAdFailedToShow;
        rewardBasedVideo.OnAdDidRecordImpression += HandleAdDidRecordImpression;
        rewardBasedVideo.OnUserEarnedReward      += HandleUserEarnedReward;
        rewardBasedVideo.OnPaidEvent             += HandlePaidEvent;

        RequestRewardBasedVideo();

#if UNITY_IOS
        var trackingStatus = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
        Debug.Log($"ATTrackingStatusBinding.GetAuthorizationTrackingStatus()={trackingStatus}");
        switch (trackingStatus)
        {
        case ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED:
            ATTrackingStatusBinding.RequestAuthorizationTracking();
            break;

        case ATTrackingStatusBinding.AuthorizationTrackingStatus.AUTHORIZED:
            AudienceNetwork.AdSettings.SetAdvertiserTrackingEnabled(true);
            break;

        case ATTrackingStatusBinding.AuthorizationTrackingStatus.RESTRICTED:
        case ATTrackingStatusBinding.AuthorizationTrackingStatus.DENIED:
            AudienceNetwork.AdSettings.SetAdvertiserTrackingEnabled(false);
            break;
        }
#endif
    }
        public void RequestAuthorizationTracking()
        {
#if UNITY_IOS
            Debug.Log("Unity iOS Support: Requesting iOS App Tracking Transparency native dialog.");

            ATTrackingStatusBinding.RequestAuthorizationTracking(AuthorizationTrackingReceived);

            sentTrackingAuthorizationRequest?.Invoke();
#else
            Debug.LogWarning("Unity iOS Support: Tried to request iOS App Tracking Transparency native dialog, " +
                             "but the current platform is not iOS.");
#endif
        }
Exemplo n.º 6
0
    // Update is called once per frame
    private void Update()
    {
        if (!m_Once)
        {
            m_Once = true;
            ATTrackingStatusBinding.RequestAuthorizationTracking();
        }

        var status = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();

        if (m_PreviousStatus != status)
        {
            m_PreviousStatus = status;
            Debug.LogFormat("Tracking status updated: {0}", status);
        }
    }
Exemplo n.º 7
0
    public void Start()
    {
        SushiDebug.Log("PlatformAdMobAdsInit.Start()");
        if (PlatformIapManager.instance.NoAdsPurchased)
        {
            Debug.Log("PlatformIapManager.NoAdsPurchased = true (thank you!)");
        }
        else
        {
#if BALLOON_TEST_ADS
#if UNITY_ANDROID
            string appId = "ca-app-pub-3940256099942544~3347511713";
#elif UNITY_IPHONE
            string appId = "ca-app-pub-3940256099942544~1458002511";
#else
            string appId = "unexpected_platform";
#endif
#else
#if UNITY_ANDROID
            var appId = "ca-app-pub-5072035175916776~9742483955";
#elif UNITY_IOS
            string appId = "ca-app-pub-5072035175916776~2508482457";
#else
            string appId = "unexpected_platform";
#endif
#endif
            // Initialize the Google Mobile Ads SDK.
            MobileAds.Initialize(appId);

            // Get singleton reward based video ad reference.
            rewardBasedVideo = RewardBasedVideoAd.Instance;

            // Called when an ad request has successfully loaded.
            rewardBasedVideo.OnAdLoaded += HandleRewardBasedVideoLoaded;
            // Called when an ad request failed to load.
            rewardBasedVideo.OnAdFailedToLoad += HandleRewardBasedVideoFailedToLoad;
            // Called when an ad is shown.
            rewardBasedVideo.OnAdOpening += HandleRewardBasedVideoOpened;
            // Called when the ad starts to play.
            rewardBasedVideo.OnAdStarted += HandleRewardBasedVideoStarted;
            // Called when the user should be rewarded for watching a video.
            rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded;
            // Called when the ad is closed.
            rewardBasedVideo.OnAdClosed += HandleRewardBasedVideoClosed;
            // Called when the ad click caused the user to leave the application.
            rewardBasedVideo.OnAdLeavingApplication += HandleRewardBasedVideoLeftApplication;

            RequestRewardBasedVideo();
            RequestInterstitial();

            // Called when an ad request has successfully loaded.
            interstitial.OnAdLoaded += HandleOnAdLoaded;
            // Called when an ad request failed to load.
            interstitial.OnAdFailedToLoad += HandleOnAdFailedToLoad;
            // Called when an ad is shown.
            interstitial.OnAdOpening += HandleOnAdOpened;
            // Called when the ad is closed.
            interstitial.OnAdClosed += HandleOnAdClosed;
            // Called when the ad click caused the user to leave the application.
            interstitial.OnAdLeavingApplication += HandleOnAdLeavingApplication;
        }

#if UNITY_IOS
        var trackingStatus = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
        Debug.Log($"ATTrackingStatusBinding.GetAuthorizationTrackingStatus()={trackingStatus}");
        switch (trackingStatus)
        {
        case ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED:
            ATTrackingStatusBinding.RequestAuthorizationTracking();
            break;

        case ATTrackingStatusBinding.AuthorizationTrackingStatus.AUTHORIZED:
            //AudienceNetwork.AdSettings.SetAdvertiserTrackingEnabled(true);
            break;

        case ATTrackingStatusBinding.AuthorizationTrackingStatus.RESTRICTED:
        case ATTrackingStatusBinding.AuthorizationTrackingStatus.DENIED:
            //AudienceNetwork.AdSettings.SetAdvertiserTrackingEnabled(false);
            break;
        }
#endif
    }