Пример #1
0
    IEnumerator SendGet(string _url)
    {
        WWW getData = new WWW(_url);

        yield return(getData);

#if UNITY_IPHONE || UNITY_STANDALONE_WIN
        if (getData.error != "")
        {
            Debug.LogError(getData.error);
        }
#elif UNITY_ANDROID
        if (getData.error != null)
        {
            Debug.LogError(getData.error);
        }
#endif
        else
        {
            Debug.Log(getData.text);

            var        t    = JsonManager.GetWeChatLoginSucData(getData.text);
            ArgsWeChat args = new ArgsWeChat();
            args.access_token = t.access_token;
            args.openid       = t.openid;
            args.refreshToken = t.refresh_token;
            //Debug.Log(t);
            NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ELoginByWeChatSuc, args);
        }
    }
Пример #2
0
    void UpdateLoginByWeChatSuc(LocalNotification e)
    {
        ArgsWeChat args = e.param as ArgsWeChat;

        if (args != null)
        {
            LoginByWeChat(args.refreshToken, args.access_token, args.openid);
        }
    }