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

Safe HaskellNone
LanguageHaskell98

Yesod.Facebook

Contents

Synopsis

Running FacebookT actions inside HandlerT

class Yesod site => YesodFacebook site where Source

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

Minimal complete definition

fbCredentials, fbHttpManager

Methods

fbCredentials :: site -> Credentials Source

The credentials of your app.

fbHttpManager :: site -> Manager Source

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

fbUseBetaTier :: site -> Bool Source

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

runYesodFbT :: (MonadHandler m, HandlerSite m ~ site, YesodFacebook site) => FacebookT Auth m a -> m a Source

Run a FacebookT action inside a GHandler using your credentials.

runNoAuthYesodFbT :: (MonadHandler m, HandlerSite m ~ site, YesodFacebook site) => FacebookT NoAuth m a -> m a Source

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 :: (MonadHandler m, HandlerSite m ~ site, YesodFacebook site) => m Credentials Source

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

Real-time update notifications

parseRealTimeUpdateNotifications :: (MonadHandler m, HandlerSite m ~ site, YesodFacebook site, FromJSON a) => m (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 :: MonadHandler m => RealTimeUpdateToken -> m RepPlain Source

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 :: MonadHandler m => m (Maybe [Id]) Source

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