|
| 1 | +<p align="center"> |
| 2 | + <img alt="React Native Brownfield" src="https://user-images.githubusercontent.com/7837457/63594721-7f7b8800-c5b7-11e9-87ef-a0898cd22fcc.png" width="800"> |
| 3 | +</p> |
| 4 | + |
| 5 | +<p align="center"> |
| 6 | + Set of helpers to make your brownfield integration smooth and easy. |
| 7 | +</p> |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +[![Build Status][build-badge]][build] |
| 12 | +[![Version][version-badge]][package] |
| 13 | +[![MIT License][license-badge]][license] |
| 14 | + |
| 15 | +[![PRs Welcome][prs-welcome-badge]][prs-welcome] |
| 16 | +[![Chat][chat-badge]][chat] |
| 17 | +[![Code of Conduct][coc-badge]][coc] |
| 18 | +[![Sponsored by Callstack][callstack-badge]][callstack] |
| 19 | + |
| 20 | +[![tweet][tweet-badge]][tweet] |
| 21 | + |
| 22 | +## Features |
| 23 | + |
| 24 | +- **Easily integrate** React Native with existing native app |
| 25 | +- Start React Native with **one method** and invoke code as soon as it's loaded |
| 26 | +- Reuse the same instance of React Native **bridge** between different components |
| 27 | +- Use predefined **native building blocks** - crafted for React Native |
| 28 | +- Disable and enable **native gestures and hardware buttons** from JavaScript |
| 29 | +- Works well with **any native navigation** pattern, as well as every React Native JavaScript based navigation |
| 30 | +- Compatible with all native languages **Objective-C**, **Swift**, **Java** and **Kotlin** |
| 31 | + |
| 32 | + |
| 33 | +## Installation |
| 34 | + |
| 35 | +```sh |
| 36 | +npm install @callstack/react-native-brownfield |
| 37 | +``` |
| 38 | + |
| 39 | +or |
| 40 | + |
| 41 | +```sh |
| 42 | +yarn add @callstack/react-native-brownfield |
| 43 | +``` |
| 44 | + |
| 45 | +## Usage |
| 46 | + |
| 47 | +React Native Brownfield library works with all major native programming languages. Majority of its API is exposed on the native side. Click on the logo to choose the one that interests you: |
| 48 | + |
| 49 | +| [<img src="https://user-images.githubusercontent.com/7837457/63374769-cafd1e80-c38a-11e9-9724-e797a199ebab.png" width="100px;" alt="Objective-C"/><br /><sub><b>Objective-C</b></sub>](docs/OBJECTIVE_C.md) | [<img src="https://user-images.githubusercontent.com/7837457/63374778-ce90a580-c38a-11e9-8f37-72a9a5b9a52f.png" width="100px;" alt="Swift"/><br /><sub><b>Swift</b></sub>](docs/SWIFT.md) | [<img src="https://user-images.githubusercontent.com/7837457/63374794-d2bcc300-c38a-11e9-9a7f-d538563b75db.png" width="100px;" alt="Java"/><br /><sub><b>Java</b></sub>](docs/JAVA.md) | [<img src="https://user-images.githubusercontent.com/7837457/63374783-d0f2ff80-c38a-11e9-9790-041cad53b259.png" width="100px;" alt="Kotlin"/><br /><sub><b>Kotlin</b></sub>](docs/KOTLIN.md) | |
| 50 | +| :---: | :---: | :---: | :---: | |
| 51 | + |
| 52 | +### JavaScript Module |
| 53 | + |
| 54 | +Besides native components, we are exposing JavaScript functions to control the behavior of those components. |
| 55 | + |
| 56 | +To use the module, simply import it: |
| 57 | + |
| 58 | +```js |
| 59 | +import ReactNativeBrownfield from '@callstack/react-native-brownfield'; |
| 60 | +``` |
| 61 | + |
| 62 | +### JavaScript API Reference: |
| 63 | + |
| 64 | +**setNativeBackGestureAndButtonEnabled(enabled: boolean)** |
| 65 | + |
| 66 | +A method used to toggle iOS native back gesture and Android hardware back button. |
| 67 | + |
| 68 | +```js |
| 69 | +ReactNativeBrownfield.setNativeBackGestureAndButtonEnabled(true); |
| 70 | +``` |
| 71 | + |
| 72 | +**popToNative(animated[iOS only]: boolean)** |
| 73 | + |
| 74 | +A method to pop to native screen used to push React Native experience. |
| 75 | + |
| 76 | +```js |
| 77 | +ReactNativeBrownfield.popToNative(true); |
| 78 | +``` |
| 79 | + |
| 80 | +> NOTE: Those methods works only with native components provided by this library. |
| 81 | +
|
| 82 | +## Made with ❤️ at Callstack |
| 83 | + |
| 84 | +Linaria is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Callstack ](https://callstack.com) is a group of React and React Native geeks, contact us at [[email protected]](mailto:[email protected]) if you need any help with these or just want to say hi! |
| 85 | + |
| 86 | +## Contributors |
| 87 | + |
| 88 | +Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): |
| 89 | + |
| 90 | +<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> |
| 91 | +<!-- prettier-ignore --> |
| 92 | +| [<img src="https://avatars0.githubusercontent.com/u/7837457?s=460&v=4" width="100px;" alt="Michał Chudziak"/><br /><sub><b>Michał Chudziak</b></sub>](https://twitter.com/michalchudziak)<br />[💻](https://github.com/callstack/linaria/commits?author=michalchudziak "Code") [📖](https://github.com/callstack/linaria/commits?author=michalchudziak "Documentation") [🤔](#ideas-michalchudziak "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/16336501?s=400&v=4" width="100px;" alt="Piotr Drapich"/><br /><sub><b>Piotr Drapich</b></sub>](https://twitter.com/dratwas)<br />[💻](https://github.com/callstack/linaria/commits?author=dratwas "Code") [🤔](#ideas-dratwas "Ideas, Planning, & Feedback") | |
| 93 | +| :---: | :---: | |
| 94 | + |
| 95 | +<!-- ALL-CONTRIBUTORS-LIST:END --> |
| 96 | + |
| 97 | +This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! |
| 98 | + |
| 99 | +<!-- badges --> |
| 100 | +[build-badge]: https://img.shields.io/circleci/build/github/callstack/react-native-brownfield/master.svg?style=flat-square |
| 101 | +[build]: https://circleci.com/gh/callstack/react-native-brownfield |
| 102 | +[version-badge]: https://img.shields.io/npm/v/@callstack/react-native-brownfield.svg?style=flat-square |
| 103 | +[package]: https://www.npmjs.com/package/@callstack/react-native-brownfield |
| 104 | +[license-badge]: https://img.shields.io/npm/l/@callstack/react-native-brownfield.svg?style=flat-square |
| 105 | +[license]: https://opensource.org/licenses/MIT |
| 106 | +[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square |
| 107 | +[prs-welcome]: http://makeapullrequest.com |
| 108 | +[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square |
| 109 | +[coc]: https://github.com/callstack/react-native-brownfield/blob/master/CODE_OF_CONDUCT.md |
| 110 | +[all-contributors-badge]: https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square |
| 111 | +[chat-badge]: https://img.shields.io/discord/613446453762719798.svg?style=flat-square&colorB=758ED3 |
| 112 | +[chat]: https://discord.gg/2SR9Mua |
| 113 | +[tweet-badge]: https://img.shields.io/badge/tweet-%23reacnativebrownfield-blue.svg?style=flat-square&colorB=1DA1F2&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAUCAYAAACXtf2DAAAAAXNSR0IArs4c6QAAAaRJREFUOBGtlM8rBGEYx3cWtRHJRaKcuMtBSitxkCQ3LtzkP9iUUu5ODspRHLhRLtq0FxeicEBC2cOivcge%2FMgan3fNM8bbzL4zm6c%2BPT%2Fe7%2FO8887svrFYBWbbtgWzsAt3sAcpqJFxxF1QV8oJFqFPFst5dLWQAT87oTgPB7DtziFRT1EA4yZolsFkhwjGYFRO8Op0KD8HVe7unoB6PRTBZG8IctAmG1xrHcfkQ2B55sfI%2ByGMXSBqV71xZ8CWdxBxN6ThFuECDEAL%2Bc9HIzDYumVZ966GZnX0SzCZvEqTbkaGywkyFE6hKAsBPhFQ18uPUqh2ggJ%2BUor%2F4M%2F%2FzOC8g6YzR1i%2F8g4vvSI%2ByD7FFNjexQrjHd8%2BnjABI3AU4Wl16TuF1qANGll81jsi5qu%2Bw6XIsCn4ijhU5FmCJpkV6BGNw410hfSf6JKBQ%2FUFxHGYBnWnmOwDwYQ%2BwzdHqO75HtiAMJfaC7ph32FSRJCENUhDHsLaJkL%2FX4wMF4%2BwA5bgAcrZE4sr0Cu9Jq9fxyrvBHWbNkMD5CEHWTjjT2m6r5D92jfmbbKJEWuMMAAAAABJRU5ErkJggg%3D%3D |
| 114 | +[tweet]: https://twitter.com/intent/tweet?text=Check%20out%20react-native-brownfield!%20https://github.com/callstack/react-native-brownfield%20%F0%9F%91%8D |
| 115 | +[callstack-badge]: https://callstack.com/images/callstack-badge.svg |
| 116 | +[callstack]: https://callstack.com/open-source/?utm_source=github.com&utm_medium=referral&utm_campaign=rnbrownfield&utm_term=readme |
0 commit comments