Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[Help] Rewarded Videos

Discussion in 'Unity Ads & User Acquisition' started by Pumpkinotto, Feb 22, 2015.

  1. Pumpkinotto

    Pumpkinotto

    Joined:
    Jan 10, 2015
    Posts:
    6
    hi,
    i'm trying to make a button that, whan is pressed, shows a rewarded ads.
    this is the code
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.Advertisements;
    4.  
    5. public class RewardedAds : MonoBehaviour {
    6.  
    7.     // Use this for initialization
    8.     void Start () {
    9.             Advertisement.Initialize ("XXXXXXXX");
    10.  
    11.             }
    12.  
    13.         public void RewardedAdsVoid () {
    14.            
    15.         if (Advertisement.isReady())
    16.         {
    17.             Advertisement.Show("rewardedVideoZone");
    18.  
    19.         }
    20.     }
    21. }
    22.  
    the void RewardedAdsVoid is called when the button has pressed.
    but when i press it nothing happens.
    please help
    thanks
     
  2. Salazar

    Salazar

    Joined:
    Sep 2, 2013
    Posts:
    235
    Hello Pumpkinotto ,

    IF
    Be sure you set "rewardedVideoZone" as default in your admin panel.
    ELSE
    You should specify wich ad zone you are using.

    Code (CSharp):
    1. if( Advertisement.isReady("rewardedVideoZone"))
    2. {
    3.             Advertisement.Show("rewardedVideoZone");
    4. }
    Regards
     
    unity-nikkolai and Pumpkinotto like this.
  3. Pumpkinotto

    Pumpkinotto

    Joined:
    Jan 10, 2015
    Posts:
    6
    thanks