private void DeleteMessage()
        {
            DataSetWS dataSetWs = new DataSetWS();

            dataSetWs.SetMessageCompleted += DataSetWs_SetMessageCompleted;
            dataSetWs.SetMessageAsync("{\"action\" : \"setstate\", \"id\" : " + mCurentMessageID.ToString() + ", \"status\" : \"delete\"}");
        }
        public override void OnMessageReceived(RemoteMessage message)
        {
            if (message.GetNotification() != null)
            {
                int    nid         = message.Data.ContainsKey("id") ? int.Parse(message.Data["id"]) : AppVariable.nIDFcm;
                string nref        = message.Data.ContainsKey("ref") ? message.Data["ref"] : string.Empty;
                string nreflistmod = message.Data.ContainsKey("reflistmod") ? message.Data["reflistmod"] : string.Empty;
                string nname       = message.Data.ContainsKey("name") ? message.Data["name"] : string.Empty;

                ShowNotification(message.GetNotification().Title, message.GetNotification().Body, nid, nref, nreflistmod, nname);
            }
            else
            {
                if (message.Data.Count > 0)
                {
                    if (message.Data["confirmation"] == "true")
                    {
                        if (!AppPreferences.Preferences.GetPreferences("remember", false))
                        {
                            return;
                        }

                        if (!AppVariable.Variable.isOnline)
                        {
                            AppPreferences.Preferences.LoadPreferences();
                        }

                        DataSetWS dataSetWS = new DataSetWS();
                        dataSetWS.SetMessageCompleted += DataSetWS_SetMessageCompleted;
                        dataSetWS.SetMessageAsync("{\"action\" : \"setstate\", \"id\" : " + message.Data["id"] + ", \"status\" : \"recive\"}");
                    }
                }
            }
        }
 private void SendMessage()
 {
     if (CheckField())
     {
         mProgressDialog.SetMessage("Отправка...");
         mProgressDialog.Show();
         DataSetWS dataSetWs = new DataSetWS();
         dataSetWs.SetMessageCompleted += DataSetWs_SetMessageCompleted;
         dataSetWs.SetMessageAsync(new MessageSender()
         {
             recivers = Recivers, title = mTitle.Text, message = mMessage.Text
         }.getJsonString());
     }
 }