public ResponseActionResult ValidateSubscription() { string hubMode = Request.QueryString["hub.mode"]; string hubVerifyToken = Request.QueryString["hub.verify_token"]; string hubChallenge = Request.QueryString["hub.challenge"]; Facebook.FacebookClient fb = new FacebookClient(); fb.SubscriptionVerifyToken = ConfigurationManager.AppSettings["Facebook_Verify_Token"]; // VerifyGetSubscription will throw exception if verification fails. fb.VerifyGetSubscription(hubMode, hubVerifyToken, hubChallenge); string message = string.Format("Subscription Verification Received - {0}", hubVerifyToken); #region Broadcast Message GlobalHost.ConnectionManager.GetHubContext <NotificationHub>(). Clients.All. addNewNotificationToPage( RenderRazorViewToString("FB_NotificationItem", NotificationMessage.NewMessage("Subscription", message)) ); #endregion return(new ResponseActionResult(hubChallenge)); }
public string Activate() { return(new BaseController().RenderRazorViewToString( "FB_NotificationItem", NotificationMessage. NewMessage("Receiving Notifications"))); }