コード例 #1
0
        public async Task <IActionResult> PushEvent(string EventName, int DeviceID)
        {
            var user = await _userManager.GetUserAsync(HttpContext.User);

            Events evnt = new Events();

            evnt.DeviceID  = DeviceID;
            evnt.EventName = EventName;
            evnt.Initialize();

            AdminUser au = new AdminUser();

            au.getDevices(user.FBToken);
            DeviceVM device = _mapper.Map <DeviceVM>(db.Devices.FirstOrDefault(d => d.Id == DeviceID));

            device.SetEventToBeSend(evnt);

            FirebaseSetting fbs = new FirebaseSetting();

            fbs = db.FirebaseSettings.FirstOrDefault();
            FirebaseSupportService fbss = new FirebaseSupportService(fbs, _mapper);

            fbss.MaketheAPICall(device);

            return(View(evnt));
        }