示例#1
0
        public void Send_Message()
        {
            var data = new[] { new { elem_type = 0, text_elem_content = "aaaaaaaaaa" } };

            //Json::Value json_value_text;
            //json_value_text[kTIMElemType] = kTIMElem_Text;
            //json_value_text[kTIMTextElemContent] = message;


            var data1 = new { message_elem_array = data, message_sender = DataManager.GetInstance().userId, message_conv_id = DataManager.GetInstance().roomId.ToString(), message_conv_type = TIMConvType.kTIMConv_Group };

            /*Json::Value json_value_msg;
             * json_value_msg[kTIMMsgElemArray].append(json_value_text);
             * json_value_msg[kTIMMsgSender] = userid;
             * json_value_msg[kTIMMsgClientTime] = time(NULL);
             * json_value_msg[kTIMMsgServerTime] = time(NULL);
             * //json_value_msg[kTIMMsgIsOnlineMsg] = online_message;
             * json_value_msg[kTIMMsgConvId] = roomid;
             * json_value_msg[kTIMMsgConvType] = kTIMConv_Group;
             *
             * std::string json_msg = json_value_msg.toStyledString();*/

            mycall2 = new TIMCommCallback(CommCallback222);

            int ret = TIMMsgSendNewMsg(DataManager.GetInstance().roomId.ToString(), TIMConvType.kTIMConv_Group, JsonConvert.SerializeObject(data1), mycall2);

            return;
        }
示例#2
0
        public void CreateGroup()
        {
            TIMAddRecvNewMsgCallback(TIMRecvNewMsgCallback);
            //GC.KeepAlive(TIMRecvNewMsgCallback);
            //var data11 = new { create_group_param_group_name = "111222333", create_group_param_group_id = "5555", create_group_param_group_type = 4, create_group_param_add_option = 2 };
            //mycall11 = new TIMCommCallback(CommCallback111);
            //int ret = TIMGroupCreate(JsonConvert.SerializeObject(data11), mycall11);

            mycall3 = new TIMCommCallback(CommCallback333);

            TIMGroupJoin(DataManager.GetInstance().roomId.ToString(), "Want Join Group, Thank you", mycall3);
        }
示例#3
0
        public void ImInit()
        {
            int sdk_app_id = 1400473960;
            var data       = new { sdk_config_log_file_path = AppDomain.CurrentDomain.BaseDirectory, sdk_config_config_file_path = AppDomain.CurrentDomain.BaseDirectory };

            TIMInit(sdk_app_id, JsonConvert.SerializeObject(data));

            mycall = new delegateTIMRecvNewMsgCallback(TIMRecvNewMsgCallback);
            TIMAddRecvNewMsgCallback(mycall);

            mycall1 = new TIMCommCallback(CommCallback);

            var tLSSig = new tencentyun.TLSSigAPIv2(sdk_app_id, "11ddbddae4444052e35f30d2b7db54c5a9d04811a3436411d01da7e57db64b01");

            TIMLogin(DataManager.GetInstance().userId, tLSSig.GenSig(DataManager.GetInstance().userId), mycall1);

            //CreateGroup();
        }
示例#4
0
        private void CommCallback333(int code, string desc, string json_params, IntPtr user_data)
        {
            if (code != 0 && code != 10013)
            { // 失败
                if (code == 10015 || code == 10010)
                {
                    //ths->CreateRoom(ths->roomid);
                    var data11 = new { create_group_param_group_name = DataManager.GetInstance().roomId.ToString(), create_group_param_group_id = DataManager.GetInstance().roomId.ToString(), create_group_param_group_type = 4, create_group_param_add_option = 2 };
                    mycall11 = new TIMCommCallback(CommCallback111);
                    TIMGroupCreate(JsonConvert.SerializeObject(data11), mycall11);
                }
                else
                {
                    //ths->roomid = "";
                    //_imListener->onIMJoinRoom(false);
                }
            }

            Console.WriteLine("----------------------------------Hello CommCallback333");
            return;
        }
 public static extern int TIMConvDelete([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string conv_id, TIMConvType conv_type, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMFriendshipReportPendencyReaded(ulong time_stamp, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMFriendshipDeleteFromBlackList([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_delete_from_blacklist_param, TIMCommCallback cb, IntPtr user_data);
 static extern int TIMFriendshipAddToBlackList([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_add_to_blacklist_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMLogin([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string user_id,
                                   [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string user_sig, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMFriendshipHandleFriendAddRequest([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_handle_friend_add_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMMsgDownloadElemToPath([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_download_elem_param,
                                                   [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string path, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMMsgGetMsgList([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string conv_id, TIMConvType conv_type,
                                           [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_get_msg_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMMsgFindByMsgLocatorList([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string conv_id, TIMConvType conv_type,
                                                     [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_msg_Locator_array, TIMCommCallback cb, IntPtr user_data);
示例#14
0
 public extern static int TIMFriendshipGetFriendProfileList(TIMCommCallback cb);
示例#15
0
 public extern static int TIMFriendshipGetPendencyList(string json_get_pendency_list_param, TIMCommCallback cb);
 public static extern int TIMProfileGetUserProfileList([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_get_user_profile_list_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMProfileModifySelfUserProfile([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_modify_self_user_profile_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMMsgBatchSend([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_batch_send_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMFriendshipCheckFriendType([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_check_friend_list_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMGroupQuit([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string group_id, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMFriendshipModifyFriendGroup([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_modify_friend_group_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMGroupInviteMember([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_group_invite_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMFriendshipGetBlackList(TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMGroupGetJoinedGroupList(TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMFriendshipDeletePendency([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_delete_pendency_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMGroupModifyMemberInfo([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_group_modifymeminfo_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMLogout(TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMGroupGetPendencyList([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_group_getpendence_list_param, TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMConvGetConvList(TIMCommCallback cb, IntPtr user_data);
 public static extern int TIMGroupHandlePendency([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_group_handle_pendency_param, TIMCommCallback cb, IntPtr user_data);