-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Useful glue functions between the fb library and Yesod.
--   
--   This package contains useful glue functions between the fb package
--   (<a>http://hackage.haskell.org/package/fb</a>) and Yesod. These
--   functions can't be included on the fb package itself because it should
--   not depend on Yesod.
@package yesod-fb
@version 0.5.0

module Yesod.Facebook

-- | The <a>YesodFacebook</a> class for foundation datatypes that support
--   running <a>FacebookT</a> actions.
class Yesod site => YesodFacebook site

-- | The credentials of your app.
fbCredentials :: YesodFacebook site => site -> Credentials

-- | HTTP manager used for contacting Facebook (may be the same as the one
--   used for <tt>yesod-auth</tt>).
fbHttpManager :: (YesodFacebook site, MonadHandler m, HandlerSite m ~ site) => m Manager

-- | Use Facebook's beta tier if <tt>True</tt>. The default is
--   <tt>False</tt>.
fbUseBetaTier :: YesodFacebook site => site -> Bool

-- | Run a <tt>FacebookT</tt> action inside a <a>GHandler</a> using your
--   credentials.
runYesodFbT :: (MonadHandler m, HandlerSite m ~ site, YesodFacebook site) => FacebookT Auth m a -> m a

-- | Run a <tt>FacebookT</tt> action inside a <a>GHandler</a> without using
--   your credentials. Usually you won't need to use this function but it's
--   provided for completeness' sake.
runNoAuthYesodFbT :: (MonadHandler m, HandlerSite m ~ site, YesodFacebook site) => FacebookT NoAuth m a -> m a

-- | Returns Facebook's <a>Credentials</a> from inside a <a>HandlerT</a>.
--   Just a convenience wrapper around <a>fbCredentials</a>.
getFbCredentials :: (MonadHandler m, HandlerSite m ~ site, YesodFacebook site) => m Credentials

-- | Same as <tt>getRealTimeUpdateNotifications</tt> but does the
--   heavy-lifting for you. Throws an exception whenever any step fails
--   (signature header not found, invalid signature, invalid JSON).
parseRealTimeUpdateNotifications :: (MonadHandler m, HandlerSite m ~ site, YesodFacebook site, FromJSON a) => m (RealTimeUpdateNotification a)

-- | Answer Facebook's challenge if the <a>RealTimeUpdateToken</a> matches.
--   
--   Whenever you modify your subscriptions, Facebook will try to contact
--   your server with the <a>RealTimeUpdateToken</a> that you gave on your
--   call to <a>modifySubscription</a>. This function will correctly answer
--   Facebook's challenge if the <a>RealTimeUpdateToken</a> matches,
--   otherwise it will return <a>notFound</a>.
answerRealTimeUpdateChallenge :: MonadHandler m => RealTimeUpdateToken -> m RepPlain

-- | Lookup and parse the <tt>request_ids</tt> GET parameter
--   <a>http://developers.facebook.com/docs/requests/</a>.
lookupRequestIds :: MonadHandler m => m (Maybe [Id])
