Unity Ads are not working on Iphone but it works in editor. I am using unity version 4.6.9 …
i am testing it on button click. Please help ,Highly appreciated thanks
using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;
public class adcaller : MonoBehaviour {
// Use this for initialization
void Start () {
Advertisement.Initialize ("*******",false);
}
// Update is called once per frame
void Update () {
if (PlayerPrefs.GetInt ("Pause") == 1) {
StartCoroutine (ShowAdWhenReady ());
PlayerPrefs.SetInt("Pause",0);
}
}
public void btn_Action(string name){
if (name=="showunity") {
}
PlayerPrefs.SetInt("Pause",1);
}
IEnumerator ShowAdWhenReady()
{
while (!Advertisement.IsReady())
yield return null;
Advertisement.Show ();
}
}
