Skip to content

Commit 5f848f7

Browse files
committed
Docs updates for 2.0.0-beta.7
1 parent ef308fe commit 5f848f7

File tree

5 files changed

+103
-24
lines changed

5 files changed

+103
-24
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,7 @@
135135
* This release adds some native wrapper methods to simplify certain native code changes that cannot
136136
be supported in JS.
137137
* Includes native SDKs 0.15.3 (iOS), 2.8.0 (Android).
138+
139+
2017-06-19 Version 2.0.0-beta.7
140+
* This release adds support for an optional `branch.json` configuration file. See https://rnbranch.app.link/branch-json for details.
141+
* Includes native SDKs 0.15.3 (iOS), 2.9.0 (Android).

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ This is a repository of our open source React Native SDK. Huge shoutout to our f
1111

1212
[Release 2.0.0]: ./docs/Release-2.0.0.md
1313

14-
Version 2.0.0-beta.6 is now available in NPM with a simplified SDK integration process. See [Release 2.0.0] for details.
14+
Version 2.0.0-beta.7 is now available in NPM with a simplified SDK integration process. See [Release 2.0.0] for details.
15+
16+
**branch.json** It is now possible to control certain features of the Branch SDK using an optional
17+
configuration file in your project. See https://rnbranch.app.link/branch-json for details.
1518

1619
**v1.1.0** The `createBranchUniversalObject` method is now async, so be sure to use `await` or handle the promise resolution, e.g.
1720
```js

docs/Release-2.0.0.md

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,20 @@
11
# Release 2.0.0
22

3-
## Goals
4-
5-
The main motives behind this release are to:
6-
7-
- Reduce the number of manual steps required to get started.
8-
- Remove any need for CocoaPods, Carthage or manual iOS SDK installation in a React Native app.
9-
- Pin to specific versions of the native SDKs to avoid issues arising from version mismatches.
10-
- Fully support integration of react-native-branch in a React Native component within a native
11-
app that also uses the native Branch SDK.
12-
13-
These changes are fairly radical, so we're eager to get feedback before rolling this out to
14-
production. Please open issues in this repo with any questions or problems.
15-
16-
Further plans for 2.0.0:
17-
18-
- Provide a script to automate project configuration changes, such as adding a Branch key and setting up Universal Link/App Link domains.
19-
- Review/flesh out the native API for link routing on both platforms.
20-
- Consistent error codes across the two platforms.
21-
- TBD
22-
233
## Changes
244

255
### Building, configuration and examples
266

27-
- The native iOS SDK source (version 0.14.12) is now included in the RNBranch project and is no longer a required external dependency.
28-
- A jar file (version 2.8.0) is included for the Android SDK.
7+
- The native iOS SDK source is now included in the RNBranch project and is no longer a required external dependency.
8+
- A jar file is included for the Android SDK.
299
- A Branch-SDK podspec is included in the NPM module for use in native apps that use the React pod from node_modules.
30-
- Five new testbed apps are available:
10+
- Five new example apps are available:
3111
+ testbed_simple illustrates the simplest way to integrate the SDK using `react-native link`.
3212
+ testbed_native_ios illustrates including `react-native-branch` in a React Native component within a native iOS app.
3313
+ testbed_native_android illustrates including `react-native-branch` in a React Native component within a native Android app.
3414
+ webview_example is a realistic example of SDK integration following best practices.
3515
+ webview_example_native_ios is a realistic example of SDK integration in a React Native component within a Swift app.
16+
- An optional `branch.json` file may be added to an app to control certain Branch configuration
17+
parameters. If presetnt, it is automatically integrated when using `react-native link`.
3618

3719
### JS API changes
3820

docs/branch.json.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# branch.json configuration file (optional)
2+
3+
Certain Branch configuration options may be controlled using a JSON configuration file
4+
in a React Native app project. This feature is rapidly evolving. Support will be added
5+
for further parameters and custom product flavors (Android) and build schemes (iOS).
6+
Watch this space for changes.
7+
8+
Starting in release 2.0.0-beta.7, if `branch.json` is present in the app bundle, the
9+
react-native-branch SDK will use it to set certain options. This is useful for supporting
10+
certain methods in the native SDKs that must be called before the native SDK initializes.
11+
12+
## Add the files to your project
13+
14+
Be sure to commit `branch.json` and `branch.debug.json` to source control after adding
15+
them to your project.
16+
17+
### Using react-native link
18+
19+
If `branch.json` or `branch.debug.json` exists in a React Native application project
20+
using react-native-branch, they will be added to the native projects when `react-native link`
21+
is run. For example:
22+
23+
```bash
24+
25+
cp node_modules/react-native-branch/branch.example.json branch.json
26+
react-native link react-native-branch
27+
```
28+
29+
#### Projects that already use react-native-branch
30+
31+
Run `react-native unlink react-native-branch` first. For example:
32+
33+
```bash
34+
react-native unlink react-native-branch
35+
cp node_modules/react-native-branch/branch.example.json branch.json
36+
react-native link react-native-branch
37+
```
38+
39+
### Manual integration without react-native link
40+
41+
#### Android
42+
43+
Put your `branch.json` file in `app/src/main/assets/branch.json`.
44+
45+
#### iOS
46+
47+
Add `branch.json` to your Xcode project using File > Add Files to "MyProject.xcodeproj".
48+
Also add it to the Copy Bundle Resources build phase for each application target in
49+
the project that uses the Branch SDK.
50+
51+
## Configurations for debug and release builds
52+
53+
It is possible to include different versions of the configuration for debug and release
54+
builds.
55+
56+
### Using react-native link
57+
58+
Optionally add both `branch.json` and `branch.debug.json` to the root of your app
59+
project and run `react-native link react-native-branch` (after running `react-native unlink react-native-branch` first if the module is already integrated).
60+
61+
### Android
62+
63+
If `app/src/debug/assets/branch.json` exists, that configuration will be used for
64+
debug builds instead of `app/src/main/assets/branch.json`.
65+
66+
### iOS
67+
68+
Add `branch.debug.json` to your project and the Copy Bundle Resources build phase(s)
69+
as discussed above. If this file is present, it will be used in debug builds instead
70+
of `branch.json`.
71+
72+
## Contents
73+
74+
|key|description|type|
75+
|---|---|---|
76+
|debugMode|If true, `setDebug` will be called in the native SDK, enabling testing of install events.|Boolean|
77+
78+
## Example
79+
80+
See [branch.example.json](https://github.com/BranchMetrics/react-native-branch-deep-linking/blob/master/branch.example.json) in the root of this repo.
81+
82+
```json
83+
{
84+
"debugMode": true
85+
}
86+
```

docs/setDebug.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ it is too late to call it. This is likely to change in a future release.
88
For now, it is necessary to make the call directly in native code on both
99
platforms.
1010

11+
As of 2.0.0-beta.7, it is also possible to call `setDebug` using the `debugMode`
12+
parameter in the `branch.json` configuration file. See
13+
https://rnbranch.app.link/branch-json for details.
14+
1115
#### iOS
1216

1317
##### Objective-C

0 commit comments

Comments
 (0)