# react-native-anymo

> A React Native library for Anymo

Latest version **0.1.5** (published 2021-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-anymo
pnpm add react-native-anymo
yarn add react-native-anymo
bun add react-native-anymo
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2021-09-13 |
| First published | 2021-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 168.8 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | Anymo |
| Maintainers | monaru |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-anymo
- Repository: https://github.com/monaru-inc/react-native-anymo
- Homepage: https://github.com/monaru-inc/react-native-anymo#readme
- Issues: https://github.com/monaru-inc/react-native-anymo/issues
- npm.io page: https://npm.io/package/react-native-anymo

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [axios-case-converter](https://npm.io/package/axios-case-converter.md) ^0.8.1
- [react-native-scalable-image](https://npm.io/package/react-native-scalable-image.md) ^1.1.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.5 (latest) — 2021-09-13
- 0.1.4 — 2021-09-07
- 0.1.3 — 2021-09-03
- 0.1.2 — 2021-08-31
- 0.1.1 — 2021-08-23

## README

# react-native-anymo

A React Native library for Anymo

## Installation

```sh
// npm
npm install react-native-anymo

// yarn
yarn add react-native-anymo
```

## Usage

Register your app as early as possible within your app. This will usually be in your `App.js` file.

```js
// App.js

import { AnymoProvider } from 'react-native-anymo';

export default function App() {
  return <AnymoProvider apiKey={'<API Key>'}>...</AnymoProvider>;
}
```

Use the prebuild components to insert the `AnymoBanner` component.

```js
// HomeScreen.js

import { AnymoBanner } from 'react-native-anymo';

return (
  <View>
    <AnymoBanner />
    <FeedContent>
  </View>
);
```

If you would like to use a custom opener the lower level `AnymoOpener` component is available. It provides an `openerContext` which has `title`, `subtitle` and `thumbnailUrl` properties to construct the desired UI, as well as an `onPress` function which will open the Anymo Screen when called.

```js
// HomeScreen.js

import { AnymoOpener } from 'react-native-anymo';

return (
  <View>
    <AnymoOpener>
      {({ openerContext, onPress }) => (
        <TouchableOpacity onPress={onPress} style={styles.openerItem}>
          <Image source={{ uri: openerContext.thumbnailUrl }}>
          <View>
            <Text>{openerContext.title}</Text>
            <Text>{openerContext.subtitle}</Text>
          </View>
        </TouchableOpacity>
      )}
    </AnymoOpener>
    <FeedContent>
  </View>
);
```

If you would like to know whether the Anymo content within your app is ready you can use the `isReady` hook to control your UI.

```js
// App.js

import React, { useContext } from 'react';
import { AnymoContext } from 'react-native-anymo';

let { isReady } = useContext(AnymoContext);

// ...

return isReady ? children : null;
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---
_Source: https://npm.io/package/react-native-anymo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
