Exemplo n.º 1
0
 Task <AVIMSignature> ISignatureFactory.CreateConversationSignature(string conversationId, string clientId, IEnumerable <string> targetIds, ConversationSignatureAction action)
 {
     return(Task.FromResult <AVIMSignature>(null));
 }
Exemplo n.º 2
0
        public Task <AVIMSignature> CreateConversationSignature(string conversationId, string clientId, IEnumerable <string> targetIds, ConversationSignatureAction action)
        {
            var actionList = new string[] { "invite", "kick" };
            var data       = new Dictionary <string, object>();

            data.Add("client_id", clientId);
            data.Add("conv_id", conversationId);
            data.Add("members", targetIds.ToList());
            data.Add("action", actionList[(int)action]);
            return(AVCloud.CallFunctionAsync <IDictionary <string, object> >("oprateConversation", data).OnSuccess(_ =>
            {
                var jsonData = _.Result;
                var s = jsonData["signature"].ToString();
                var n = jsonData["nonce"].ToString();
                var t = long.Parse(jsonData["timestamp"].ToString());
                var signature = new AVIMSignature(s, t, n);
                return signature;
            }));
        }