public async void OnAuthenticated(AuthenticationResponse authResponse) { try { //resend unsent messages: var unsentMessages = await messageRepository.GetUnsentMessagesAsync(); foreach (var message in unsentMessages) { await SendMessageAsync(message); } //process missed messages: OnIncomingMessages(authResponse.MissedMessages); } catch (Exception ex) { App.Logger.Report(ex); } }
private async static void OnAuthenticated(AuthenticationResponse authResponse) { Out.WriteLine("Authenticated. Missed messages:"); foreach (var msg in authResponse.MissedMessages) { Out.WriteLine(">> {0}", msg.Text); } await messagingService.MessageReceivedStatusAcknowledge( new MessageReceivedStatusAcknowledgeRequest { Messages = authResponse .MissedMessages .Select(msg => msg.EventId) .ToList() }); authenticated = true; }
internal virtual void OnAuthenticating(ISession session, AuthenticationResponse respone) { }
internal override void OnAuthenticating(ISession session, AuthenticationResponse respone) { respone.MissedMessages = _messageEventManager .GetMissedEvents(session.DeviceId) .Select(MessageDtoConverter) .ToList(); }