Пример #1
0
        /// <summary>
        /// 独立信令 取消邀请接口
        /// </summary>
        /// <param name="param">取消邀请的传入参数</param>
        /// <param name="cb">结果回调见NimSignalingDef.cs</param>
        /// <param name="user_data">APP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理</param>
        public static void CancelInvite(NIMSignalingCancelInviteParam param, NimSignalingOptCancelInviteHandler cb)
        {
            NIMSignalingCancelInviteParam_C param_c = SignalHelper.GetNativeNIMSignalingCancelInviteParam(param);
            int    nSizeOfParam = Marshal.SizeOf(param_c);
            IntPtr param_ptr    = Marshal.AllocHGlobal(nSizeOfParam);

            try
            {
                Marshal.StructureToPtr(param_c, param_ptr, false);
                var user_ptr = NimUtility.DelegateConverter.ConvertToIntPtr(cb);
                SignalingNativeMethods.nim_signaling_cancel_invite(param_ptr, NimSignalingCancelInviteCb, user_ptr);
            }
            catch (Exception ex)
            {
            }
            finally
            {
                Marshal.FreeHGlobal(param_ptr);
            }
        }