Пример #1
0
        public bool ProcessIncomingPushMessage(PushMessage pushmessage)
        {
            NewRelic.Api.Agent.NewRelic.AddCustomParameter("Recipients.Count", pushmessage.Recipients.Count);
            if (pushmessage.Recipients.Count > 0)
            {
                NewRelic.Api.Agent.NewRelic.AddCustomParameter("0-DeviceId", pushmessage.Recipients[0].DeviceId);
                NewRelic.Api.Agent.NewRelic.AddCustomParameter("0-ProviderEndpoint", pushmessage.Recipients[0]
                                                               .ProviderEndpoint);
                NewRelic.Api.Agent.NewRelic.AddCustomParameter("0-UserId", JsonConvert.SerializeObject
                                                                   (pushmessage.Recipients[0].UserId));

                // Send message through provider
                _pushMessageProvider.SendMessage(pushmessage.Recipients, pushmessage.Message);
            }
            else
            {
                _eventLogRepository.WriteErrorLog("Push message consumed with 0 recipients.");
            }
            return(true);
        }