/// <summary> /// 解析json串,返回一个LoginRet,若解析失败返回null. /// </summary> /// <returns>The json.</returns> /// <param name="json">Json.</param> public static LoginRet ParseJson(string json) { try{ LoginRet ret = JsonMapper.ToObject <LoginRet>(json); return(ret); }catch (Exception ex) { Debug.Log("errro:" + ex.Message + "\n" + ex.StackTrace); } return(null); }
public event DownloadYYBStateDelegate DownloadYYBStateEvent; // 下载应用宝的状态 #endregion public void HandleLoginNotify(LoginRet ret) { try { if (LoginEvent != null) { LoginEvent(ret); } } catch (Exception e) { Debug.LogError(e.Message); } }
public LoginRet WGGetLoginRecord() { string loginRetStr = iOSConnector.GetLoginRecord(); if (loginRetStr != null) { return(LoginRet.ParseJson(loginRetStr)); } else { return(new LoginRet()); } }
private void reportData(string message) { try { LoginRet loginRet = WGGetLoginRecord(); message += "_" + loginRet.open_id; using (AndroidJavaObject report = new AndroidJavaObject("com.tencent.msdk.request.MsdkDataReport")) { // operate 设置为1001,用以后台过滤 report.Call("reportData", message, (int)ePlatform.ePlatform_QQ, 1001); } } catch (Exception e) { Debug.LogError(e.Message); } }
public void OnLoginNotify(string jsonRet) { LoginRet ret = LoginRet.ParseJson(jsonRet); MsdkEvent.Instance.HandleLoginNotify(ret); }