/// <summary> /// 发送通知 /// </summary> /// <param name="targetUserID">接收通知的用户ID</param> /// <param name="notifyType">通知类型(名称)</param> /// <param name="content">通知内容 /// 内容里面的链接可以是带goto:http://xxxxx 这样的URL,如果带这种URL的在用户点击这个URL的时候,通知会变成已读状态,否则需要手动忽略 /// </param> /// <param name="actions">actions指通知中出现的几个链接,比如加好友的时候有“通过请求”和打招呼时候的“回敬一个”就是由actions参数指定</param> /// <returns></returns> public static bool SendNotify(int targetUserID,string notifyType,string content,NotifyActionProxy[] actions) { string keyword = notifyType.GetHashCode() + "_" + content.GetHashCode(); return AsmxAccess.API.Notify_Send(targetUserID,notifyType,content,string.Empty,actions,keyword); }
/// <remarks/> public void Notify_SendAsync(int userID, string notifyType, string content, string datas, NotifyActionProxy[] actions, string keyword) { this.Notify_SendAsync(userID, notifyType, content, datas, actions, keyword, null); }
/// <remarks/> public void Notify_SendAsync(int userID, string notifyType, string content, string datas, NotifyActionProxy[] actions, string keyword, object userState) { if ((this.Notify_SendOperationCompleted == null)) { this.Notify_SendOperationCompleted = new System.Threading.SendOrPostCallback(this.OnNotify_SendOperationCompleted); } this.InvokeAsync("Notify_Send", new object[] { userID, notifyType, content, datas, actions, keyword}, this.Notify_SendOperationCompleted, userState); }
public bool Notify_Send(int userID, string notifyType, string content, string datas, NotifyActionProxy[] actions, string keyword) { object[] results = this.Invoke("Notify_Send", new object[] { userID, notifyType, content, datas, actions, keyword}); return ((bool)(results[0])); }