Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
Created November 13, 2012 19:24
Show Gist options
  • Save prabirshrestha/4067816 to your computer and use it in GitHub Desktop.
Save prabirshrestha/4067816 to your computer and use it in GitHub Desktop.
nancy fb real time subscription example
// 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