Frustrating UnityAds Please help
I am very frustrated with both unityand Admob good god admob is so uuurrg ,i am just bad at this ad implementation. Below is my unity ads code they are working fine in the unity and when i test on the phone it working but only once it shows unity test vdo ad and if i build a 2nd time it does not work.,i am just making just a simple call for advertisement. but it does not work when the game went live in the play store, I must be doing something wrong please help
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;
public class UnityAds : MonoBehaviour {
public static UnityAds Instance { get; private set; }
private void Awake()
{
Instance = this;
}
public void ShowUnityAds(string placementId, bool enableCallback)
{
if(!Advertisement.IsReady(placementId))
{
Debug.LogWarning("Ads is not ready for " + placementId);
}
{
ShowOptions options = new ShowOptions();
if (enableCallback)
options.resultCallback = OnAd_Result;
Advertisement.Show(placementId, options);
}
}
private void OnAd_Result(ShowResult result)
{
switch(result)
{
case ShowResult.Finished:
Debug.Log("ads was shown successfuly and played through");
break;
case ShowResult.Skipped:
Debug.Log("Ads was shown but partitaly skipped");
break;
case ShowResult.Failed:
Debug.Log("ad display failed");
break;
}
}
}
the only other thing i am doing is just calling the ShowUnityAds
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612135335im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to display ads every 5 mins ? 1 Answer
Unity ads not showing rewarded video ad. 1 Answer
Navigation in VR Mode?!! 0 Answers
Unity3d Character Spawn Point 0 Answers