Example #1
0
        public static void SetSdkLogCallback(NimWriteLogDelegate cb)
        {
#if !UNITY_ANDROID
            IntPtr ptr = DelegateConverter.ConvertToIntPtr(cb);
            NIMGlobalNativeMethods.nim_global_reg_sdk_log_cb(null, NimSdkLogCb, ptr);
#endif
        }
Example #2
0
        /// <summary>
        /// 获取sdk缓存文件信息
        /// </summary>
        /// <param name="accountID">查询的账号ID</param>
        /// <param name="fileType">文件类型</param>
        /// <param name="endtime">查询时间截止点(查询全部填0)</param>
        /// <param name="cb"></param>
        public static void GetCacheFileInfo(string accountID, CacheFileType fileType, long endtime, GetCacheFileInfoDelegate cb)
        {
            string fileTypeStr = GetCacheFileTypeDesc(fileType);
            var    ptr         = DelegateConverter.ConvertToIntPtr(cb);

            NIMGlobalNativeMethods.nim_global_get_sdk_cache_file_info_async(accountID, fileTypeStr, endtime, null, GetCacheFileInfoCb, ptr);
        }
Example #3
0
        /// <summary>
        /// 测试代理
        /// </summary>
        /// <param name="type">代理类型</param>
        /// <param name="host">代理地址</param>
        /// <param name="port">代理端口</param>
        /// <param name="user">代理用户名</param>
        /// <param name="password">代理密码</param>
        /// <param name="cb"></param>
        public static void DetectProxy(NIMProxyType type, string host, int port, string user, string password, NimProxyDetectionDelegate cb)
        {
            var ptr = DelegateConverter.ConvertToIntPtr(cb);

            NIMGlobalNativeMethods.nim_global_detect_proxy(type, host, port, user, password, ProxyDetectionCallback, ptr);
        }
Example #4
0
 /// <summary>
 ///     设置SDK统一的网络代理。不需要代理时,type设置为kNIMProxyNone,其余参数都传空字符串(端口设为0)。有些代理不需要用户名和密码,相应参数也传空字符串
 /// </summary>
 /// <param name="type"></param>
 /// <param name="host"></param>
 /// <param name="port"></param>
 /// <param name="user"></param>
 /// <param name="password"></param>
 public static void SetProxy(NIMProxyType type, string host, int port, string user, string password)
 {
     NIMGlobalNativeMethods.nim_global_set_proxy(type, host, port, user, password);
 }
Example #5
0
 /// <summary>
 ///     释放SDK内部分配的内存
 /// </summary>
 /// <param name="data">由SDK内部分配的内存</param>
 public static void FreeBuffer(IntPtr data)
 {
     NIMGlobalNativeMethods.nim_global_free_buf(data);
 }
Example #6
0
 /// <summary>
 ///     释放SDK内部分配的内存
 /// </summary>
 /// <param name="str">由SDK内部分配内存的字符串</param>
 public static void FreeStringBuffer(IntPtr str)
 {
     NIMGlobalNativeMethods.nim_global_free_str_buf(str);
 }
Example #7
0
        /// <summary>
        /// 注册输出系统环境异常的回调
        /// </summary>
        /// <param name="cb"></param>
        public static void RegExceptionReportCb(nim_sdk_exception_cb_func cb)
        {
            var ptr = DelegateConverter.ConvertToIntPtr(cb);

            NIMGlobalNativeMethods.nim_global_reg_exception_report_cb(null, ExceptionReportCb, ptr);
        }
Example #8
0
        /// <summary>
        /// 上传SDK日志到服务器
        /// </summary>
        /// <param name="feedbackMessage">反馈信息</param>>
        /// <param name="cb">nim_global_upload_sdk_log_cb_func回调函数定义见nim_global_def.h</param>
        public static void GlobalUploadSdkLog(string feedbackMessage, GlobalUploadSdkLogDelegate cb)
        {
            var ptr = DelegateConverter.ConvertToIntPtr(cb);

            NIMGlobalNativeMethods.nim_global_upload_sdk_log(feedbackMessage, GlobalUploadSdkLogCbFunc, ptr);
        }