Skip to content

Commit b657a74

Browse files
Add logo and JS API
1 parent c444e5e commit b657a74

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<!-- <img alt="React Native Brownfield" src="assets/brownfield-logo@2x.png" width="496"> -->
2+
<img alt="React Native Brownfield" src="https://user-images.githubusercontent.com/7837457/63517391-33651080-c4ef-11e9-88ca-a14374400ed4.png" width="496">
33
</p>
44

55
<p align="center">
@@ -44,12 +44,41 @@ yarn add @callstack/react-native-brownfield
4444

4545
## Usage
4646

47-
React Native Brownfield library works with all major native programming languages.
48-
Click on the logo to choose the one that interests you:
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:
4948

5049
| [<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) |
5150
| :---: | :---: | :---: | :---: |
5251

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+
5382
## Made with ❤️ at Callstack
5483

5584
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!
File renamed without changes.

example/objc/Test.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// Test.swift
3+
// NativeExample
4+
//
5+
// Created by Michal Chudziak on 21/08/2019.
6+
// Copyright © 2019 Callstack. All rights reserved.
7+
//
8+
9+
import Foundation

0 commit comments

Comments
 (0)