Пример #1
0
        public async Task <ActionResult> AttendanceFlutter([FromBody] AttendanceRequest request)
        {
            ActionResult response = NotFound();

            try
            {
                AttendanceService service = new AttendanceService(_unitOfWork);
                Message           message = service.CreateMessageOfFutter(request);
                if (message != null)
                {
                    // Send a message to the device corresponding to the provided
                    // registration token.
                    String HTTPProtocol = await FirebaseMessaging.DefaultInstance.SendAsync(message).ConfigureAwait(true);

                    JObject o = new JObject(new JProperty("name", HTTPProtocol));

                    response = Ok(o);
                    // Response is a message ID string.
                }
            }
            catch
            {
                response = BadRequest();
            }
            return(response);
        }