Exemplo n.º 1
0
        public ActionResult Receive()
        {
            var query = Request.QueryString;

            if (query["hub.mode"] == "subscribe" &&
                query["hub.verify_token"] == AppInstance.getInstance().getFbverify_token())
            {
                //string type = Request.QueryString["type"];
                var retVal = query["hub.challenge"];
                return(Json(int.Parse(retVal), JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(HttpNotFound());
            }
        }
Exemplo n.º 2
0
        public ActionResult ReceivePost(BotRequest data)
        {
            Task task = Task.Run(() =>
            {
                foreach (var entry in data.entry)
                {
                    foreach (var message in entry.messaging)
                    {
                        if (message.recipient.id.Equals(AppInstance.getInstance().getFbPageId()))
                        {
                            ProgressRequest(message);
                        }
                    }
                }
            });

            return(new HttpStatusCodeResult(HttpStatusCode.OK));
        }