yesod-fb-0.2.3: Useful glue functions between the fb library and Yesod.

Safe HaskellNone

Yesod.Facebook

Contents

Synopsis

Running FacebookT actions inside GHandler

class Yesod master => YesodFacebook master whereSource

The YesodFacebook class for foundation datatypes that support running FacebookT actions.

Methods

fbCredentials :: master -> CredentialsSource

The credentials of your app.

fbHttpManager :: master -> ManagerSource

HTTP manager used for contacting Facebook (may be the same as the one used for yesod-auth).

fbUseBetaTier :: master -> BoolSource

Use Facebook's beta tier if True. The default is False.

runYesodFbT :: YesodFacebook master => FacebookT Auth (GHandler sub master) a -> GHandler sub master aSource

Run a FacebookT action inside a GHandler using your credentials.

runNoAuthYesodFbT :: YesodFacebook master => FacebookT NoAuth (GHandler sub master) a -> GHandler sub master aSource

Run a FacebookT action inside a GHandler without using your credentials. Usually you won't need to use this function but it's provided for completeness' sake.

getFbCredentials :: YesodFacebook master => GHandler sub master CredentialsSource

Returns Facebook's Credentials from inside a GHandler. Just a convenience wrapper around fbCredentials.

Real-time update notifications

parseRealTimeUpdateNotifications :: (YesodFacebook master, FromJSON a) => GHandler sub master (RealTimeUpdateNotification a)Source

Same as getRealTimeUpdateNotifications but does the heavy-lifting for you. Throws an exception whenever any step fails (signature header not found, invalid signature, invalid JSON).

answerRealTimeUpdateChallenge :: RealTimeUpdateToken -> GHandler sub master RepPlainSource

Answer Facebook's challenge if the RealTimeUpdateToken matches.

Whenever you modify your subscriptions, Facebook will try to contact your server with the RealTimeUpdateToken that you gave on your call to modifySubscription. This function will correctly answer Facebook's challenge if the RealTimeUpdateToken matches, otherwise it will return notFound.

Requests

lookupRequestIds :: GHandler sub master (Maybe [Id])Source

Lookup and parse the request_ids GET parameter http://developers.facebook.com/docs/requests/.