Skip to content

Commit

Permalink
Docs updates for 2.0.0-beta.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jdee committed Jun 19, 2017
1 parent ef308fe commit 5f848f7
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 24 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@
* This release adds some native wrapper methods to simplify certain native code changes that cannot
be supported in JS.
* Includes native SDKs 0.15.3 (iOS), 2.8.0 (Android).

2017-06-19 Version 2.0.0-beta.7
* This release adds support for an optional `branch.json` configuration file. See https://rnbranch.app.link/branch-json for details.
* Includes native SDKs 0.15.3 (iOS), 2.9.0 (Android).
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ This is a repository of our open source React Native SDK. Huge shoutout to our f

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

Version 2.0.0-beta.6 is now available in NPM with a simplified SDK integration process. See [Release 2.0.0] for details.
Version 2.0.0-beta.7 is now available in NPM with a simplified SDK integration process. See [Release 2.0.0] for details.

**branch.json** It is now possible to control certain features of the Branch SDK using an optional
configuration file in your project. See https://rnbranch.app.link/branch-json for details.

**v1.1.0** The `createBranchUniversalObject` method is now async, so be sure to use `await` or handle the promise resolution, e.g.
```js
Expand Down
28 changes: 5 additions & 23 deletions docs/Release-2.0.0.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,20 @@
# Release 2.0.0

## Goals

The main motives behind this release are to:

- Reduce the number of manual steps required to get started.
- Remove any need for CocoaPods, Carthage or manual iOS SDK installation in a React Native app.
- Pin to specific versions of the native SDKs to avoid issues arising from version mismatches.
- Fully support integration of react-native-branch in a React Native component within a native
app that also uses the native Branch SDK.

These changes are fairly radical, so we're eager to get feedback before rolling this out to
production. Please open issues in this repo with any questions or problems.

Further plans for 2.0.0:

- Provide a script to automate project configuration changes, such as adding a Branch key and setting up Universal Link/App Link domains.
- Review/flesh out the native API for link routing on both platforms.
- Consistent error codes across the two platforms.
- TBD

## Changes

### Building, configuration and examples

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

### JS API changes

Expand Down
86 changes: 86 additions & 0 deletions docs/branch.json.md
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
}
```
4 changes: 4 additions & 0 deletions docs/setDebug.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ it is too late to call it. This is likely to change in a future release.
For now, it is necessary to make the call directly in native code on both
platforms.

As of 2.0.0-beta.7, it is also possible to call `setDebug` using the `debugMode`
parameter in the `branch.json` configuration file. See
https://rnbranch.app.link/branch-json for details.

#### iOS

##### Objective-C
Expand Down

0 comments on commit 5f848f7

Please sign in to comment.