Created
November 13, 2012 19:24
-
-
Save prabirshrestha/4067816 to your computer and use it in GitHub Desktop.
nancy fb real time subscription example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // advanced | |
| public class FacebookSubscriptionModule : NancyModule { | |
| public FacebookSubscriptionModule() { | |
| Get["/"] = | |
| _ => Response.AsFacebookGetSubscriptionResponse("app_secret", "verify_token"); | |
| Post["/"] = x => { | |
| _ => Response.AsFacebookPostSubscriptionResponse("app_secret", x => { | |
| }); | |
| }; | |
| } | |
| } | |
| // easier way | |
| public class FacebookSubscriptionModule : NancyModule { | |
| public FacebookSubscriptionModule() { | |
| this.SubscribeToFacebookRealTimeUpdates(x => { | |
| var bind = this.Bind(); | |
| }); | |
| this.SubscribeToFacebookRealTimeUpdates("/{appid}/user", x => { | |
| }); | |
| this.SubscribeToFacebookRealTimeUpdates("/{appid}/user", ctx => true, x => { | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment