Unity - A计划(一年有效期) 扫二维码继续学习 二维码时效为半小时

(61评价)
价格: 2150.00元
UNITY ADS问题
徐牧知发起了话题2018-01-11
1
回复
888
浏览

PC上运行正常,到了安卓手机上Advertisement.IsReady()一直是FALSE的,老师能否帮忙看下是什么原因

 

    public static void ShowAd (string zoneID, Action handleFinished, Action handleSkipped, Action handleFailed, Action onContinue)
    {
        if (string.IsNullOrEmpty(zoneID)) zoneID = null;

        _handleFinished = handleFinished;
        _handleSkipped = handleSkipped;
        _handleFailed = handleFailed;
        _onContinue = onContinue;
        GameObject.Find ("Text").GetComponent<Text> ().text = GameObject.Find ("Text").GetComponent<Text> ().text+
            zoneID+"*****"+Advertisement.IsReady();
        Debug.Log (zoneID+"*****"+Advertisement.IsReady(zoneID));
        if (Advertisement.IsReady(zoneID))
        {
            GameObject.Find ("Text").GetComponent<Text> ().text = GameObject.Find ("Text").GetComponent<Text> ().text+
                "Showing ad now...";
            Debug.Log("Showing ad now...");

            ShowOptions options = new ShowOptions();
            options.resultCallback = HandleShowResult;
            //options.pause = true;

            Advertisement.Show(zoneID,options);
        }
        else 
        {
            GameObject.Find ("Text").GetComponent<Text> ().text = GameObject.Find ("Text").GetComponent<Text> ().text+
                string.Format("Unable to show ad. The ad placement zone {0} is not ready.",
                    object.ReferenceEquals(zoneID,null) ? "default" : zoneID);        
            Debug.LogWarning(string.Format("Unable to show ad. The ad placement zone {0} is not ready.",
                object.ReferenceEquals(zoneID,null) ? "default" : zoneID));
        }
    }

 

    public void ShowAd ()
    {
        if (!UnityAdsHelper.isSupported)
            return;
        if (!UnityAdsHelper.isInitialized)
            return;
        if (UnityAdsHelper.isShowing)
            return;
        UnityAdsHelper.ShowAd (null, ShowAdFinish);
    }

所有回复
  • 老师_Bathur 2018-01-12

    您好~Unity ADs在Android平台上是走Google的通道的,至此,为什么是FALSE您应该清楚了~如果您还不清楚为什么~那么老师只能说~由于国家政策原因~请您放弃Android平台上的Unity ADs(编辑器模式下可以是因为编辑器不是真机,采用的测试模式哦~)

    还有-5条回复,点击查看
    你还没有登录,请先登录注册
发表回复
你还没有登录,请先 登录或 注册!