Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        logger = FindObjectOfType(typeof(Logger)) as Logger;


        Ogury.Start(AndroidAssetKey, IosAssetKey);

        optinVideoAd = new OguryOptinVideoAd(AndroidOptinVideoAdUnitId,
                                             IosOptinVideoAdUnitId);

        // get user consent
        OguryChoiceManager.OnAskComplete += OnCMComplete;
        OguryChoiceManager.OnAskError    += OnCMError;
        OguryChoiceManager.Ask();


        optinVideoAd.OnAdLoaded += ad =>
        {
            logger.LogAdLoadedMessage();
        };

        optinVideoAd.OnAdNotLoaded += ad =>
        {
            logger.LogAdNotLoadedMessage();
        };

        optinVideoAd.OnAdRewarded += (ad, rewardItem) =>
        {
            // reward the user here
            logger.LogUserReward(String.Format("User has received reward {0} with value: {1}",
                                               rewardItem.Name, rewardItem.Value));
        };

        optinVideoAd.OnAdNotAvailable += ad =>
        {
            logger.LogAdNotAvailableMessage();
        };

        optinVideoAd.OnAdDisplayed += ad =>
        {
            logger.LogOnAdDisplayedMessage();
        };

        optinVideoAd.OnAdClosed += ad =>
        {
            logger.LogOnAdClosedMessage();
        };

        optinVideoAd.OnAdError += OnAdError;
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        logger = FindObjectOfType(typeof(Logger)) as Logger;

        Ogury.Start(AndroidAssetKey, IosAssetKey);

        smallBanner = new OguryBannerAd(AndroidSmallBannerAdUnitId,
                                        IosSmallBannerAdUnitId, OguryBannerAdSize.SmallBanner320X50);

        mpuBanner = new OguryBannerAd(AndroidMpuBannerAdUnitId,
                                      IosMpuBannerAdUnitId, OguryBannerAdSize.Mpu300X250);

        // get user consent
        OguryChoiceManager.OnAskComplete += OnCMComplete;
        OguryChoiceManager.OnAskError    += OnCMError;
        OguryChoiceManager.Ask();


        smallBanner.OnAdLoaded += ad =>
        {
            logger.LogAdLoadedMessage("Small Banner");
        };

        smallBanner.OnAdNotLoaded += ad =>
        {
            logger.LogAdNotLoadedMessage("Small Banner");
        };

        mpuBanner.OnAdLoaded += ad =>
        {
            logger.LogAdLoadedMessage("MPU");
        };

        mpuBanner.OnAdNotLoaded += ad =>
        {
            logger.LogAdNotLoadedMessage("MPU");
        };

        smallBanner.OnAdDisplayed += ad =>
        {
            logger.LogOnAdDisplayedMessage("Small Banner");
        };

        mpuBanner.OnAdDisplayed += ad =>
        {
            logger.LogOnAdDisplayedMessage("MPU");
        };
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        logger = FindObjectOfType(typeof(Logger)) as Logger;


        Ogury.Start(AndroidAssetKey, IosAssetKey);

        interstitialAd = new OguryInterstitialAd(AndroidInterstitialAdUnitId,
                                                 IosInterstitialAdUnitId);

        // get user consent
        OguryChoiceManager.OnAskComplete += OnCMComplete;
        OguryChoiceManager.OnAskError    += OnCMError;
        OguryChoiceManager.Ask();


        interstitialAd.OnAdLoaded += ad =>
        {
            logger.LogAdLoadedMessage();
        };

        interstitialAd.OnAdNotLoaded += ad =>
        {
            logger.LogAdNotLoadedMessage();
        };


        interstitialAd.OnAdNotAvailable += ad =>
        {
            logger.LogAdNotAvailableMessage();
        };

        interstitialAd.OnAdDisplayed += ad =>
        {
            logger.LogOnAdDisplayedMessage();
        };

        interstitialAd.OnAdClosed += ad =>
        {
            logger.LogOnAdClosedMessage();
        };



        interstitialAd.OnAdError += OnAdError;
    }