https://github.com/idkjs/react-native-intercom
https://github.com/idkjs/react-native-intercom
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/idkjs/react-native-intercom
- Owner: idkjs
- License: mit
- Created: 2020-08-26T21:00:38.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-27T14:18:00.000Z (over 3 years ago)
- Last Synced: 2025-02-04T17:15:20.505Z (5 months ago)
- Language: Reason
- Size: 85.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# `@reason-react-native/react-native-intercom`
[](https://github.com/reason-react-native/intercom/actions)
[](https://www.npmjs.com/@reason-react-native/react-native-intercom)
[](https://reason-react-native.github.io/discord/)[ReasonML](https://reasonml.github.io) /
[BuckleScript](https://bucklescript.github.io) bindings for
[`tinycreative/react-native-intercom`](https://github.com/tinycreative/react-native-intercom).Exposed as `ReactNativeIntercom` module.
`@reason-react-native/react-native-intercom` X.y._ means it's compatible with
`tinycreative/react-native-intercom` X.y._## Installation
When
[`tinycreative/react-native-intercom`](https://github.com/tinycreative/react-native-intercom)
is properly installed & configured by following their installation instructions,
you can install the bindings:```console
npm install @reason-react-native/react-native-intercom
# or
yarn add @reason-react-native/react-native-intercom
````@reason-react-native/react-native-intercom` should be added to
`bs-dependencies` in your `bsconfig.json`. Something like```diff
{
//...
"bs-dependencies": [
"reason-react",
"reason-react-native",
// ...
+ "@reason-react-native/react-native-intercom"
],
//...
}
```## Usage
### Types
#### `ReactNativeIntercom.t`
...
### Methods
#### `ReactNativeIntercom.registerIdentifiedUser`
```reason
let email = "[email protected]"
registerIdentifiedUser({"email": email);
```### Example
```reason
[@react.component]
let make = () => {let (unread, setUnread) = React.useState(() => 0);
React.useEffect0(() => {
let onUnreadChange = count => setUnread(_ => count);
Intercom.addEventListener(
Intercom.Notifications.unreadCount,
onUnreadChange,
);
Some(
() =>
Intercom.removeEventListener(
Intercom.Notifications.unreadCount,
onUnreadChange,
),
);
});
```---
## Changelog
Check the [changelog](./CHANGELOG.md) for more informations about recent
releases.---
## Contribute
Read the
[contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md)
before contributing.## Code of Conduct
We want this community to be friendly and respectful to each other. Please read
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
so that you can understand what actions will and will not be tolerated.