Example #1
0
        static void OnReceiveIMMessage(string content, string jsonAckResult, IntPtr userData)
        {
            if (OnReceiveMessageHandler == null)
            {
                return;
            }
            NIMReceivedMessage msg = NIMReceivedMessage.Deserialize(content);

            OnReceiveMessageHandler(null, new NIMReceiveMessageEventArgs(msg));
        }
Example #2
0
        static void OnReceiveIMMessage(string content, string jsonAckResult, IntPtr userData)
        {
            NIMReceivedMessage msg = NIMReceivedMessage.Deserialize(content);

#if UNITY_ANDROID && !UNITY_EDITOR
            if (_sendLocalPushNotificationCallback != null)
            {
                _sendLocalPushNotificationCallback(msg);
            }
#endif
            if (OnReceiveMessageHandler != null)
            {
                OnReceiveMessageHandler(null, new NIMReceiveMessageEventArgs(msg));
            }
        }
Example #3
0
        static void OnReceivedBatchMessagesCallback(string content, string jsonArcResult, IntPtr userData)
        {
            List <NIMReceivedMessage> msgs = null;

            if (!string.IsNullOrEmpty(content))
            {
                var list = NimUtility.Json.JsonParser.Deserialize <List <Newtonsoft.Json.Linq.JObject> >(content);
                if (list != null)
                {
                    msgs = new List <NIMReceivedMessage>();
                    foreach (var obj in list)
                    {
                        NIMReceivedMessage msg = NIMReceivedMessage.Deserialize(obj);
                        msgs.Add(msg);
                    }
                }
            }
            NimUtility.DelegateConverter.Invoke <ReceiveBatchMesaagesDelegate>(userData, msgs);
        }