-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
103 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# branch.json configuration file (optional) | ||
|
||
Certain Branch configuration options may be controlled using a JSON configuration file | ||
in a React Native app project. This feature is rapidly evolving. Support will be added | ||
for further parameters and custom product flavors (Android) and build schemes (iOS). | ||
Watch this space for changes. | ||
|
||
Starting in release 2.0.0-beta.7, if `branch.json` is present in the app bundle, the | ||
react-native-branch SDK will use it to set certain options. This is useful for supporting | ||
certain methods in the native SDKs that must be called before the native SDK initializes. | ||
|
||
## Add the files to your project | ||
|
||
Be sure to commit `branch.json` and `branch.debug.json` to source control after adding | ||
them to your project. | ||
|
||
### Using react-native link | ||
|
||
If `branch.json` or `branch.debug.json` exists in a React Native application project | ||
using react-native-branch, they will be added to the native projects when `react-native link` | ||
is run. For example: | ||
|
||
```bash | ||
yarn add [email protected] | ||
cp node_modules/react-native-branch/branch.example.json branch.json | ||
react-native link react-native-branch | ||
``` | ||
|
||
#### Projects that already use react-native-branch | ||
|
||
Run `react-native unlink react-native-branch` first. For example: | ||
|
||
```bash | ||
react-native unlink react-native-branch | ||
cp node_modules/react-native-branch/branch.example.json branch.json | ||
react-native link react-native-branch | ||
``` | ||
|
||
### Manual integration without react-native link | ||
|
||
#### Android | ||
|
||
Put your `branch.json` file in `app/src/main/assets/branch.json`. | ||
|
||
#### iOS | ||
|
||
Add `branch.json` to your Xcode project using File > Add Files to "MyProject.xcodeproj". | ||
Also add it to the Copy Bundle Resources build phase for each application target in | ||
the project that uses the Branch SDK. | ||
|
||
## Configurations for debug and release builds | ||
|
||
It is possible to include different versions of the configuration for debug and release | ||
builds. | ||
|
||
### Using react-native link | ||
|
||
Optionally add both `branch.json` and `branch.debug.json` to the root of your app | ||
project and run `react-native link react-native-branch` (after running `react-native unlink react-native-branch` first if the module is already integrated). | ||
|
||
### Android | ||
|
||
If `app/src/debug/assets/branch.json` exists, that configuration will be used for | ||
debug builds instead of `app/src/main/assets/branch.json`. | ||
|
||
### iOS | ||
|
||
Add `branch.debug.json` to your project and the Copy Bundle Resources build phase(s) | ||
as discussed above. If this file is present, it will be used in debug builds instead | ||
of `branch.json`. | ||
|
||
## Contents | ||
|
||
|key|description|type| | ||
|---|---|---| | ||
|debugMode|If true, `setDebug` will be called in the native SDK, enabling testing of install events.|Boolean| | ||
|
||
## Example | ||
|
||
See [branch.example.json](https://github.com/BranchMetrics/react-native-branch-deep-linking/blob/master/branch.example.json) in the root of this repo. | ||
|
||
```json | ||
{ | ||
"debugMode": true | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters