Esempio n. 1
0
        /// <summary>
        /// Creates a push notification to a device
        /// </summary>
        private bool CreatePushNotification(string message, string platform, string deviceToken)
        {
            bool success;

            PushNotifcationsManager.SendPushNotificationToMobileDevice(deviceToken, message, platform, out success);
            return(success);
        }
Esempio n. 2
0
        public IHttpActionResult PostPushNotifications(ChatMessageCreate request)
        {
            bool success1;
            bool success;
            var  deviceToken = UserSecurity.GetDeviceTokenByUserId(AuthHelper.CurrentUser.Id, out success1); //Authentication.GetDeviceTokenBySessionToken(AuthHelper.TokenValue);
            var  platform    = "bbbbb";                                                                      //TODO implement this => Authentication.GetPlatformBySessionToken(AuthHelper.TokenValue);

            PushNotifcationsManager.SendPushNotificationToMobileDevice(deviceToken, request.Message, platform, out success);
            if (success)
            {
                return(Ok("Success"));
            }
            return(Content(HttpStatusCode.BadRequest, "Push notification not sent."));
        }