/// <summary> /// Subscribes to Facebook Realtime API. /// </summary> /// <param name="module">The <see cref="NancyModule"/>.</param> /// <param name="settings">The Facebook Realtime Subscription API settings.</param> /// <param name="callback">The callback to be called when a new notification is received.</param> /// <param name="throwException">Indicates whether to throw exception if verification fails.</param> /// <param name="resultType">The type ot deserialize json into.</param> /// <param name="jsonDeserializer">The json deserializer.</param> public static void SubscribeToFacebookRealtimeUpdates(this NancyModule module, FacebookSubscriptionSettings settings, Action <dynamic> callback, bool throwException = false, Type resultType = null, Func <string, Type, object> jsonDeserializer = null) { if (settings == null) { throw new ArgumentNullException("settings"); } module.SubscribeToFacebookRealtimeUpdates("/", ctx => settings, (parameter, result) => callback(result), throwException, resultType, jsonDeserializer); }
/// <summary> /// Subscribes to Facebook Realtime API. /// </summary> /// <param name="module">The <see cref="NancyModule"/>.</param> /// <param name="appSecret">The Facebook app secret.</param> /// <param name="verifyToken">The verify token.</param> /// <param name="callback">The callback to be called when a new notification is received.</param> /// <param name="throwException">Indicates whether to throw exception if verification fails.</param> /// <param name="resultType">The type ot deserialize json into.</param> /// <param name="jsonDeserializer">The json deserializer.</param> public static void SubscribeToFacebookRealtimeUpdates(this NancyModule module, string appSecret, string verifyToken, Action <dynamic> callback, bool throwException = false, Type resultType = null, Func <string, Type, object> jsonDeserializer = null) { module.SubscribeToFacebookRealtimeUpdates( "/", new FacebookSubscriptionSettings(appSecret, verifyToken), callback, throwException, resultType, jsonDeserializer); }
/// <summary> /// Subscribes to Facebook Realtime API. /// </summary> /// <param name="module">The <see cref="NancyModule"/>.</param> /// <param name="path">The route path.</param> /// <param name="condition">The route condition.</param> /// <param name="settings">The Facebook Realtime Subscription API settings.</param> /// <param name="callback">The callback to be called when a new notification is received.</param> /// <param name="throwException">Indicates whether to throw exception if verification fails.</param> /// <param name="resultType">The type ot deserialize json into.</param> /// <param name="jsonDeserializer">The json deserializer.</param> public static void SubscribeToFacebookRealtimeUpdates(this NancyModule module, string path, Func <NancyContext, bool> condition, FacebookSubscriptionSettings settings, Action <dynamic, dynamic> callback, bool throwException = false, Type resultType = null, Func <string, Type, object> jsonDeserializer = null) { if (settings == null) { throw new ArgumentNullException("settings"); } module.SubscribeToFacebookRealtimeUpdates(path, condition, ctx => settings, callback, throwException, resultType, jsonDeserializer); }