/// <summary>
        /// This method is used to integrate Android Push Notification
        /// </summary>
        /// <param name="RegistrationID">Registration ID or Token</param>
        /// <param name="SenderID">Google EmailID</param>
        /// <param name="Password">Password of EmailID</param>
        /// <param name="Message">Push Message</param>
        /// <returns>Status=Provided parameter missing the currect value,Authentication Fail, Unauthorized - need new token, Response from web service isn't OK, Success</returns>
        public string Android(string RegistrationID, string SenderID, string Password, string Message)
        {
            string Status = "";
            //--Validating the required parameter--//
            if (CheckAndroidValidation(RegistrationID, SenderID, Password, Message) == false)
            {
                Status = "Provided parameter missing the currect value.";
            }
            else
            {
                //-- Check Authentication --//
                Android objAndroid = new Android();
                string AuthString = objAndroid.CheckAuthentication(SenderID, Password);

                if (AuthString == "Fail")
                {
                    Status = "Authentication Fail";
                }
                else
                {
                    Status = objAndroid.SendMessage(RegistrationID, Message, AuthString);
                }

            }

            //-- Return the Status of Push Notification --//
            return Status;
        }
        private void SendMessageToAll()
        {
            List<User> users = new List<User>();
            users = GetAllUsers();
            if(users != null)
            {
                Android android = new Android();
                foreach (var usr in users)
	            {
                    android.SendMessage(usr.RegistrationId,"Something is wrong today", "");
	            }
            }
        }
Beispiel #3
0
        /// <summary>
        /// This method is used to integrate Android Push Notification
        /// </summary>
        /// <param name="RegistrationID">Registration ID or Token</param>
        /// <param name="Message">Push Message</param>
        /// <returns>Status=Provided parameter missing the currect value,Authentication Fail, Unauthorized - need new token, Response from web service isn't OK, Success</returns>
        public string Android(string RegistrationID, string Message)
        {
            Android objAndroid = new Android();

            return(objAndroid.SendMessage(RegistrationID, Message));
        }