Ejemplo n.º 1
0
    public void StartParseVersion()
    {
        //   startParserVersionXiaomi();
        //   return;
        //android
        if (Common.isAndroid)
        {
            switch (Config.main.channel)
            {
            case Source.XIAOMI:
            {
                appVersionBase = new AppVersionXiaomi();
                break;
            }

            case Source.TAPTAP:
            {
                appVersionBase = new AppVersionTaptap();
                break;
            }

            case Source.HUAWEI:
            {
                appVersionBase = new AppVersionHuawei();
                break;
            }

            case Source.GP:
            {
                appVersionBase = new AppVersionGP();
                break;
            }

            default:
            {
                appVersionBase = new AppVersionBase();
            }
            break;
            }
        }
        else if (Common.isiOS)
        {
            appVersionBase = new AppVersionAppstore();
        }

        else if (Common.isWinUWP)
        {
            appVersionBase = new AppVersionWin();
        }
        else
        {
            appVersionBase = new AppVersionBase();
        }

        //appVersionBase = new AppVersionXiaomi();

        appVersionBase.callbackFinished = OnAppVersionBaseFinished;
        appVersionBase.Init();
        appVersionBase.StartParseVersion();
    }
Ejemplo n.º 2
0
 public void OnAppVersionBaseFinished(AppVersionBase app)
 {
     if (this.callbackFinished != null)
     {
         this.callbackFinished(this);
     }
 }
Ejemplo n.º 3
0
    public void ParseFinished(AppVersionBase app)
    {
        Debug.Log("Appversion ParseFinished strVersionStore=" + strVersionStore);
        string appver = Application.version;

        if (Common.BlankString(strVersionStore))
        {
            if (Common.isiOS)
            {
                if (isFirstCreat)
                {
                    appCheckForAppstore = true;
                }
            }
            else
            {
                appCheckForAppstore = true;
            }
        }
        else
        {
            int ret = string.Compare(appver, strVersionStore);
            Debug.Log("Appversion stroe:version:" + strVersionStore + " ret=" + ret);
            if (ret >= 0)
            {
                appNeedUpdate = false;
                if (ret > 0)
                {
                    appCheckForAppstore = true;
                }
            }
            else
            {
                //版本更新
                appNeedUpdate = true;
                //appCheckVersionDidUpdate
            }
        }

        if (Config.main.channel == Source.XIAOMI)
        {
            AppVersion.appCheckForXiaomi = appCheckForAppstore;
            if (Common.GetDayIndexOfUse() > Config.main.NO_AD_DAY)
            {
                //超过NO_AD_DAY 天数 认为审核完成
                appCheckForAppstore = false;
            }
        }


        Debug.Log("Appversion:appCheckForAppstore=" + appCheckForAppstore + " isNetWorkOk=" + isNetWorkOk);

        if ((!appCheckForAppstore) && isNetWorkOk)
        {
            int v = Common.Bool2Int(true);
            PlayerPrefs.SetInt(AppVersion.STRING_KEY_APP_CHECK_FINISHED, v);
        }

        //appCheckHasFinished = Common.Int2Bool(PlayerPrefs.GetInt(STRING_KEY_APP_CHECK_FINISHED));

        // Debug.Log("Appversion ParseFinished 1");
        if (this.callbackFinished != null)
        {
            Debug.Log("Appversion ParseFinished callbackFinished");
            this.callbackFinished(this);
        }
    }