Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

I'm using Unity 5.5.0 , how to integrate rewarded video ads , this doesn't work on device

Discussion in 'Unity Ads & User Acquisition' started by Vasov97, Mar 19, 2017.

  1. Vasov97

    Vasov97

    Joined:
    Aug 4, 2016
    Posts:
    28
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.Advertisements;

    public class NewBehaviourScript : MonoBehaviour {

    public void ShowRewardedAd()
    {
    if (Advertisement.IsReady("rewardedVideo"))
    {
    var options = new ShowOptions { resultCallback = HandleShowResult };
    Advertisement.Show("rewardedVideo", options);
    }
    }

    private void HandleShowResult(ShowResult result)
    {
    switch (result)
    {
    case ShowResult.Finished:
    Debug.Log("The ad was successfully shown.");
    //
    // YOUR CODE TO REWARD THE GAMER
    // Give coins etc.
    break;
    case ShowResult.Skipped:
    Debug.Log("The ad was skipped before reaching the end.");
    break;
    case ShowResult.Failed:
    Debug.LogError("The ad failed to be shown.");
    break;
    }
    }
    }
     
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
  3. Vasov97

    Vasov97

    Joined:
    Aug 4, 2016
    Posts:
    28
    Well , it isn't duplicate. This is for rewarded (on button click ) video. Ok, but could you explain to me how to get device log?
     
  4. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Sounds like same issue, i.e. that you see the placeholder ad in Unity editor, but doesn't show on Android?

    Still the answer for getting device log is "adb logcat -v time UnityAds:V *:S" from command line. I checked that the command works here on Windows and Mac. Please see if you get any error message when trying to call that command on your machine.

    /Rasmus
     
  5. Vasov97

    Vasov97

    Joined:
    Aug 4, 2016
    Posts:
    28
    Should I run cmd from platformtools folder and then type that line or not ?
     
  6. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
  7. Vasov97

    Vasov97

    Joined:
    Aug 4, 2016
    Posts:
    28
  8. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Well, ideally you should take a look yourself in the device log to see if it contains any relevant information. If you cannot, you are welcome to share the device log here (as text file, not screenshot)

    /Rasmus