| Safe Haskell | Safe-Infered |
|---|
Yesod.Facebook
- class Yesod master => YesodFacebook master where
- fbCredentials :: master -> Credentials
- fbHttpManager :: master -> Manager
- runFacebookT :: YesodFacebook master => FacebookT Auth (GHandler sub master) a -> GHandler sub master a
- runNoAuthFacebookT :: YesodFacebook master => FacebookT NoAuth (GHandler sub master) a -> GHandler sub master a
- getFbCredentials :: YesodFacebook master => GHandler sub master Credentials
- parseRealTimeUpdateNotifications :: (YesodFacebook master, FromJSON a) => GHandler sub master (RealTimeUpdateNotification a)
- answerRealTimeUpdateChallenge :: RealTimeUpdateToken -> GHandler sub master RepPlain
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).
runFacebookT :: YesodFacebook master => FacebookT Auth (GHandler sub master) a -> GHandler sub master aSource
Run a FacebookT action inside a GHandler using your
credentials.
runNoAuthFacebookT :: 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.