fb-2.1.1.1: Bindings to Facebook's API.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Facebook

Contents

- `FacebookT` monad transformer
- Authorization and Authentication
  - Credentials
  - Access token
  - App access token
  - User access token
  - Signed requests
- Facebook's Graph API
  - User
  - Page
  - Actions
  - Checkins
  - Order
  - Friend list
- Facebook's Graph API basic functionality
  - Simple types
  - Complex types
  - Pagination
- Real-time update notifications
  - Subscriptions
  - Notifications
- FQL
- Test User API
- Raw access to the Graph API
- Exceptions
- Internal functions

Synopsis

- data FacebookT auth m a
- runFacebookT :: MonadIO m => Credentials -> Manager -> FacebookT Auth m a -> m a
- runNoAuthFacebookT :: MonadIO m => Manager -> FacebookT NoAuth m a -> m a
- mapFacebookT :: (m a -> n b) -> FacebookT anyAuth m a -> FacebookT anyAuth n b
- beta_runFacebookT :: MonadIO m => Credentials -> Manager -> FacebookT Auth m a -> m a
- beta_runNoAuthFacebookT :: MonadIO m => Manager -> FacebookT NoAuth m a -> m a
- data Auth
- data NoAuth
- data Credentials = Credentials {
  - appName :: Text
  - appId :: Text
  - appSecret :: Text
  - appSecretProof :: Bool
  }
- data AccessToken kind where
  - UserAccessToken :: UserId -> AccessTokenData -> UTCTime -> AccessToken UserKind
  - AppAccessToken :: AccessTokenData -> AccessToken AppKind
- type UserAccessToken = AccessToken UserKind
- type AppAccessToken = AccessToken AppKind
- type AccessTokenData = Text
- type ApiVersion = Text
- hasExpired :: (Functor m, MonadIO m) => AccessToken anyKind -> m Bool
- isValid :: (MonadResource m, MonadUnliftIO m) => AccessToken anyKind -> FacebookT anyAuth m Bool
- setApiVersion :: MonadIO m => ApiVersion -> FacebookT anyAuth m ()
- getApiVersion :: MonadIO m => FacebookT anyAuth m ApiVersion
- data AppKind
- getAppAccessToken :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => FacebookT Auth m AppAccessToken
- data UserKind
- type RedirectUrl = Text
- data Permission
- getUserAccessTokenStep1 :: (Monad m, MonadIO m) => RedirectUrl -> [Permission] -> FacebookT Auth m Text
- getUserAccessTokenStep2 :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => RedirectUrl -> [Argument] -> FacebookT Auth m UserAccessToken
- getUserLogoutUrl :: Monad m => UserAccessToken -> RedirectUrl -> FacebookT Auth m Text
- extendUserAccessToken :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => UserAccessToken -> FacebookT Auth m (Either FacebookException UserAccessToken)
- debugToken :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => AppAccessToken -> AccessTokenData -> FacebookT Auth m DebugToken
- data DebugToken = DebugToken {
  - dtAppId :: Maybe Text
  - dtAppName :: Maybe Text
  - dtExpiresAt :: Maybe UTCTime
  - dtIsValid :: Maybe Bool
  - dtIssuedAt :: Maybe UTCTime
  - dtScopes :: Maybe [Permission]
  - dtUserId :: Maybe Id
  - dtAccessToken :: Maybe UserAccessToken
  }
- parseSignedRequest :: (FromJSON a, Monad m, MonadIO m) => ByteString -> FacebookT Auth m (Maybe a)
- addAppSecretProof :: Credentials -> Maybe (AccessToken anykind) -> SimpleQuery -> SimpleQuery
- makeAppSecretProof :: Credentials -> Maybe (AccessToken anyKind) -> SimpleQuery
- data User = User {
  - userId :: UserId
  - userName :: Maybe Text
  - userFirstName :: Maybe Text
  - userMiddleName :: Maybe Text
  - userLastName :: Maybe Text
  - userGender :: Maybe Gender
  - userLocale :: Maybe Text
  - userUsername :: Maybe Text
  - userVerified :: Maybe Bool
  - userEmail :: Maybe Text
  - userLocation :: Maybe Place
  }
- type UserId = Id
- data Gender
  - = Male
  - | Female
- getUser :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => UserId -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m User
- searchUsers :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Text -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m (Pager User)
- getUserCheckins :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => UserId -> [Argument] -> UserAccessToken -> FacebookT anyAuth m (Pager Checkin)
- data Friend = Friend {
  - friendId :: UserId
  - friendName :: Text
  }
- getUserFriends :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => UserId -> [Argument] -> UserAccessToken -> FacebookT anyAuth m (Pager Friend)
- getUserFriendLists :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => UserId -> [Argument] -> UserAccessToken -> FacebookT anyAuth m (Pager FriendList)
- data Page = Page {
  - pageId :: Id
  - pageName :: Maybe Text
  - pageLink :: Maybe Text
  - pageCategory :: Maybe Text
  - pageIsPublished :: Maybe Bool
  - pageCanPost :: Maybe Bool
  - pageLikes :: Maybe Integer
  - pageLocation :: Maybe Location
  - pagePhone :: Maybe Text
  - pageCheckins :: Maybe Integer
  - pagePicture :: Maybe Text
  - pageWebsite :: Maybe Text
  - pageTalkingAboutCount :: Maybe Integer
  }
- getPage :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m Page
- getPage_ :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> [Argument] -> Maybe AppAccessToken -> FacebookT anyAuth m Page
- searchPages :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Text -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m (Pager Page)
- data Action
- createAction :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => Action -> [Argument] -> Maybe AppAccessToken -> UserAccessToken -> FacebookT Auth m Id
- data Checkin = Checkin {
  - checkinId :: Id
  - checkinFrom :: Maybe CheckinFrom
  - checkinPlace :: Maybe Place
  - checkinCreatedTime :: Maybe UTCTime
  - checkinTags :: Maybe (Pager Tag)
  - checkinMessage :: Maybe Text
  }
- data CheckinFrom = CheckinFrom {
  - checkinFromId :: UserId
  - checkinFromName :: Text
  }
- getCheckin :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m Checkin
- createCheckin :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> GeoCoordinates -> [Argument] -> UserAccessToken -> FacebookT Auth m Id
- data Order = Order {
  - orderId :: OrderId
  - orderFrom :: UserId
  - orderTo :: UserId
  - orderAmount :: Integer
  - orderStatus :: OrderStatus
  - orderApplication :: OrderApplication
  - orderCountry :: Text
  - orderRefundCode :: Maybe Text
  - orderCreatedTime :: ZonedTime
  - orderUpdatedTime :: ZonedTime
  }
- type OrderId = Id
- data OrderApplication
- data OrderStatus
- getOrder :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => OrderId -> UserAccessToken -> FacebookT anyAuth m Order
- data FriendList = FriendList {
  - friendListId :: Id
  - friendListName :: Text
  - friendListType :: FriendListType
  }
- data FriendListType
  - = CloseFriendsList
  - | AcquaintancesList
  - | RestrictedList
  - | UserCreatedList
  - | EducationList
  - | WorkList
  - | CurrentCityList
  - | FamilyList
- getFriendListMembers :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> [Argument] -> UserAccessToken -> FacebookT anyAuth m (Pager Friend)
- (#=) :: SimpleType a => ByteString -> a -> Argument
- class SimpleType a where
  - encodeFbParam :: a -> ByteString
- newtype FbUTCTime = FbUTCTime {
  - unFbUTCTime :: UTCTime
  }
- data Place = Place {
  - placeId :: Id
  - placeName :: Maybe Text
  - placeLocation :: Maybe Location
  }
- data Location = Location {
  - locationStreet :: Maybe Text
  - locationCity :: Maybe Text
  - locationState :: Maybe Text
  - locationCountry :: Maybe Text
  - locationZip :: Maybe Text
  - locationCoords :: Maybe GeoCoordinates
  }
- data GeoCoordinates = GeoCoordinates {
  - latitude :: !Double
  - longitude :: !Double
  }
- data Tag = Tag {
  - tagId :: Id
  - tagName :: Text
  }
- data Pager a = Pager {
  - pagerData :: [a]
  - pagerPrevious :: Maybe String
  - pagerNext :: Maybe String
  }
- fetchNextPage :: (MonadResource m, FromJSON a, MonadThrow m, MonadUnliftIO m) => Pager a -> FacebookT anyAuth m (Maybe (Pager a))
- fetchPreviousPage :: (MonadResource m, FromJSON a, MonadThrow m, MonadUnliftIO m) => Pager a -> FacebookT anyAuth m (Maybe (Pager a))
- fetchAllNextPages :: (Monad m, FromJSON a, MonadUnliftIO n, MonadThrow n) => Pager a -> FacebookT anyAuth m (ConduitT () a n ())
- fetchAllPreviousPages :: (Monad m, FromJSON a, MonadUnliftIO n, MonadThrow n) => Pager a -> FacebookT anyAuth m (ConduitT () a n ())
- modifySubscription :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => RealTimeUpdateObject -> [RealTimeUpdateField] -> RealTimeUpdateUrl -> RealTimeUpdateToken -> AppAccessToken -> FacebookT Auth m ()
- listSubscriptions :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => AppAccessToken -> FacebookT Auth m [RealTimeUpdateSubscription]
- data RealTimeUpdateObject
  - = UserRTUO
  - | PermissionsRTUO
  - | PageRTUO
  - | ErrorsRTUO
  - | OtherRTUO Text
- type RealTimeUpdateField = ByteString
- type RealTimeUpdateUrl = Text
- type RealTimeUpdateToken = ByteString
- data RealTimeUpdateSubscription = RealTimeUpdateSubscription {
  - rtusObject :: RealTimeUpdateObject
  - rtusCallbackUrl :: RealTimeUpdateUrl
  - rtusFields :: [RealTimeUpdateField]
  - rtusActive :: Bool
  }
- verifyRealTimeUpdateNotifications :: (Monad m, MonadIO m) => ByteString -> ByteString -> FacebookT Auth m (Maybe ByteString)
- getRealTimeUpdateNotifications :: (Monad m, FromJSON a, MonadIO m) => ByteString -> ByteString -> FacebookT Auth m (Maybe (RealTimeUpdateNotification a))
- data RealTimeUpdateNotification a = RealTimeUpdateNotification {
  - rtunObject :: RealTimeUpdateObject
  - rtunEntries :: [a]
  }
- data RealTimeUpdateNotificationUserEntry = RealTimeUpdateNotificationUserEntry {
  - rtuneUserId :: Id
  - rtuneChangedFields :: [RealTimeUpdateField]
  - rtuneTime :: Integer
  }
- fqlQuery :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> Maybe (AccessToken anyKind) -> FacebookT anyAuth m (Pager a)
- newtype FQLTime = FQLTime {
  - unFQLTime :: UTCTime
  }
- newtype FQLList a = FQLList {
  - unFQLList :: [a]
  }
- newtype FQLObject a = FQLObject {
  - unFQLObject :: a
  }
- getTestUsers :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => AppAccessToken -> FacebookT Auth m (Pager TestUser)
- disassociateTestuser :: (MonadUnliftIO m, MonadThrow m, MonadResource m, MonadIO m) => TestUser -> AppAccessToken -> FacebookT Auth m Bool
- removeTestUser :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => TestUser -> AppAccessToken -> FacebookT Auth m Bool
- createTestUser :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => CreateTestUser -> AppAccessToken -> FacebookT Auth m TestUser
- makeFriendConn :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => TestUser -> TestUser -> FacebookT Auth m ()
- incompleteTestUserAccessToken :: TestUser -> Maybe UserAccessToken
- data TestUser = TestUser {
  - tuId :: UserId
  - tuAccessToken :: Maybe AccessTokenData
  - tuLoginUrl :: Maybe Text
  - tuEmail :: Maybe Text
  - tuPassword :: Maybe Text
  }
- data CreateTestUser = CreateTestUser {
  - ctuInstalled :: CreateTestUserInstalled
  - ctuName :: Maybe Text
  - ctuLocale :: Maybe Text
  }
- data CreateTestUserInstalled
  - = CreateTestUserNotInstalled
  - | CreateTestUserInstalled {
    - ctuiPermissions :: [Permission]
    }
  - | CreateTestUserFbDefault
- getObject :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> [Argument] -> Maybe (AccessToken anyKind) -> FacebookT anyAuth m a
- postObject :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> [Argument] -> AccessToken anyKind -> FacebookT Auth m a
- deleteObject :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> [Argument] -> AccessToken anyKind -> FacebookT Auth m a
- searchObjects :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> Text -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m (Pager a)
- newtype Id = Id {
  - idCode :: Text
  }
- type Argument = (ByteString, ByteString)
- data FacebookException
  - = FacebookException {
    - fbeType :: Text
    - fbeMessage :: Text
    }
  - | FbLibraryException {
    - fbeMessage :: Text
    }
- unPermission :: Permission -> Text

# `FacebookT` monad transformer

data FacebookT auth m a Source #

`FacebookT auth m a` is this library's monad transformer. Contains information needed to issue commands and queries to Facebook. The phantom type `auth` may be either `Auth` (you have supplied your `Credentials`) or `NoAuth` (you have not supplied any `Credentials`).

#### Instances

Instances details

MonadBase b m => MonadBase b (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods liftBase :: b α -> FacebookT auth m α Source #
MonadTrans (FacebookT auth) Source # |
Instance details Defined in Facebook.Monad Methods lift :: Monad m => m a -> FacebookT auth m a Source #
MonadFail m => MonadFail (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods fail :: String -> FacebookT auth m a Source #
MonadFix m => MonadFix (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods mfix :: (a -> FacebookT auth m a) -> FacebookT auth m a Source #
MonadIO m => MonadIO (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods liftIO :: IO a -> FacebookT auth m a Source #
Alternative m => Alternative (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods empty :: FacebookT auth m a Source # (<|>) :: FacebookT auth m a -> FacebookT auth m a -> FacebookT auth m a Source # some :: FacebookT auth m a -> FacebookT auth m [a] Source # many :: FacebookT auth m a -> FacebookT auth m [a] Source #
Applicative m => Applicative (FacebookT auth m) Source # |

Instance details

Defined in Facebook.Monad

Methods

pure :: a -> FacebookT auth m a Source #

(<*>) :: FacebookT auth m (a -> b) -> FacebookT auth m a -> FacebookT auth m b Source #

liftA2 :: (a -> b -> c) -> FacebookT auth m a -> FacebookT auth m b -> FacebookT auth m c Source #

(*>) :: FacebookT auth m a -> FacebookT auth m b -> FacebookT auth m b Source #

(<*) :: FacebookT auth m a -> FacebookT auth m b -> FacebookT auth m a Source #

Functor m => Functor (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods fmap :: (a -> b) -> FacebookT auth m a -> FacebookT auth m b Source # (<$) :: a -> FacebookT auth m b -> FacebookT auth m a Source #
Monad m => Monad (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods (>>=) :: FacebookT auth m a -> (a -> FacebookT auth m b) -> FacebookT auth m b Source # (>>) :: FacebookT auth m a -> FacebookT auth m b -> FacebookT auth m b Source # return :: a -> FacebookT auth m a Source #
MonadPlus m => MonadPlus (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods mzero :: FacebookT auth m a Source # mplus :: FacebookT auth m a -> FacebookT auth m a -> FacebookT auth m a Source #
MonadThrow m => MonadThrow (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods throwM :: (HasCallStack, Exception e) => e -> FacebookT auth m a Source #
MonadLogger m => MonadLogger (FacebookT auth m) Source # | Since `fb-0.14.8`.
Instance details Defined in Facebook.Monad Methods monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> FacebookT auth m () Source #
(MonadResource m, MonadBase IO m) => MonadResource (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods liftResourceT :: ResourceT IO a -> FacebookT auth m a Source #
MonadUnliftIO m => MonadUnliftIO (FacebookT auth m) Source # |
Instance details Defined in Facebook.Monad Methods withRunInIO :: ((forall a. FacebookT auth m a -> IO a) -> IO b) -> FacebookT auth m b Source #

runFacebookT Source #

Arguments

:: MonadIO m |
=> Credentials | Your app's credentials.
-> Manager | Connection manager (see `withManager`).
-> FacebookT Auth m a |
-> m a |

Run a computation in the `FacebookT` monad transformer with your credentials.

runNoAuthFacebookT Source #

Arguments

:: MonadIO m |
=> Manager | Connection manager (see `withManager`).
-> FacebookT NoAuth m a |
-> m a |

Run a computation in the `FacebookT` monad without credentials.

mapFacebookT :: (m a -> n b) -> FacebookT anyAuth m a -> FacebookT anyAuth n b Source #

Transform the computation inside a `FacebookT`.

beta_runFacebookT :: MonadIO m => Credentials -> Manager -> FacebookT Auth m a -> m a Source #

Same as `runFacebookT`, but uses Facebook's beta tier (see https://developers.facebook.com/support/beta-tier/).

beta_runNoAuthFacebookT :: MonadIO m => Manager -> FacebookT NoAuth m a -> m a Source #

Same as `runNoAuthFacebookT`, but uses Facebook's beta tier (see https://developers.facebook.com/support/beta-tier/).

data Auth Source #

Phantom type stating that you have provided your `Credentials` and thus have access to the whole API.

data NoAuth Source #

Phantom type stating that you have not provided your `Credentials`. This means that you'll be limited about which APIs you'll be able use.

# Authorization and Authentication

## Credentials

data Credentials Source #

Credentials that you get for your app when you register on Facebook.

Constructors

Credentials |

Fields

- appName :: Text

  Your application name (e.g. for Open Graph calls).

- appId :: Text

  Your application ID.

- appSecret :: Text

  Your application secret key.

- appSecretProof :: Bool

  To enable app secret proof verification

#### Instances

Instances details

Read Credentials Source # |
Instance details Defined in Facebook.Types Methods readsPrec :: Int -> ReadS Credentials Source # readList :: ReadS [Credentials] Source # readPrec :: ReadPrec Credentials Source # readListPrec :: ReadPrec [Credentials] Source #
Show Credentials Source # |
Instance details Defined in Facebook.Types Methods showsPrec :: Int -> Credentials -> ShowS Source # show :: Credentials -> String Source # showList :: [Credentials] -> ShowS Source #
Eq Credentials Source # |
Instance details Defined in Facebook.Types Methods (==) :: Credentials -> Credentials -> Bool Source # (/=) :: Credentials -> Credentials -> Bool Source #
Ord Credentials Source # |

Instance details

Defined in Facebook.Types

Methods

compare :: Credentials -> Credentials -> Ordering Source #

(<) :: Credentials -> Credentials -> Bool Source #

(<=) :: Credentials -> Credentials -> Bool Source #

(>) :: Credentials -> Credentials -> Bool Source #

(>=) :: Credentials -> Credentials -> Bool Source #

max :: Credentials -> Credentials -> Credentials Source #

min :: Credentials -> Credentials -> Credentials Source #

## Access token

data AccessToken kind where Source #

An access token. While you can make some API calls without an access token, many require an access token and some will give you more information with an appropriate access token.

There are two kinds of access tokens:

User access token
  An access token obtained after an user accepts your application. Let's you access more information about that user and act on their behalf (depending on which permissions you've asked for).
App access token
  An access token that allows you to take administrative actions for your application.

These two kinds of access tokens are distinguished by the phantom type on `AccessToken`, which can be `UserKind` or `AppKind`.

Constructors

UserAccessToken :: UserId -> AccessTokenData -> UTCTime -> AccessToken UserKind |
AppAccessToken :: AccessTokenData -> AccessToken AppKind |

#### Instances

Instances details

ParseAccessToken kind => FromJSON (AccessToken kind) Source # | Since 0.14.9. Parses the format that `ToJSON` produces. Note that you need to statically decide whether you want to parse a user access token or an app access token.
Instance details Defined in Facebook.Types Methods parseJSON :: Value -> Parser (AccessToken kind) Source # parseJSONList :: Value -> Parser [AccessToken kind] Source #
ToJSON (AccessToken kind) Source # | Synonym for `mappend`. Since 0.14.9. Not a Facebook JSON format, but a custom `fb` format for convenience if you need to serialize access tokens.
Instance details Defined in Facebook.Types Methods toJSON :: AccessToken kind -> Value Source # toEncoding :: AccessToken kind -> Encoding Source # toJSONList :: [AccessToken kind] -> Value Source # toEncodingList :: [AccessToken kind] -> Encoding Source #
Show (AccessToken kind) Source # |
Instance details Defined in Facebook.Types Methods showsPrec :: Int -> AccessToken kind -> ShowS Source # show :: AccessToken kind -> String Source # showList :: [AccessToken kind] -> ShowS Source #
Eq (AccessToken kind) Source # |
Instance details Defined in Facebook.Types Methods (==) :: AccessToken kind -> AccessToken kind -> Bool Source # (/=) :: AccessToken kind -> AccessToken kind -> Bool Source #
Ord (AccessToken kind) Source # |

Instance details

Defined in Facebook.Types

Methods

compare :: AccessToken kind -> AccessToken kind -> Ordering Source #

(<) :: AccessToken kind -> AccessToken kind -> Bool Source #

(<=) :: AccessToken kind -> AccessToken kind -> Bool Source #

(>) :: AccessToken kind -> AccessToken kind -> Bool Source #

(>=) :: AccessToken kind -> AccessToken kind -> Bool Source #

max :: AccessToken kind -> AccessToken kind -> AccessToken kind Source #

min :: AccessToken kind -> AccessToken kind -> AccessToken kind Source #

type UserAccessToken = AccessToken UserKind Source #

Type synonym for ``AccessToken` `UserKind``.

type AppAccessToken = AccessToken AppKind Source #

Type synonym for ``AccessToken` `AppKind``.

type AccessTokenData = Text Source #

The access token data that is passed to Facebook's API calls.

type ApiVersion = Text Source #

Graph API version. See: https://developers.facebook.com/docs/graph-api/changelog

hasExpired :: (Functor m, MonadIO m) => AccessToken anyKind -> m Bool Source #

`True` if the access token has expired, otherwise `False`.

isValid :: (MonadResource m, MonadUnliftIO m) => AccessToken anyKind -> FacebookT anyAuth m Bool Source #

`True` if the access token is valid. An expired access token is not valid (see `hasExpired`). However, a non-expired access token may not be valid as well. For example, in the case of an user access token, they may have changed their password, logged out from Facebook or blocked your app.

setApiVersion :: MonadIO m => ApiVersion -> FacebookT anyAuth m () Source #

Set the Graph API version.

getApiVersion :: MonadIO m => FacebookT anyAuth m ApiVersion Source #

Get the Graph API version.

## App access token

data AppKind Source #

Phantom type used mark an `AccessToken` as an app access token.

getAppAccessToken :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => FacebookT Auth m AppAccessToken Source #

Get an app access token from Facebook using your credentials. Ref: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow

## User access token

data UserKind Source #

Phantom type used mark an `AccessToken` as an user access token.

type RedirectUrl = Text Source #

URL where the user is redirected to after Facebook authenticates the user authorizes your application. This URL should be inside the domain registered for your Facebook application.

data Permission Source #

A permission that is asked for the user when he authorizes your app. Please refer to Facebook's documentation at https://developers.facebook.com/docs/reference/api/permissions/ to see which permissions are available.

This is a `newtype` of `Text` that supports only `IsString`. This means that to create a `Permission` you should use the `OverloadedStrings` language extension. For example,

    {-# LANGUAGE OverloadedStrings #-}

    perms :: [Permission]
    perms = ["user_about_me", "email", "offline_access"]

#### Instances

Instances details

IsString Permission Source # |
Instance details Defined in Facebook.Auth Methods fromString :: String -> Permission Source #
Show Permission Source # |
Instance details Defined in Facebook.Auth Methods showsPrec :: Int -> Permission -> ShowS Source # show :: Permission -> String Source # showList :: [Permission] -> ShowS Source #
SimpleType Permission Source # | `Permission` is a `newtype` of `Text`
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Permission -> ByteString Source #
Eq Permission Source # |
Instance details Defined in Facebook.Auth Methods (==) :: Permission -> Permission -> Bool Source # (/=) :: Permission -> Permission -> Bool Source #
Ord Permission Source # |

Instance details

Defined in Facebook.Auth

Methods

compare :: Permission -> Permission -> Ordering Source #

(<) :: Permission -> Permission -> Bool Source #

(<=) :: Permission -> Permission -> Bool Source #

(>) :: Permission -> Permission -> Bool Source #

(>=) :: Permission -> Permission -> Bool Source #

max :: Permission -> Permission -> Permission Source #

min :: Permission -> Permission -> Permission Source #

getUserAccessTokenStep1 :: (Monad m, MonadIO m) => RedirectUrl -> [Permission] -> FacebookT Auth m Text Source #

The first step to get an user access token. Returns the Facebook URL you should redirect you user to. Facebook will authenticate the user, authorize your app and then redirect the user back into the provider `RedirectUrl`.

getUserAccessTokenStep2 Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) |
=> RedirectUrl | Should be exactly the same as in `getUserAccessTokenStep1`.
-> [Argument] | Query parameters.
-> FacebookT Auth m UserAccessToken |

The second step to get an user access token. If the user is successfully authenticate and they authorize your application, then they'll be redirected back to the `RedirectUrl` you've passed to `getUserAccessTokenStep1`. You should take the request query parameters passed to your `RedirectUrl` and give to this function that will complete the user authentication flow and give you an ``AccessToken``.

getUserLogoutUrl Source #

Arguments

:: Monad m |
=> UserAccessToken | The user's access token.
-> RedirectUrl | URL the user should be directed to in your site domain.
-> FacebookT Auth m Text | Logout URL in `https://www.facebook.com/` (or on `https://www.beta.facebook.com/` when using the beta tier).

The URL an user should be redirected to in order to log them out of their Facebook session. Facebook will then redirect the user to the provided URL after logging them out. Note that, at the time of this writing, Facebook's policies require you to log the user out of Facebook when they ask to log out of your site.

Note also that Facebook may refuse to redirect the user to the provided URL if their user access token is invalid. In order to prevent this bug, we suggest that you use `isValid` before redirecting the user to the URL provided by `getUserLogoutUrl` since this function doesn't do any validity checks.

extendUserAccessToken :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => UserAccessToken -> FacebookT Auth m (Either FacebookException UserAccessToken) Source #

Extend the expiration time of an user access token (see https://developers.facebook.com/docs/offline-access-deprecation/, https://developers.facebook.com/roadmap/offline-access-removal/). Only short-lived user access tokens may extended into long-lived user access tokens, you must get a new short-lived user access token if you need to extend a long-lived one. Returns `Left exc` if there is an error while extending, or `Right token` with the new user access token (which could have the same data and expiration time as before, but you can't assume this). Note that expired access tokens can't be extended, only valid tokens.

debugToken Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> AppAccessToken | Your app access token.
-> AccessTokenData | The access token you want to debug.
-> FacebookT Auth m DebugToken |

Get detailed information about an access token.

data DebugToken Source #

Detailed information about an access token (cf. `debugToken`).

Constructors

DebugToken |

Fields

- dtAppId :: Maybe Text
- dtAppName :: Maybe Text
- dtExpiresAt :: Maybe UTCTime
- dtIsValid :: Maybe Bool
- dtIssuedAt :: Maybe UTCTime
- dtScopes :: Maybe [Permission]
- dtUserId :: Maybe Id
- dtAccessToken :: Maybe UserAccessToken

#### Instances

Instances details

FromJSON DebugToken Source # | Note: this instance always sets `dtAccessToken` to `Nothing`, but `debugToken` will update this field before returning the final `DebugToken`. This is done because we need the `AccessTokenData`, which is not part of FB's response.
Instance details Defined in Facebook.Auth Methods parseJSON :: Value -> Parser DebugToken Source # parseJSONList :: Value -> Parser [DebugToken] Source #
Show DebugToken Source # |
Instance details Defined in Facebook.Auth Methods showsPrec :: Int -> DebugToken -> ShowS Source # show :: DebugToken -> String Source # showList :: [DebugToken] -> ShowS Source #
Eq DebugToken Source # |
Instance details Defined in Facebook.Auth Methods (==) :: DebugToken -> DebugToken -> Bool Source # (/=) :: DebugToken -> DebugToken -> Bool Source #
Ord DebugToken Source # |

Instance details

Defined in Facebook.Auth

Methods

compare :: DebugToken -> DebugToken -> Ordering Source #

(<) :: DebugToken -> DebugToken -> Bool Source #

(<=) :: DebugToken -> DebugToken -> Bool Source #

(>) :: DebugToken -> DebugToken -> Bool Source #

(>=) :: DebugToken -> DebugToken -> Bool Source #

max :: DebugToken -> DebugToken -> DebugToken Source #

min :: DebugToken -> DebugToken -> DebugToken Source #

## Signed requests

parseSignedRequest Source #

Arguments

:: (FromJSON a, Monad m, MonadIO m) |
=> ByteString | Encoded Facebook signed request
-> FacebookT Auth m (Maybe a) |

Parses a Facebook signed request (https://developers.facebook.com/docs/authentication/signed_request/), verifies its authencity and integrity using the HMAC and decodes its JSON object.

addAppSecretProof :: Credentials -> Maybe (AccessToken anykind) -> SimpleQuery -> SimpleQuery Source #

makeAppSecretProof Source #

Arguments

:: Credentials | App credentials
-> Maybe (AccessToken anyKind) |
-> SimpleQuery |

Make an appsecret_proof in case the given credentials access token is a user access token. See: https://developers.facebook.com/docs/graph-api/securing-requests/#appsecret_proof

# Facebook's Graph API

## User

data User Source #

A Facebook user profile (see https://developers.facebook.com/docs/reference/api/user/).

NOTE: We still don't support all fields supported by Facebook. Please fill an issue if you need access to any other fields.

Constructors

User |

Fields

- userId :: UserId
- userName :: Maybe Text
- userFirstName :: Maybe Text
- userMiddleName :: Maybe Text
- userLastName :: Maybe Text
- userGender :: Maybe Gender
- userLocale :: Maybe Text
- userUsername :: Maybe Text
- userVerified :: Maybe Bool
- userEmail :: Maybe Text
- userLocation :: Maybe Place

#### Instances

Instances details

FromJSON User Source # |
Instance details Defined in Facebook.Object.User Methods parseJSON :: Value -> Parser User Source # parseJSONList :: Value -> Parser [User] Source #
Read User Source # |
Instance details Defined in Facebook.Object.User Methods readsPrec :: Int -> ReadS User Source # readList :: ReadS [User] Source # readPrec :: ReadPrec User Source # readListPrec :: ReadPrec [User] Source #
Show User Source # |
Instance details Defined in Facebook.Object.User Methods showsPrec :: Int -> User -> ShowS Source # show :: User -> String Source # showList :: [User] -> ShowS Source #
Eq User Source # |
Instance details Defined in Facebook.Object.User Methods (==) :: User -> User -> Bool Source # (/=) :: User -> User -> Bool Source #
Ord User Source # |
Instance details Defined in Facebook.Object.User Methods compare :: User -> User -> Ordering Source # (<) :: User -> User -> Bool Source # (<=) :: User -> User -> Bool Source # (>) :: User -> User -> Bool Source # (>=) :: User -> User -> Bool Source # max :: User -> User -> User Source # min :: User -> User -> User Source #

type UserId = Id Source #

A Facebook user ID such as `1008905713901`.

data Gender Source #

An user's gender.

Constructors

Male |
Female |

#### Instances

Instances details

FromJSON Gender Source # |
Instance details Defined in Facebook.Object.User Methods parseJSON :: Value -> Parser Gender Source # parseJSONList :: Value -> Parser [Gender] Source #
ToJSON Gender Source # |
Instance details Defined in Facebook.Object.User Methods toJSON :: Gender -> Value Source # toEncoding :: Gender -> Encoding Source # toJSONList :: [Gender] -> Value Source # toEncodingList :: [Gender] -> Encoding Source #
Enum Gender Source # |

Instance details

Defined in Facebook.Object.User

Methods

succ :: Gender -> Gender Source #

pred :: Gender -> Gender Source #

toEnum :: Int -> Gender Source #

fromEnum :: Gender -> Int Source #

enumFrom :: Gender -> [Gender] Source #

enumFromThen :: Gender -> Gender -> [Gender] Source #

enumFromTo :: Gender -> Gender -> [Gender] Source #

enumFromThenTo :: Gender -> Gender -> Gender -> [Gender] Source #

Read Gender Source # |
Instance details Defined in Facebook.Object.User Methods readsPrec :: Int -> ReadS Gender Source # readList :: ReadS [Gender] Source # readPrec :: ReadPrec Gender Source # readListPrec :: ReadPrec [Gender] Source #
Show Gender Source # |
Instance details Defined in Facebook.Object.User Methods showsPrec :: Int -> Gender -> ShowS Source # show :: Gender -> String Source # showList :: [Gender] -> ShowS Source #
Eq Gender Source # |
Instance details Defined in Facebook.Object.User Methods (==) :: Gender -> Gender -> Bool Source # (/=) :: Gender -> Gender -> Bool Source #
Ord Gender Source # |
Instance details Defined in Facebook.Object.User Methods compare :: Gender -> Gender -> Ordering Source # (<) :: Gender -> Gender -> Bool Source # (<=) :: Gender -> Gender -> Bool Source # (>) :: Gender -> Gender -> Bool Source # (>=) :: Gender -> Gender -> Bool Source # max :: Gender -> Gender -> Gender Source # min :: Gender -> Gender -> Gender Source #

getUser Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> UserId | User ID or `"me"`.
-> [Argument] | Arguments to be passed to Facebook.
-> Maybe UserAccessToken | Optional user access token.
-> FacebookT anyAuth m User |

Get an user using his user ID. The user access token is optional, but when provided more information can be returned back by Facebook. The user ID may be `"me"`, in which case you must provide an user access token and information about the token's owner is given.

searchUsers :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Text -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m (Pager User) Source #

Search users by keyword.

getUserCheckins Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> UserId | User ID or `"me"`.
-> [Argument] | Arguments to be passed to Facebook.
-> UserAccessToken | User access token.
-> FacebookT anyAuth m (Pager Checkin) |

Get a list of check-ins made by a given user.

data Friend Source #

A friend connection of a `User`.

Constructors

Friend |

Fields

- friendId :: UserId
- friendName :: Text

#### Instances

Instances details

FromJSON Friend Source # |
Instance details Defined in Facebook.Object.User Methods parseJSON :: Value -> Parser Friend Source # parseJSONList :: Value -> Parser [Friend] Source #
Read Friend Source # |
Instance details Defined in Facebook.Object.User Methods readsPrec :: Int -> ReadS Friend Source # readList :: ReadS [Friend] Source # readPrec :: ReadPrec Friend Source # readListPrec :: ReadPrec [Friend] Source #
Show Friend Source # |
Instance details Defined in Facebook.Object.User Methods showsPrec :: Int -> Friend -> ShowS Source # show :: Friend -> String Source # showList :: [Friend] -> ShowS Source #
Eq Friend Source # |
Instance details Defined in Facebook.Object.User Methods (==) :: Friend -> Friend -> Bool Source # (/=) :: Friend -> Friend -> Bool Source #
Ord Friend Source # |
Instance details Defined in Facebook.Object.User Methods compare :: Friend -> Friend -> Ordering Source # (<) :: Friend -> Friend -> Bool Source # (<=) :: Friend -> Friend -> Bool Source # (>) :: Friend -> Friend -> Bool Source # (>=) :: Friend -> Friend -> Bool Source # max :: Friend -> Friend -> Friend Source # min :: Friend -> Friend -> Friend Source #

getUserFriends Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> UserId | User ID or `"me"`.
-> [Argument] | Arguments to be passed to Facebook.
-> UserAccessToken | User access token.
-> FacebookT anyAuth m (Pager Friend) |

Get the list of friends of the given user.

getUserFriendLists Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> UserId | User ID or `"me"`.
-> [Argument] | Arguments to be passed to Facebook.
-> UserAccessToken | User access token.
-> FacebookT anyAuth m (Pager FriendList) |

Get the friend lists of the given user.

## Page

data Page Source #

A Facebook page (see https://developers.facebook.com/docs/reference/api/page/).

NOTE: Does not yet support all fields. Please file an issue if you need any other fields.

Constructors

Page |

Fields

- pageId :: Id
- pageName :: Maybe Text
- pageLink :: Maybe Text
- pageCategory :: Maybe Text
- pageIsPublished :: Maybe Bool
- pageCanPost :: Maybe Bool
- pageLikes :: Maybe Integer
- pageLocation :: Maybe Location
- pagePhone :: Maybe Text
- pageCheckins :: Maybe Integer
- pagePicture :: Maybe Text
- pageWebsite :: Maybe Text
- pageTalkingAboutCount :: Maybe Integer

#### Instances

Instances details

FromJSON Page Source # |
Instance details Defined in Facebook.Object.Page Methods parseJSON :: Value -> Parser Page Source # parseJSONList :: Value -> Parser [Page] Source #
Read Page Source # |
Instance details Defined in Facebook.Object.Page Methods readsPrec :: Int -> ReadS Page Source # readList :: ReadS [Page] Source # readPrec :: ReadPrec Page Source # readListPrec :: ReadPrec [Page] Source #
Show Page Source # |
Instance details Defined in Facebook.Object.Page Methods showsPrec :: Int -> Page -> ShowS Source # show :: Page -> String Source # showList :: [Page] -> ShowS Source #
Eq Page Source # |
Instance details Defined in Facebook.Object.Page Methods (==) :: Page -> Page -> Bool Source # (/=) :: Page -> Page -> Bool Source #
Ord Page Source # |
Instance details Defined in Facebook.Object.Page Methods compare :: Page -> Page -> Ordering Source # (<) :: Page -> Page -> Bool Source # (<=) :: Page -> Page -> Bool Source # (>) :: Page -> Page -> Bool Source # (>=) :: Page -> Page -> Bool Source # max :: Page -> Page -> Page Source # min :: Page -> Page -> Page Source #

getPage Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> Id | Page ID
-> [Argument] | Arguments to be passed to Facebook
-> Maybe UserAccessToken | Optional user access token
-> FacebookT anyAuth m Page |

Get a page using its ID. The user access token is optional.

getPage_ Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> Id | Page ID
-> [Argument] | Arguments to be passed to Facebook
-> Maybe AppAccessToken | Optional user access token
-> FacebookT anyAuth m Page |

Get a page using its ID. The user access token is optional.

searchPages Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> Text | Keyword to search for
-> [Argument] | Arguments to pass to Facebook
-> Maybe UserAccessToken | Optional user access token
-> FacebookT anyAuth m (Pager Page) |

Search pages by keyword. The user access token is optional.

## Actions

data Action Source #

An action of your app. Please refer to Facebook's documentation at https://developers.facebook.com/docs/opengraph/keyconcepts/#actions-objects to see how you can create actions.

This is a `newtype` of `Text` that supports only `IsString`. This means that to create an `Action` you should use the `OverloadedStrings` language extension. For example,

    {-# LANGUAGE OverloadedStrings #-}

    foo token = do
      ...
      createAction "cook" [...] token

#### Instances

Instances details

IsString Action Source # |
Instance details Defined in Facebook.Object.Action Methods fromString :: String -> Action Source #
Read Action Source # | Since 0.7.1
Instance details Defined in Facebook.Object.Action Methods readsPrec :: Int -> ReadS Action Source # readList :: ReadS [Action] Source # readPrec :: ReadPrec Action Source # readListPrec :: ReadPrec [Action] Source #
Show Action Source # |
Instance details Defined in Facebook.Object.Action Methods showsPrec :: Int -> Action -> ShowS Source # show :: Action -> String Source # showList :: [Action] -> ShowS Source #
Eq Action Source # | Since 0.7.1
Instance details Defined in Facebook.Object.Action Methods (==) :: Action -> Action -> Bool Source # (/=) :: Action -> Action -> Bool Source #
Ord Action Source # | Since 0.7.1
Instance details Defined in Facebook.Object.Action Methods compare :: Action -> Action -> Ordering Source # (<) :: Action -> Action -> Bool Source # (<=) :: Action -> Action -> Bool Source # (>) :: Action -> Action -> Bool Source # (>=) :: Action -> Action -> Bool Source # max :: Action -> Action -> Action Source # min :: Action -> Action -> Action Source #

createAction Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) |
=> Action | Action kind to be created.
-> [Argument] | Arguments of the action.
-> Maybe AppAccessToken | Optional app access token (optional with respect to this library, since you can't make this mandatory by changing the settings of your action on Facebook).
-> UserAccessToken | Required user access token.
-> FacebookT Auth m Id |

Creates an Open Graph action on the user's timeline. Returns the `Id` of the newly created action. For example:

    now <- liftIO getCurrentTime
    createAction "cook"
                 [ "recipe" #= "http://example.com/cookie.html"
                 , "when"   #= now ]
                 token

## Checkins

data Checkin Source #

A Facebook check-in (see https://developers.facebook.com/docs/reference/api/checkin/).

NOTE: We still don't support all fields supported by Facebook. Please fill an issue if you need access to any other fields.

Constructors

Checkin |

Fields

- checkinId :: Id
- checkinFrom :: Maybe CheckinFrom
- checkinPlace :: Maybe Place
- checkinCreatedTime :: Maybe UTCTime
- checkinTags :: Maybe (Pager Tag)
- checkinMessage :: Maybe Text

#### Instances

Instances details

FromJSON Checkin Source # |
Instance details Defined in Facebook.Object.Checkin Methods parseJSON :: Value -> Parser Checkin Source # parseJSONList :: Value -> Parser [Checkin] Source #
Read Checkin Source # |
Instance details Defined in Facebook.Object.Checkin Methods readsPrec :: Int -> ReadS Checkin Source # readList :: ReadS [Checkin] Source # readPrec :: ReadPrec Checkin Source # readListPrec :: ReadPrec [Checkin] Source #
Show Checkin Source # |
Instance details Defined in Facebook.Object.Checkin Methods showsPrec :: Int -> Checkin -> ShowS Source # show :: Checkin -> String Source # showList :: [Checkin] -> ShowS Source #
Eq Checkin Source # |
Instance details Defined in Facebook.Object.Checkin Methods (==) :: Checkin -> Checkin -> Bool Source # (/=) :: Checkin -> Checkin -> Bool Source #
Ord Checkin Source # |
Instance details Defined in Facebook.Object.Checkin Methods compare :: Checkin -> Checkin -> Ordering Source # (<) :: Checkin -> Checkin -> Bool Source # (<=) :: Checkin -> Checkin -> Bool Source # (>) :: Checkin -> Checkin -> Bool Source # (>=) :: Checkin -> Checkin -> Bool Source # max :: Checkin -> Checkin -> Checkin Source # min :: Checkin -> Checkin -> Checkin Source #

data CheckinFrom Source #

Information about the user who made the check-in.

Constructors

CheckinFrom |

Fields

- checkinFromId :: UserId
- checkinFromName :: Text

#### Instances

Instances details

FromJSON CheckinFrom Source # |
Instance details Defined in Facebook.Object.Checkin Methods parseJSON :: Value -> Parser CheckinFrom Source # parseJSONList :: Value -> Parser [CheckinFrom] Source #
Read CheckinFrom Source # |
Instance details Defined in Facebook.Object.Checkin Methods readsPrec :: Int -> ReadS CheckinFrom Source # readList :: ReadS [CheckinFrom] Source # readPrec :: ReadPrec CheckinFrom Source # readListPrec :: ReadPrec [CheckinFrom] Source #
Show CheckinFrom Source # |
Instance details Defined in Facebook.Object.Checkin Methods showsPrec :: Int -> CheckinFrom -> ShowS Source # show :: CheckinFrom -> String Source # showList :: [CheckinFrom] -> ShowS Source #
Eq CheckinFrom Source # |
Instance details Defined in Facebook.Object.Checkin Methods (==) :: CheckinFrom -> CheckinFrom -> Bool Source # (/=) :: CheckinFrom -> CheckinFrom -> Bool Source #
Ord CheckinFrom Source # |

Instance details

Defined in Facebook.Object.Checkin

Methods

compare :: CheckinFrom -> CheckinFrom -> Ordering Source #

(<) :: CheckinFrom -> CheckinFrom -> Bool Source #

(<=) :: CheckinFrom -> CheckinFrom -> Bool Source #

(>) :: CheckinFrom -> CheckinFrom -> Bool Source #

(>=) :: CheckinFrom -> CheckinFrom -> Bool Source #

max :: CheckinFrom -> CheckinFrom -> CheckinFrom Source #

min :: CheckinFrom -> CheckinFrom -> CheckinFrom Source #

getCheckin Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> Id | Checkin ID.
-> [Argument] | Arguments to be passed to Facebook.
-> Maybe UserAccessToken | Optional user access token.
-> FacebookT anyAuth m Checkin |

Get a checkin from its ID. The user access token is optional, but when provided more information can be returned back by Facebook.

createCheckin Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> Id | Place ID.
-> GeoCoordinates | Coordinates.
-> [Argument] | Other arguments of the action.
-> UserAccessToken | Required user access token.
-> FacebookT Auth m Id |

Creates a 'check-in' and returns its ID. Place and coordinates are both required by Facebook.

## Order

data Order Source #

A Facebook `Order` oject.

Constructors

Order |

Fields

- orderId :: OrderId
- orderFrom :: UserId
- orderTo :: UserId
- orderAmount :: Integer
- orderStatus :: OrderStatus
- orderApplication :: OrderApplication
- orderCountry :: Text
- orderRefundCode :: Maybe Text
- orderCreatedTime :: ZonedTime
- orderUpdatedTime :: ZonedTime

#### Instances

Instances details

FromJSON Order Source # |
Instance details Defined in Facebook.Object.Order Methods parseJSON :: Value -> Parser Order Source # parseJSONList :: Value -> Parser [Order] Source #
Show Order Source # |
Instance details Defined in Facebook.Object.Order Methods showsPrec :: Int -> Order -> ShowS Source # show :: Order -> String Source # showList :: [Order] -> ShowS Source #

type OrderId = Id Source #

`Order` Id type.

data OrderApplication Source #

A trimmed down version of Facebook Application as it is used in `Order`.

#### Instances

Instances details

FromJSON OrderApplication Source # |
Instance details Defined in Facebook.Object.Order Methods parseJSON :: Value -> Parser OrderApplication Source # parseJSONList :: Value -> Parser [OrderApplication] Source #
Show OrderApplication Source # |
Instance details Defined in Facebook.Object.Order Methods showsPrec :: Int -> OrderApplication -> ShowS Source # show :: OrderApplication -> String Source # showList :: [OrderApplication] -> ShowS Source #

data OrderStatus Source #

A Facebook `Order` status type.

#### Instances

Instances details

FromJSON OrderStatus Source # |
Instance details Defined in Facebook.Object.Order Methods parseJSON :: Value -> Parser OrderStatus Source # parseJSONList :: Value -> Parser [OrderStatus] Source #
Enum OrderStatus Source # |

Instance details

Defined in Facebook.Object.Order

Methods

succ :: OrderStatus -> OrderStatus Source #

pred :: OrderStatus -> OrderStatus Source #

toEnum :: Int -> OrderStatus Source #

fromEnum :: OrderStatus -> Int Source #

enumFrom :: OrderStatus -> [OrderStatus] Source #

enumFromThen :: OrderStatus -> OrderStatus -> [OrderStatus] Source #

enumFromTo :: OrderStatus -> OrderStatus -> [OrderStatus] Source #

enumFromThenTo :: OrderStatus -> OrderStatus -> OrderStatus -> [OrderStatus] Source #

Show OrderStatus Source # |
Instance details Defined in Facebook.Object.Order Methods showsPrec :: Int -> OrderStatus -> ShowS Source # show :: OrderStatus -> String Source # showList :: [OrderStatus] -> ShowS Source #
Eq OrderStatus Source # |
Instance details Defined in Facebook.Object.Order Methods (==) :: OrderStatus -> OrderStatus -> Bool Source # (/=) :: OrderStatus -> OrderStatus -> Bool Source #

getOrder Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> OrderId | Order ID.
-> UserAccessToken | User access token.
-> FacebookT anyAuth m Order |

Get an `Order` using its `OrderId`. The user access token is mandatory.

## Friend list

data FriendList Source #

A friend list for a `User`.

Constructors

FriendList |

Fields

- friendListId :: Id
- friendListName :: Text
- friendListType :: FriendListType

#### Instances

Instances details

FromJSON FriendList Source # |
Instance details Defined in Facebook.Object.FriendList Methods parseJSON :: Value -> Parser FriendList Source # parseJSONList :: Value -> Parser [FriendList] Source #
Read FriendList Source # |
Instance details Defined in Facebook.Object.FriendList Methods readsPrec :: Int -> ReadS FriendList Source # readList :: ReadS [FriendList] Source # readPrec :: ReadPrec FriendList Source # readListPrec :: ReadPrec [FriendList] Source #
Show FriendList Source # |
Instance details Defined in Facebook.Object.FriendList Methods showsPrec :: Int -> FriendList -> ShowS Source # show :: FriendList -> String Source # showList :: [FriendList] -> ShowS Source #
Eq FriendList Source # |
Instance details Defined in Facebook.Object.FriendList Methods (==) :: FriendList -> FriendList -> Bool Source # (/=) :: FriendList -> FriendList -> Bool Source #
Ord FriendList Source # |

Instance details

Defined in Facebook.Object.FriendList

Methods

compare :: FriendList -> FriendList -> Ordering Source #

(<) :: FriendList -> FriendList -> Bool Source #

(<=) :: FriendList -> FriendList -> Bool Source #

(>) :: FriendList -> FriendList -> Bool Source #

(>=) :: FriendList -> FriendList -> Bool Source #

max :: FriendList -> FriendList -> FriendList Source #

min :: FriendList -> FriendList -> FriendList Source #

data FriendListType Source #

Constructors

CloseFriendsList |
AcquaintancesList |
RestrictedList |
UserCreatedList |
EducationList |
WorkList |
CurrentCityList |
FamilyList |

#### Instances

Instances details

FromJSON FriendListType Source # |
Instance details Defined in Facebook.Object.FriendList Methods parseJSON :: Value -> Parser FriendListType Source # parseJSONList :: Value -> Parser [FriendListType] Source #
ToJSON FriendListType Source # |
Instance details Defined in Facebook.Object.FriendList Methods toJSON :: FriendListType -> Value Source # toEncoding :: FriendListType -> Encoding Source # toJSONList :: [FriendListType] -> Value Source # toEncodingList :: [FriendListType] -> Encoding Source #
Enum FriendListType Source # |

Instance details

Defined in Facebook.Object.FriendList

Methods

succ :: FriendListType -> FriendListType Source #

pred :: FriendListType -> FriendListType Source #

toEnum :: Int -> FriendListType Source #

fromEnum :: FriendListType -> Int Source #

enumFrom :: FriendListType -> [FriendListType] Source #

enumFromThen :: FriendListType -> FriendListType -> [FriendListType] Source #

enumFromTo :: FriendListType -> FriendListType -> [FriendListType] Source #

enumFromThenTo :: FriendListType -> FriendListType -> FriendListType -> [FriendListType] Source #

Read FriendListType Source # |
Instance details Defined in Facebook.Object.FriendList Methods readsPrec :: Int -> ReadS FriendListType Source # readList :: ReadS [FriendListType] Source # readPrec :: ReadPrec FriendListType Source # readListPrec :: ReadPrec [FriendListType] Source #
Show FriendListType Source # |
Instance details Defined in Facebook.Object.FriendList Methods showsPrec :: Int -> FriendListType -> ShowS Source # show :: FriendListType -> String Source # showList :: [FriendListType] -> ShowS Source #
Eq FriendListType Source # |
Instance details Defined in Facebook.Object.FriendList Methods (==) :: FriendListType -> FriendListType -> Bool Source # (/=) :: FriendListType -> FriendListType -> Bool Source #
Ord FriendListType Source # |

Instance details

Defined in Facebook.Object.FriendList

Methods

compare :: FriendListType -> FriendListType -> Ordering Source #

(<) :: FriendListType -> FriendListType -> Bool Source #

(<=) :: FriendListType -> FriendListType -> Bool Source #

(>) :: FriendListType -> FriendListType -> Bool Source #

(>=) :: FriendListType -> FriendListType -> Bool Source #

max :: FriendListType -> FriendListType -> FriendListType Source #

min :: FriendListType -> FriendListType -> FriendListType Source #

getFriendListMembers Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> Id | List ID.
-> [Argument] | Arguments to be passed to Facebook.
-> UserAccessToken | User access token.
-> FacebookT anyAuth m (Pager Friend) |

Get the members of a friend list.

# Facebook's Graph API basic functionality

## Simple types

(#=) :: SimpleType a => ByteString -> a -> Argument Source #

Create an `Argument` with a `SimpleType`. See the docs on `createAction` for an example.

class SimpleType a where Source #

Class for data types that may be represented as a Facebook simple type. (see https://developers.facebook.com/docs/opengraph/simpletypes/).

Methods

encodeFbParam :: a -> ByteString Source #

#### Instances

Instances details

SimpleType Int16 Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Int16 -> ByteString Source #
SimpleType Int32 Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Int32 -> ByteString Source #
SimpleType Int64 Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Int64 -> ByteString Source #
SimpleType Int8 Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Int8 -> ByteString Source #
SimpleType Word16 Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Word16 -> ByteString Source #
SimpleType Word32 Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Word32 -> ByteString Source #
SimpleType Word64 Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Word64 -> ByteString Source #
SimpleType Word8 Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Word8 -> ByteString Source #
SimpleType ByteString Source # | Facebook's simple type `String`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: ByteString -> ByteString Source #
SimpleType Permission Source # | `Permission` is a `newtype` of `Text`
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Permission -> ByteString Source #
SimpleType GeoCoordinates Source # |
Instance details Defined in Facebook.Graph Methods encodeFbParam :: GeoCoordinates -> ByteString Source #
SimpleType Id Source # | An object's `Id` code.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Id -> ByteString Source #
SimpleType Text Source # | Facebook's simple type `String`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Text -> ByteString Source #
SimpleType Day Source # | Facebook's simple type `DateTime` with only the date.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Day -> ByteString Source #
SimpleType UTCTime Source # | Facebook's simple type `DateTime`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: UTCTime -> ByteString Source #
SimpleType ZonedTime Source # | Facebook's simple type `DateTime`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: ZonedTime -> ByteString Source #
SimpleType Bool Source # | Facebook's simple type `Boolean`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Bool -> ByteString Source #
SimpleType Double Source # | Facebook's simple type `Float`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Double -> ByteString Source #
SimpleType Float Source # | Facebook's simple type `Float` with less precision than supported.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Float -> ByteString Source #
SimpleType Int Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Int -> ByteString Source #
SimpleType Word Source # | Facebook's simple type `Integer`.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Word -> ByteString Source #
SimpleType a => SimpleType [a] Source # | A comma-separated list of simple types. This definition doesn't work everywhere, just for a few combinations that Facebook uses (e.g. `[Int]`). Also, encoding a list of lists is the same as encoding the concatenation of all lists. In other words, this instance is here more for your convenience than to make sure your code is correct.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: [a] -> ByteString Source #

newtype FbUTCTime Source #

`newtype` for `UTCTime` that follows Facebook's conventions of JSON parsing.

- As a string, while `aeson` expects a format of `%FT%T%Q`, Facebook gives time values formatted as `%FT%T%z`.
- As a number, `FbUTCTime` accepts a number of seconds since the Unix epoch.

Constructors

FbUTCTime |

Fields

- unFbUTCTime :: UTCTime

#### Instances

Instances details

FromJSON FbUTCTime Source # |
Instance details Defined in Facebook.Types Methods parseJSON :: Value -> Parser FbUTCTime Source # parseJSONList :: Value -> Parser [FbUTCTime] Source #
Read FbUTCTime Source # |
Instance details Defined in Facebook.Types Methods readsPrec :: Int -> ReadS FbUTCTime Source # readList :: ReadS [FbUTCTime] Source # readPrec :: ReadPrec FbUTCTime Source # readListPrec :: ReadPrec [FbUTCTime] Source #
Show FbUTCTime Source # |
Instance details Defined in Facebook.Types Methods showsPrec :: Int -> FbUTCTime -> ShowS Source # show :: FbUTCTime -> String Source # showList :: [FbUTCTime] -> ShowS Source #
Eq FbUTCTime Source # |
Instance details Defined in Facebook.Types Methods (==) :: FbUTCTime -> FbUTCTime -> Bool Source # (/=) :: FbUTCTime -> FbUTCTime -> Bool Source #
Ord FbUTCTime Source # |
Instance details Defined in Facebook.Types Methods compare :: FbUTCTime -> FbUTCTime -> Ordering Source # (<) :: FbUTCTime -> FbUTCTime -> Bool Source # (<=) :: FbUTCTime -> FbUTCTime -> Bool Source # (>) :: FbUTCTime -> FbUTCTime -> Bool Source # (>=) :: FbUTCTime -> FbUTCTime -> Bool Source # max :: FbUTCTime -> FbUTCTime -> FbUTCTime Source # min :: FbUTCTime -> FbUTCTime -> FbUTCTime Source #

## Complex types

data Place Source #

Information about a place. This is not a Graph Object, instead it's just a field of a Object. (Not to be confused with the `Page` object.)

Constructors

Place |

Fields

- placeId :: Id

  `Page` ID.

- placeName :: Maybe Text

  `Page` name.

- placeLocation :: Maybe Location

#### Instances

Instances details

FromJSON Place Source # |
Instance details Defined in Facebook.Graph Methods parseJSON :: Value -> Parser Place Source # parseJSONList :: Value -> Parser [Place] Source #
Read Place Source # |
Instance details Defined in Facebook.Graph Methods readsPrec :: Int -> ReadS Place Source # readList :: ReadS [Place] Source # readPrec :: ReadPrec Place Source # readListPrec :: ReadPrec [Place] Source #
Show Place Source # |
Instance details Defined in Facebook.Graph Methods showsPrec :: Int -> Place -> ShowS Source # show :: Place -> String Source # showList :: [Place] -> ShowS Source #
Eq Place Source # |
Instance details Defined in Facebook.Graph Methods (==) :: Place -> Place -> Bool Source # (/=) :: Place -> Place -> Bool Source #
Ord Place Source # |
Instance details Defined in Facebook.Graph Methods compare :: Place -> Place -> Ordering Source # (<) :: Place -> Place -> Bool Source # (<=) :: Place -> Place -> Bool Source # (>) :: Place -> Place -> Bool Source # (>=) :: Place -> Place -> Bool Source # max :: Place -> Place -> Place Source # min :: Place -> Place -> Place Source #

data Location Source #

A geographical location.

Constructors

Location |

Fields

- locationStreet :: Maybe Text
- locationCity :: Maybe Text
- locationState :: Maybe Text
- locationCountry :: Maybe Text
- locationZip :: Maybe Text
- locationCoords :: Maybe GeoCoordinates

#### Instances

Instances details

FromJSON Location Source # |
Instance details Defined in Facebook.Graph Methods parseJSON :: Value -> Parser Location Source # parseJSONList :: Value -> Parser [Location] Source #
Read Location Source # |
Instance details Defined in Facebook.Graph Methods readsPrec :: Int -> ReadS Location Source # readList :: ReadS [Location] Source # readPrec :: ReadPrec Location Source # readListPrec :: ReadPrec [Location] Source #
Show Location Source # |
Instance details Defined in Facebook.Graph Methods showsPrec :: Int -> Location -> ShowS Source # show :: Location -> String Source # showList :: [Location] -> ShowS Source #
Eq Location Source # |
Instance details Defined in Facebook.Graph Methods (==) :: Location -> Location -> Bool Source # (/=) :: Location -> Location -> Bool Source #
Ord Location Source # |
Instance details Defined in Facebook.Graph Methods compare :: Location -> Location -> Ordering Source # (<) :: Location -> Location -> Bool Source # (<=) :: Location -> Location -> Bool Source # (>) :: Location -> Location -> Bool Source # (>=) :: Location -> Location -> Bool Source # max :: Location -> Location -> Location Source # min :: Location -> Location -> Location Source #

data GeoCoordinates Source #

Geographical coordinates.

Constructors

GeoCoordinates |

Fields

- latitude :: !Double
- longitude :: !Double

#### Instances

Instances details

FromJSON GeoCoordinates Source # |
Instance details Defined in Facebook.Graph Methods parseJSON :: Value -> Parser GeoCoordinates Source # parseJSONList :: Value -> Parser [GeoCoordinates] Source #
Read GeoCoordinates Source # |
Instance details Defined in Facebook.Graph Methods readsPrec :: Int -> ReadS GeoCoordinates Source # readList :: ReadS [GeoCoordinates] Source # readPrec :: ReadPrec GeoCoordinates Source # readListPrec :: ReadPrec [GeoCoordinates] Source #
Show GeoCoordinates Source # |
Instance details Defined in Facebook.Graph Methods showsPrec :: Int -> GeoCoordinates -> ShowS Source # show :: GeoCoordinates -> String Source # showList :: [GeoCoordinates] -> ShowS Source #
SimpleType GeoCoordinates Source # |
Instance details Defined in Facebook.Graph Methods encodeFbParam :: GeoCoordinates -> ByteString Source #
Eq GeoCoordinates Source # |
Instance details Defined in Facebook.Graph Methods (==) :: GeoCoordinates -> GeoCoordinates -> Bool Source # (/=) :: GeoCoordinates -> GeoCoordinates -> Bool Source #
Ord GeoCoordinates Source # |

Instance details

Defined in Facebook.Graph

Methods

compare :: GeoCoordinates -> GeoCoordinates -> Ordering Source #

(<) :: GeoCoordinates -> GeoCoordinates -> Bool Source #

(<=) :: GeoCoordinates -> GeoCoordinates -> Bool Source #

(>) :: GeoCoordinates -> GeoCoordinates -> Bool Source #

(>=) :: GeoCoordinates -> GeoCoordinates -> Bool Source #

max :: GeoCoordinates -> GeoCoordinates -> GeoCoordinates Source #

min :: GeoCoordinates -> GeoCoordinates -> GeoCoordinates Source #

data Tag Source #

A tag (i.e. "I'll tag you on my post").

Constructors

Tag |

Fields

- tagId :: Id

  Who is tagged.

- tagName :: Text

  Name of the tagged person.

#### Instances

Instances details

FromJSON Tag Source # |
Instance details Defined in Facebook.Graph Methods parseJSON :: Value -> Parser Tag Source # parseJSONList :: Value -> Parser [Tag] Source #
Read Tag Source # |
Instance details Defined in Facebook.Graph Methods readsPrec :: Int -> ReadS Tag Source # readList :: ReadS [Tag] Source # readPrec :: ReadPrec Tag Source # readListPrec :: ReadPrec [Tag] Source #
Show Tag Source # |
Instance details Defined in Facebook.Graph Methods showsPrec :: Int -> Tag -> ShowS Source # show :: Tag -> String Source # showList :: [Tag] -> ShowS Source #
Eq Tag Source # |
Instance details Defined in Facebook.Graph Methods (==) :: Tag -> Tag -> Bool Source # (/=) :: Tag -> Tag -> Bool Source #
Ord Tag Source # |
Instance details Defined in Facebook.Graph Methods compare :: Tag -> Tag -> Ordering Source # (<) :: Tag -> Tag -> Bool Source # (<=) :: Tag -> Tag -> Bool Source # (>) :: Tag -> Tag -> Bool Source # (>=) :: Tag -> Tag -> Bool Source # max :: Tag -> Tag -> Tag Source # min :: Tag -> Tag -> Tag Source #

## Pagination

data Pager a Source #

Many Graph API results are returned as a JSON object with the following structure:

    {
      "data": [
        ...item 1...,
             :
        ...item n...
      ],
      "paging": {
        "previous": "http://...link to previous page...",
        "next":     "http://...link to next page..."
      }
    }

Only the `"data"` field is required, the others may or may not appear.

A `Pager a` datatype encodes such result where each item has type `a`. You may use functions `fetchNextPage` and `fetchPreviousPage` to navigate through the results.

Constructors

Pager |

Fields

- pagerData :: [a]
- pagerPrevious :: Maybe String
- pagerNext :: Maybe String

#### Instances

Instances details

FromJSON a => FromJSON (Pager a) Source # |
Instance details Defined in Facebook.Pager Methods parseJSON :: Value -> Parser (Pager a) Source # parseJSONList :: Value -> Parser [Pager a] Source #
Read a => Read (Pager a) Source # |
Instance details Defined in Facebook.Pager Methods readsPrec :: Int -> ReadS (Pager a) Source # readList :: ReadS [Pager a] Source # readPrec :: ReadPrec (Pager a) Source # readListPrec :: ReadPrec [Pager a] Source #
Show a => Show (Pager a) Source # |
Instance details Defined in Facebook.Pager Methods showsPrec :: Int -> Pager a -> ShowS Source # show :: Pager a -> String Source # showList :: [Pager a] -> ShowS Source #
Eq a => Eq (Pager a) Source # |
Instance details Defined in Facebook.Pager Methods (==) :: Pager a -> Pager a -> Bool Source # (/=) :: Pager a -> Pager a -> Bool Source #
Ord a => Ord (Pager a) Source # |
Instance details Defined in Facebook.Pager Methods compare :: Pager a -> Pager a -> Ordering Source # (<) :: Pager a -> Pager a -> Bool Source # (<=) :: Pager a -> Pager a -> Bool Source # (>) :: Pager a -> Pager a -> Bool Source # (>=) :: Pager a -> Pager a -> Bool Source # max :: Pager a -> Pager a -> Pager a Source # min :: Pager a -> Pager a -> Pager a Source #

fetchNextPage :: (MonadResource m, FromJSON a, MonadThrow m, MonadUnliftIO m) => Pager a -> FacebookT anyAuth m (Maybe (Pager a)) Source #

Tries to fetch the next page of a `Pager`. Returns `Nothing` whenever the current `Pager` does not have a `pagerNext`.

fetchPreviousPage :: (MonadResource m, FromJSON a, MonadThrow m, MonadUnliftIO m) => Pager a -> FacebookT anyAuth m (Maybe (Pager a)) Source #

Tries to fetch the previous page of a `Pager`. Returns `Nothing` whenever the current `Pager` does not have a `pagerPrevious`.

fetchAllNextPages :: (Monad m, FromJSON a, MonadUnliftIO n, MonadThrow n) => Pager a -> FacebookT anyAuth m (ConduitT () a n ()) Source #

Tries to fetch all next pages and returns a `Source` with all results. The `Source` will include the results from this page as well. Previous pages will not be considered. Next pages will be fetched on-demand.

fetchAllPreviousPages :: (Monad m, FromJSON a, MonadUnliftIO n, MonadThrow n) => Pager a -> FacebookT anyAuth m (ConduitT () a n ()) Source #

Tries to fetch all previous pages and returns a `Source` with all results. The `Source` will include the results from this page as well. Next pages will not be considered. Previous pages will be fetched on-demand.

# Real-time update notifications

## Subscriptions

modifySubscription Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> RealTimeUpdateObject | Type of objects whose subscription you and to add or modify.
-> [RealTimeUpdateField] | Fields that you are interested in receiving updates.
-> RealTimeUpdateUrl | Your callback URL.
-> RealTimeUpdateToken | A verification token.
-> AppAccessToken | Access token for your app.
-> FacebookT Auth m () |

Add or modify a subscription for real-time updates. If there were no previous subscriptions for the given `RealTimeUpdateObject`, then a new subscription is created. If there was any previous subscription for the given `RealTimeUpdateObject`, it's overriden by this one (even if the other subscription had a different callback URL).

listSubscriptions :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => AppAccessToken -> FacebookT Auth m [RealTimeUpdateSubscription] Source #

List current real-time update subscriptions.

data RealTimeUpdateObject Source #

The type of objects that a real-time update refers to.

Constructors

UserRTUO |
PermissionsRTUO |
PageRTUO |
ErrorsRTUO |
OtherRTUO Text |

#### Instances

Instances details

FromJSON RealTimeUpdateObject Source # |
Instance details Defined in Facebook.RealTime Methods parseJSON :: Value -> Parser RealTimeUpdateObject Source # parseJSONList :: Value -> Parser [RealTimeUpdateObject] Source #
ToJSON RealTimeUpdateObject Source # |
Instance details Defined in Facebook.RealTime Methods toJSON :: RealTimeUpdateObject -> Value Source # toEncoding :: RealTimeUpdateObject -> Encoding Source # toJSONList :: [RealTimeUpdateObject] -> Value Source # toEncodingList :: [RealTimeUpdateObject] -> Encoding Source #
Show RealTimeUpdateObject Source # |
Instance details Defined in Facebook.RealTime Methods showsPrec :: Int -> RealTimeUpdateObject -> ShowS Source # show :: RealTimeUpdateObject -> String Source # showList :: [RealTimeUpdateObject] -> ShowS Source #
Eq RealTimeUpdateObject Source # |
Instance details Defined in Facebook.RealTime Methods (==) :: RealTimeUpdateObject -> RealTimeUpdateObject -> Bool Source # (/=) :: RealTimeUpdateObject -> RealTimeUpdateObject -> Bool Source #
Ord RealTimeUpdateObject Source # |

Instance details

Defined in Facebook.RealTime

Methods

compare :: RealTimeUpdateObject -> RealTimeUpdateObject -> Ordering Source #

(<) :: RealTimeUpdateObject -> RealTimeUpdateObject -> Bool Source #

(<=) :: RealTimeUpdateObject -> RealTimeUpdateObject -> Bool Source #

(>) :: RealTimeUpdateObject -> RealTimeUpdateObject -> Bool Source #

(>=) :: RealTimeUpdateObject -> RealTimeUpdateObject -> Bool Source #

max :: RealTimeUpdateObject -> RealTimeUpdateObject -> RealTimeUpdateObject Source #

min :: RealTimeUpdateObject -> RealTimeUpdateObject -> RealTimeUpdateObject Source #

type RealTimeUpdateField = ByteString Source #

A field of a `RealTimeUpdateObject` that you would like to receive notifications when changed.

type RealTimeUpdateUrl = Text Source #

The URL on your server that will receive the real-time updates. Please refer to Facebook's documentation in order to see what this URL needs to implement.

type RealTimeUpdateToken = ByteString Source #

A token that is sent back by Facebook's servers to your server in order to verify that you really were trying to modify your subscription.

data RealTimeUpdateSubscription Source #

Information returned by Facebook about a real-time update notification subscription.

Constructors

RealTimeUpdateSubscription |

Fields

- rtusObject :: RealTimeUpdateObject
- rtusCallbackUrl :: RealTimeUpdateUrl
- rtusFields :: [RealTimeUpdateField]
- rtusActive :: Bool

#### Instances

Instances details

FromJSON RealTimeUpdateSubscription Source # |
Instance details Defined in Facebook.RealTime Methods parseJSON :: Value -> Parser RealTimeUpdateSubscription Source # parseJSONList :: Value -> Parser [RealTimeUpdateSubscription] Source #
Show RealTimeUpdateSubscription Source # |
Instance details Defined in Facebook.RealTime Methods showsPrec :: Int -> RealTimeUpdateSubscription -> ShowS Source # show :: RealTimeUpdateSubscription -> String Source # showList :: [RealTimeUpdateSubscription] -> ShowS Source #
Eq RealTimeUpdateSubscription Source # |
Instance details Defined in Facebook.RealTime Methods (==) :: RealTimeUpdateSubscription -> RealTimeUpdateSubscription -> Bool Source # (/=) :: RealTimeUpdateSubscription -> RealTimeUpdateSubscription -> Bool Source #
Ord RealTimeUpdateSubscription Source # |

Instance details

Defined in Facebook.RealTime

Methods

compare :: RealTimeUpdateSubscription -> RealTimeUpdateSubscription -> Ordering Source #

(<) :: RealTimeUpdateSubscription -> RealTimeUpdateSubscription -> Bool Source #

(<=) :: RealTimeUpdateSubscription -> RealTimeUpdateSubscription -> Bool Source #

(>) :: RealTimeUpdateSubscription -> RealTimeUpdateSubscription -> Bool Source #

(>=) :: RealTimeUpdateSubscription -> RealTimeUpdateSubscription -> Bool Source #

max :: RealTimeUpdateSubscription -> RealTimeUpdateSubscription -> RealTimeUpdateSubscription Source #

min :: RealTimeUpdateSubscription -> RealTimeUpdateSubscription -> RealTimeUpdateSubscription Source #

## Notifications

verifyRealTimeUpdateNotifications Source #

Arguments

:: (Monad m, MonadIO m) |
=> ByteString | `X-Hub-Signature` HTTP header's value.
-> ByteString | Request body with JSON-encoded notifications.
-> FacebookT Auth m (Maybe ByteString) |

Verifi(es the input's authenticity (i.e. it comes from, MonadIO m) Facebook) and integrity by calculating its HMAC-SHA1 (using your application secret as the key) and verifying that it matches the value from the HTTP request's `X-Hub-Signature` header's value. If it's not valid, `Nothing` is returned, otherwise `Just data` is returned where `data` is the original data.

getRealTimeUpdateNotifications Source #

Arguments

:: (Monad m, FromJSON a, MonadIO m) |
=> ByteString | `X-Hub-Signature` HTTP header's value.
-> ByteString | Request body with JSON-encoded notifications.
-> FacebookT Auth m (Maybe (RealTimeUpdateNotification a)) |

Same as `verifyRealTimeUpdateNotifications` but also parses the response as JSON. Returns `Nothing` if either the signature is invalid or the data can't be parsed (use `verifyRealTimeUpdateNotifications` if you need to distinguish between these two error conditions).

data RealTimeUpdateNotification a Source #

When data changes and there's a valid subscription, Facebook will `POST` to your `RealTimeUpdateUrl` with a JSON-encoded object containing the notifications. A 'RealTimeUpdateNotification a' represents such object where `a` is type of the entries (e.g., `RealTimeUpdateNotificationUserEntry`).

If you have a single `RealTimeUpdateUrl` for different kinds of notifications, you may parse a `RealTimeUpdateNotification `Value`` and then manually parse the `Value` depending on the value of `rtunObject`.

We recommend using `getRealTimeUpdateNotifications`.

Constructors

RealTimeUpdateNotification |

Fields

- rtunObject :: RealTimeUpdateObject
- rtunEntries :: [a]

#### Instances

Instances details

FromJSON a => FromJSON (RealTimeUpdateNotification a) Source # |
Instance details Defined in Facebook.RealTime Methods parseJSON :: Value -> Parser (RealTimeUpdateNotification a) Source # parseJSONList :: Value -> Parser [RealTimeUpdateNotification a] Source #
Show a => Show (RealTimeUpdateNotification a) Source # |
Instance details Defined in Facebook.RealTime Methods showsPrec :: Int -> RealTimeUpdateNotification a -> ShowS Source # show :: RealTimeUpdateNotification a -> String Source # showList :: [RealTimeUpdateNotification a] -> ShowS Source #
Eq a => Eq (RealTimeUpdateNotification a) Source # |
Instance details Defined in Facebook.RealTime Methods (==) :: RealTimeUpdateNotification a -> RealTimeUpdateNotification a -> Bool Source # (/=) :: RealTimeUpdateNotification a -> RealTimeUpdateNotification a -> Bool Source #
Ord a => Ord (RealTimeUpdateNotification a) Source # |

Instance details

Defined in Facebook.RealTime

Methods

compare :: RealTimeUpdateNotification a -> RealTimeUpdateNotification a -> Ordering Source #

(<) :: RealTimeUpdateNotification a -> RealTimeUpdateNotification a -> Bool Source #

(<=) :: RealTimeUpdateNotification a -> RealTimeUpdateNotification a -> Bool Source #

(>) :: RealTimeUpdateNotification a -> RealTimeUpdateNotification a -> Bool Source #

(>=) :: RealTimeUpdateNotification a -> RealTimeUpdateNotification a -> Bool Source #

max :: RealTimeUpdateNotification a -> RealTimeUpdateNotification a -> RealTimeUpdateNotification a Source #

min :: RealTimeUpdateNotification a -> RealTimeUpdateNotification a -> RealTimeUpdateNotification a Source #

data RealTimeUpdateNotificationUserEntry Source #

A notification for the `UserRTUO` object.

Constructors

RealTimeUpdateNotificationUserEntry |

Fields

- rtuneUserId :: Id
- rtuneChangedFields :: [RealTimeUpdateField]
- rtuneTime :: Integer

#### Instances

Instances details

FromJSON RealTimeUpdateNotificationUserEntry Source # |
Instance details Defined in Facebook.RealTime Methods parseJSON :: Value -> Parser RealTimeUpdateNotificationUserEntry Source # parseJSONList :: Value -> Parser [RealTimeUpdateNotificationUserEntry] Source #
Show RealTimeUpdateNotificationUserEntry Source # |
Instance details Defined in Facebook.RealTime Methods showsPrec :: Int -> RealTimeUpdateNotificationUserEntry -> ShowS Source # show :: RealTimeUpdateNotificationUserEntry -> String Source # showList :: [RealTimeUpdateNotificationUserEntry] -> ShowS Source #
Eq RealTimeUpdateNotificationUserEntry Source # |
Instance details Defined in Facebook.RealTime Methods (==) :: RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry -> Bool Source # (/=) :: RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry -> Bool Source #
Ord RealTimeUpdateNotificationUserEntry Source # |

Instance details

Defined in Facebook.RealTime

Methods

compare :: RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry -> Ordering Source #

(<) :: RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry -> Bool Source #

(<=) :: RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry -> Bool Source #

(>) :: RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry -> Bool Source #

(>=) :: RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry -> Bool Source #

max :: RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry Source #

min :: RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry -> RealTimeUpdateNotificationUserEntry Source #

# FQL

fqlQuery Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) |
=> Text | FQL Query
-> Maybe (AccessToken anyKind) | Optional access token
-> FacebookT anyAuth m (Pager a) |

Query the Facebook Graph using FQL.

newtype FQLTime Source #

Deprecated: Deprecated since fb 0.14.7, please use FbUTCTime instead.

`newtype` wrapper around `UTCTime` that is able to parse FQL's time representation as seconds since the Unix epoch.

Constructors

FQLTime | Deprecated: Deprecated since fb 0.14.7, please use FbUTCTime instead.

Fields

- unFQLTime :: UTCTime

#### Instances

Instances details

FromJSON FQLTime Source # |
Instance details Defined in Facebook.FQL Methods parseJSON :: Value -> Parser FQLTime Source # parseJSONList :: Value -> Parser [FQLTime] Source #
Show FQLTime Source # |
Instance details Defined in Facebook.FQL Methods showsPrec :: Int -> FQLTime -> ShowS Source # show :: FQLTime -> String Source # showList :: [FQLTime] -> ShowS Source #
Eq FQLTime Source # |
Instance details Defined in Facebook.FQL Methods (==) :: FQLTime -> FQLTime -> Bool Source # (/=) :: FQLTime -> FQLTime -> Bool Source #
Ord FQLTime Source # |
Instance details Defined in Facebook.FQL Methods compare :: FQLTime -> FQLTime -> Ordering Source # (<) :: FQLTime -> FQLTime -> Bool Source # (<=) :: FQLTime -> FQLTime -> Bool Source # (>) :: FQLTime -> FQLTime -> Bool Source # (>=) :: FQLTime -> FQLTime -> Bool Source # max :: FQLTime -> FQLTime -> FQLTime Source # min :: FQLTime -> FQLTime -> FQLTime Source #

newtype FQLList a Source #

`newtype` wrapper around lists that works around FQL's strange lists.

For example, if you fetch the `tagged_uids` field from `location_post`, you'll find that Facebook's FQL represents an empty list of tagged UIDs as plain JSON array (`[]`). However, it represents a singleton list as an object `{"1234": 1234}` instead of the much more correct `[1234]`.

On the other hand, not all FQL arrays are represented in this bogus manner. Also, some so-called arrays by FQL's documentation are actually objects, see `FQLObject`.

Constructors

FQLList |

Fields

- unFQLList :: [a]

#### Instances

Instances details

FromJSON a => FromJSON (FQLList a) Source # |
Instance details Defined in Facebook.FQL Methods parseJSON :: Value -> Parser (FQLList a) Source # parseJSONList :: Value -> Parser [FQLList a] Source #
Show a => Show (FQLList a) Source # |
Instance details Defined in Facebook.FQL Methods showsPrec :: Int -> FQLList a -> ShowS Source # show :: FQLList a -> String Source # showList :: [FQLList a] -> ShowS Source #
Eq a => Eq (FQLList a) Source # |
Instance details Defined in Facebook.FQL Methods (==) :: FQLList a -> FQLList a -> Bool Source # (/=) :: FQLList a -> FQLList a -> Bool Source #
Ord a => Ord (FQLList a) Source # |
Instance details Defined in Facebook.FQL Methods compare :: FQLList a -> FQLList a -> Ordering Source # (<) :: FQLList a -> FQLList a -> Bool Source # (<=) :: FQLList a -> FQLList a -> Bool Source # (>) :: FQLList a -> FQLList a -> Bool Source # (>=) :: FQLList a -> FQLList a -> Bool Source # max :: FQLList a -> FQLList a -> FQLList a Source # min :: FQLList a -> FQLList a -> FQLList a Source #

newtype FQLObject a Source #

`newtype` wrapper around any object that works around FQL's strange objects.

For example, if you fetch the `app_data` field from `stream`, you'll find that empty objects are actually represented as empty lists `[]` instead of a proper empty object `{}`. Also note that FQL's documentation says that `app_data` is an array, which it clear is not. See also `FQLList`.

Constructors

FQLObject |

Fields

- unFQLObject :: a

#### Instances

Instances details

FromJSON a => FromJSON (FQLObject a) Source # |
Instance details Defined in Facebook.FQL Methods parseJSON :: Value -> Parser (FQLObject a) Source # parseJSONList :: Value -> Parser [FQLObject a] Source #
Show a => Show (FQLObject a) Source # |
Instance details Defined in Facebook.FQL Methods showsPrec :: Int -> FQLObject a -> ShowS Source # show :: FQLObject a -> String Source # showList :: [FQLObject a] -> ShowS Source #
Eq a => Eq (FQLObject a) Source # |
Instance details Defined in Facebook.FQL Methods (==) :: FQLObject a -> FQLObject a -> Bool Source # (/=) :: FQLObject a -> FQLObject a -> Bool Source #
Ord a => Ord (FQLObject a) Source # |

Instance details

Defined in Facebook.FQL

Methods

compare :: FQLObject a -> FQLObject a -> Ordering Source #

(<) :: FQLObject a -> FQLObject a -> Bool Source #

(<=) :: FQLObject a -> FQLObject a -> Bool Source #

(>) :: FQLObject a -> FQLObject a -> Bool Source #

(>=) :: FQLObject a -> FQLObject a -> Bool Source #

max :: FQLObject a -> FQLObject a -> FQLObject a Source #

min :: FQLObject a -> FQLObject a -> FQLObject a Source #

# Test User API

getTestUsers Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) |
=> AppAccessToken | Access token for your app.
-> FacebookT Auth m (Pager TestUser) |

Get a list of test users.

disassociateTestuser :: (MonadUnliftIO m, MonadThrow m, MonadResource m, MonadIO m) => TestUser -> AppAccessToken -> FacebookT Auth m Bool Source #

removeTestUser Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m) |
=> TestUser | The TestUser to be removed.
-> AppAccessToken | Access token for your app (ignored since fb 0.14.7).
-> FacebookT Auth m Bool |

Remove an existing test user.

createTestUser Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) |
=> CreateTestUser | How the test user should be created.
-> AppAccessToken | Access token for your app.
-> FacebookT Auth m TestUser |

Create a new test user. Ref: https://developers.facebook.com/docs/graph-api/reference/v2.8/app/accounts/test-users#publish

makeFriendConn :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => TestUser -> TestUser -> FacebookT Auth m () Source #

Make a friend connection between two test users.

This is how Facebook's API work: two calls must be made. The first call has the format: "/userA_id/friends/userB_id" with the access token of user A as query parameter. The second call has the format: "/userB_id/friends/userA_id" with the access token of user B as query parameter. The first call creates a friend request and the second call accepts the friend request.

incompleteTestUserAccessToken :: TestUser -> Maybe UserAccessToken Source #

Create an `AccessToken` from a `TestUser`. It's incomplete because it will not have the right expiration time.

data TestUser Source #

A Facebook test user. Ref: https://developers.facebook.com/docs/graph-api/reference/v2.8/app/accounts/test-users

Constructors

TestUser |

Fields

- tuId :: UserId
- tuAccessToken :: Maybe AccessTokenData
- tuLoginUrl :: Maybe Text
- tuEmail :: Maybe Text
- tuPassword :: Maybe Text

#### Instances

Instances details

FromJSON TestUser Source # |
Instance details Defined in Facebook.TestUsers Methods parseJSON :: Value -> Parser TestUser Source # parseJSONList :: Value -> Parser [TestUser] Source #
Read TestUser Source # |
Instance details Defined in Facebook.TestUsers Methods readsPrec :: Int -> ReadS TestUser Source # readList :: ReadS [TestUser] Source # readPrec :: ReadPrec TestUser Source # readListPrec :: ReadPrec [TestUser] Source #
Show TestUser Source # |
Instance details Defined in Facebook.TestUsers Methods showsPrec :: Int -> TestUser -> ShowS Source # show :: TestUser -> String Source # showList :: [TestUser] -> ShowS Source #
Eq TestUser Source # |
Instance details Defined in Facebook.TestUsers Methods (==) :: TestUser -> TestUser -> Bool Source # (/=) :: TestUser -> TestUser -> Bool Source #
Ord TestUser Source # |
Instance details Defined in Facebook.TestUsers Methods compare :: TestUser -> TestUser -> Ordering Source # (<) :: TestUser -> TestUser -> Bool Source # (<=) :: TestUser -> TestUser -> Bool Source # (>) :: TestUser -> TestUser -> Bool Source # (>=) :: TestUser -> TestUser -> Bool Source # max :: TestUser -> TestUser -> TestUser Source # min :: TestUser -> TestUser -> TestUser Source #

data CreateTestUser Source #

Data type used to hold information of a new test user. This type also accepts a Data.Default value.

Constructors

CreateTestUser |

Fields

- ctuInstalled :: CreateTestUserInstalled
- ctuName :: Maybe Text
- ctuLocale :: Maybe Text

#### Instances

Instances details

Default CreateTestUser Source # | Default instance for `CreateTestUser`.
Instance details Defined in Facebook.TestUsers Methods def :: CreateTestUser #

data CreateTestUserInstalled Source #

Specify if the app is to be installed on the new test user. If it is, then you must tell what permissions should be given.

Constructors

CreateTestUserNotInstalled |
CreateTestUserInstalled |

Fields

- ctuiPermissions :: [Permission]

CreateTestUserFbDefault | Uses Facebook's default. It seems that this is equivalent to

#### Instances

Instances details

Default CreateTestUserInstalled Source # | Default instance for `CreateTestUserInstalled`.
Instance details Defined in Facebook.TestUsers Methods def :: CreateTestUserInstalled #

# Raw access to the Graph API

getObject Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) |
=> Text | Path (should begin with a slash `/`)
-> [Argument] | Arguments to be passed to Facebook
-> Maybe (AccessToken anyKind) | Optional access token
-> FacebookT anyAuth m a |

Make a raw `GET` request to Facebook's Graph API.

postObject Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) |
=> Text | Path (should begin with a slash `/`)
-> [Argument] | Arguments to be passed to Facebook
-> AccessToken anyKind | Access token
-> FacebookT Auth m a |

Make a raw `POST` request to Facebook's Graph API.

deleteObject Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) |
=> Text | Path (should begin with a slash `/`)
-> [Argument] | Arguments to be passed to Facebook
-> AccessToken anyKind | Access token
-> FacebookT Auth m a |

Make a raw `DELETE` request to Facebook's Graph API.

searchObjects Source #

Arguments

:: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) |
=> Text | A Facebook object type to search for
-> Text | The keyword to search for
-> [Argument] | Additional arguments to pass
-> Maybe UserAccessToken | Optional access token
-> FacebookT anyAuth m (Pager a) |

Make a raw `GET` request to the /search endpoint of Facebook’s Graph API. Returns a raw JSON `Value`.

newtype Id Source #

The identification code of an object.

Constructors

Id |

Fields

- idCode :: Text

#### Instances

Instances details

FromJSON Id Source # |
Instance details Defined in Facebook.Types Methods parseJSON :: Value -> Parser Id Source # parseJSONList :: Value -> Parser [Id] Source #
ToJSON Id Source # |
Instance details Defined in Facebook.Types Methods toJSON :: Id -> Value Source # toEncoding :: Id -> Encoding Source # toJSONList :: [Id] -> Value Source # toEncodingList :: [Id] -> Encoding Source #
IsString Id Source # |
Instance details Defined in Facebook.Types Methods fromString :: String -> Id Source #
Read Id Source # |
Instance details Defined in Facebook.Types Methods readsPrec :: Int -> ReadS Id Source # readList :: ReadS [Id] Source # readPrec :: ReadPrec Id Source # readListPrec :: ReadPrec [Id] Source #
Show Id Source # |
Instance details Defined in Facebook.Types Methods showsPrec :: Int -> Id -> ShowS Source # show :: Id -> String Source # showList :: [Id] -> ShowS Source #
SimpleType Id Source # | An object's `Id` code.
Instance details Defined in Facebook.Graph Methods encodeFbParam :: Id -> ByteString Source #
Eq Id Source # |
Instance details Defined in Facebook.Types Methods (==) :: Id -> Id -> Bool Source # (/=) :: Id -> Id -> Bool Source #
Ord Id Source # |
Instance details Defined in Facebook.Types Methods compare :: Id -> Id -> Ordering Source # (<) :: Id -> Id -> Bool Source # (<=) :: Id -> Id -> Bool Source # (>) :: Id -> Id -> Bool Source # (>=) :: Id -> Id -> Bool Source # max :: Id -> Id -> Id Source # min :: Id -> Id -> Id Source #

type Argument = (ByteString, ByteString) Source #

An argument given to an API call.

# Exceptions

data FacebookException Source #

An exception that may be thrown by functions on this package. Includes any information provided by Facebook.

Constructors

FacebookException | An exception coming from Facebook.

Fields

- fbeType :: Text
- fbeMessage :: Text

FbLibraryException | An exception coming from the `fb` package's code.

Fields

- fbeMessage :: Text

#### Instances

Instances details

FromJSON FacebookException Source # |
Instance details Defined in Facebook.Types Methods parseJSON :: Value -> Parser FacebookException Source # parseJSONList :: Value -> Parser [FacebookException] Source #
Exception FacebookException Source # |
Instance details Defined in Facebook.Types Methods toException :: FacebookException -> SomeException Source # fromException :: SomeException -> Maybe FacebookException Source # displayException :: FacebookException -> String Source #
Read FacebookException Source # |
Instance details Defined in Facebook.Types Methods readsPrec :: Int -> ReadS FacebookException Source # readList :: ReadS [FacebookException] Source # readPrec :: ReadPrec FacebookException Source # readListPrec :: ReadPrec [FacebookException] Source #
Show FacebookException Source # |
Instance details Defined in Facebook.Types Methods showsPrec :: Int -> FacebookException -> ShowS Source # show :: FacebookException -> String Source # showList :: [FacebookException] -> ShowS Source #
Eq FacebookException Source # |
Instance details Defined in Facebook.Types Methods (==) :: FacebookException -> FacebookException -> Bool Source # (/=) :: FacebookException -> FacebookException -> Bool Source #
Ord FacebookException Source # |

Instance details

Defined in Facebook.Types

Methods

compare :: FacebookException -> FacebookException -> Ordering Source #

(<) :: FacebookException -> FacebookException -> Bool Source #

(<=) :: FacebookException -> FacebookException -> Bool Source #

(>) :: FacebookException -> FacebookException -> Bool Source #

(>=) :: FacebookException -> FacebookException -> Bool Source #

max :: FacebookException -> FacebookException -> FacebookException Source #

min :: FacebookException -> FacebookException -> FacebookException Source #

# Internal functions

unPermission :: Permission -> Text Source #

Retrieves the `Text` back from a `Permission`. Most of the time you won't need to use this function, but you may need it if you're a library author.