public void HandleShareNofify(ShareRet ret) { try { if (ShareEvent != null) { ShareEvent(ret); } } catch (Exception e) { Debug.LogError(e.Message); } }
/// <summary> /// 解析json串,返回一个ShareRet,若解析失败返回null. /// </summary> /// <returns>The json.</returns> /// <param name="json">Json.</param> public static ShareRet ParseJson(string json) { try{ ShareRet ret = JsonMapper.ToObject <ShareRet>(json); return(ret); }catch (Exception ex) { Debug.Log("errro:" + ex.Message + "\n" + ex.StackTrace); } return(null); }
public void OnShareNotify(string jsonRet) { ShareRet ret = ShareRet.ParseJson(jsonRet); MsdkEvent.Instance.HandleShareNofify(ret); }