Ejemplo n.º 1
0
    void DisplayInterstitial()
    {
        Debug.Log("GameController: DisplayInterstitial");

        // Destroy the old interstitialview if needed
        if (_interstitialView != null)
        {
            _interstitialView.Destroy();
        }
        // Create a new interstitialview instance
        _interstitialView = new InterstitialView();

        // Create an adconfig object that will store informations about the ad placement and use it to load the ad
        AdConfig adConfig = new AdConfig("https://mobile.smartadserver.com", 104808, "663264", 12167, true, "");

        _interstitialView.LoadAd(adConfig);          // The interstitial is displayed automatically when loaded

        // Register success & failure events
        _interstitialView.AdViewLoadingSuccess += InterstitialViewSuccess;
        _interstitialView.AdViewLoadingFailure += InterstitialViewFailure;
    }
Ejemplo n.º 2
0
    void DisplayRewardedInterstitial()
    {
        Debug.Log("GameController: DisplayRewardedInterstitial");

        // Destroy the old interstitialview if needed
        if (_rewardedInterstitialView != null)
        {
            _rewardedInterstitialView.Destroy();
        }
        // Create a new interstitialview instance
        _rewardedInterstitialView = new InterstitialView();

        // Create an adconfig object that will store informations about the ad placement and use it to load the ad
        AdConfig adConfig = new AdConfig("https://mobile.smartadserver.com", 94198, "627899", 15140, true, "video-interstitial-endcard");

        _rewardedInterstitialView.LoadAd(adConfig);          // The interstitial is displayed automatically when loaded

        // Register success & failure events
        _rewardedInterstitialView.AdViewLoadingSuccess += RewardedInterstitialViewSuccess;
        _rewardedInterstitialView.AdViewLoadingFailure += RewardedInterstitialViewFailure;
        _rewardedInterstitialView.AdViewRewardReceived += RewardedInterstitialViewRewardReceived;
    }