Ejemplo n.º 1
0
            private void Stream_GroupReceived(string json)
            {
                var obj = Json.Convert.FromJson <Data.ActivityItem>(json);

                if (obj != null)
                {
                    ActivityReceived?.Invoke(obj);
                }
            }
Ejemplo n.º 2
0
 private void PollForMessages(Conversation conversation)
 {
     Device.StartTimer(new TimeSpan(0, 0, 1), () =>
     {
         var activitySet = _client.Conversations.GetActivities(conversation.ConversationId, _watermark);
         var activities  = activitySet?.Activities.Where(_ => _.From.Id != GetUserId());
         _watermark      = activitySet.Watermark;
         if (activities != null)
         {
             foreach (var activity in activities)
             {
                 ActivityReceived?.Invoke(this, new ActivityEventArgs()
                 {
                     Activity = activity
                 });
             }
         }
         return(true);
     });
 }