Skip to content

Commit 2a89d4e

Browse files
authored
Merge pull request #254 from BranchMetrics/final-2.0-doc-mods
Final 2.0 doc mods
2 parents b4116a1 + 1d9472c commit 2a89d4e

File tree

4 files changed

+18
-415
lines changed

4 files changed

+18
-415
lines changed

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
# Branch Metrics React Native SDK Reference
22

3-
[![build status](https://img.shields.io/travis/BranchMetrics/react-native-branch-deep-linking.svg?style=flat)](https://travis-ci.org/BranchMetrics/react-native-branch-deep-linking)
3+
[![CircleCI](https://circleci.com/gh/BranchMetrics/react-native-branch-deep-linking.svg?style=svg)](https://circleci.com/gh/BranchMetrics/react-native-branch-deep-linking)
4+
[![Travis](https://img.shields.io/travis/BranchMetrics/react-native-branch-deep-linking.svg?style=flat)](https://travis-ci.org/BranchMetrics/react-native-branch-deep-linking)
45
[![npm version](https://img.shields.io/npm/v/react-native-branch.svg?style=flat)](https://www.npmjs.com/package/react-native-branch)
56
[![npm downloads](https://img.shields.io/npm/dm/react-native-branch.svg?style=flat)](https://www.npmjs.com/package/react-native-branch)
67
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://raw.githubusercontent.com/BranchMetrics/react-native-branch-deep-linking/master/LICENSE)
78

89
This is a repository of our open source React Native SDK. The information presented here serves as a reference manual for the SDK. See the table of contents below for a complete list of the content featured in this document.
910

10-
### Draft
11-
12-
Please note that this is a draft of the new reference manual. Some updates will follow before the
13-
production release of 2.0.0.
14-
1511
___
1612

1713
## React Native Reference
1814

1915
1. External resources
20-
+ [Full integration guide](https://dev.branch.io/getting-started/sdk-integration-guide/guide/react/)
16+
+ [Full integration guide](https://docs.branch.io/pages/apps/react-native/#configure-app)
2117
+ [Change log](https://github.com/BranchMetrics/react-native-branch-deep-linking/blob/master/ChangeLog.md)
2218
+ [Support portal](http://support.branch.io)
2319

@@ -137,6 +133,8 @@ pod "react-native-branch", path: "../node_modules/react-native-branch"
137133
pod "Branch-SDK", path: "../node_modules/react-native-branch/ios"
138134
```
139135

136+
The location of `node_modules` relative to your `Podfile` may vary.
137+
140138
Run `pod install` after making this change.
141139

142140
##### Carthage
@@ -229,12 +227,16 @@ These instructions are for Swift 3. Please note that Swift 2 is deprecated.
229227

230228
### Android project
231229

232-
Add RNBranchPackage to packages list in MainApplication.java (`android/app/src/[...]/MainApplication.java`)
230+
Add RNBranchPackage to packages list in `getPackages()` MainApplication.java (`android/app/src/[...]/MainApplication.java`).
231+
Note that this is automatically done if you used `react-native link`.
232+
233+
Also add a call to `Branch.getAutoinstance()` in `onCreate()` in the same source file. This has to be
234+
done even if you used `react-native link`.
233235
```java
234236
// ...
235237
236238
// import Branch and RNBranch
237-
import io.branch.rnbranch.*;
239+
import io.branch.rnbranch.RNBranchPackage;
238240
import io.branch.referral.Branch;
239241
240242
//...
@@ -256,7 +258,8 @@ import io.branch.referral.Branch;
256258
}
257259
```
258260

259-
Override onStart and onNewIntent in MainActivity.java to handle Branch links (`android/app/src/[...]/MainActivity.java`)
261+
Override onStart and onNewIntent in MainActivity.java to handle Branch links (`android/app/src/[...]/MainActivity.java`).
262+
This has to be done regardless whether you used `react-native link`.
260263
```java
261264
import io.branch.rnbranch.*; // <-- add this
262265
import android.content.Intent; // <-- and this
@@ -287,12 +290,12 @@ public class MainActivity extends ReactActivity {
287290

288291
After modifying your AppDelegate:
289292

290-
1. [Add a String entry branch_key](https://dev.branch.io/references/ios_sdk/#add-your-branch-key-to-your-project) with your Branch key to your info.plist
293+
1. [Add a Dictionary or String entry branch_key](https://dev.branch.io/references/ios_sdk/#add-your-branch-key-to-your-project) with your Branch key to your info.plist
291294

292295
2. [Configure for Universal Linking](https://dev.branch.io/references/ios_sdk/#support-universal-linking-ios-9)
293296

294297
3. If using a custom domain in the Branch Dashboard or one or more non-Branch domains, [add the `branch_universal_link_domains`
295-
key to your Info.plist](https://dev.branch.io/getting-started/universal-app-links/advanced/ios/#custom-continueuseractivity-configuration).
298+
key to your Info.plist](https://dev.branch.io/getting-started/universal-app-links/advanced/ios/#custom-continueuseractivity-configuration).
296299

297300
### Android Project Setup
298301

@@ -762,7 +765,7 @@ branchUniversalObject.userCompletedAction(RegisterViewEvent)
762765
or
763766
764767
```js
765-
import branch, { RegisterViewEvent } from 'react-native-branch'
768+
import branch from 'react-native-branch'
766769
767770
let branchUniversalObject = await branch.createBranchUniversalObject(...)
768771

docs/Release-2.0.0.md

Lines changed: 0 additions & 167 deletions
This file was deleted.

docs/installation.md

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1 @@
1-
# React Native Branch - Installation
2-
For beta version 2.0.0 see [Release 2.0.0](./docs/release-2.0.0). These instructions are for 0.9 and 1.x.
3-
4-
1. `npm install --save react-native-branch`
5-
2. `react-native link react-native-branch` **or** link the project [manually](#manual-linking)
6-
3. Add `pod 'Branch'` as a dependency in your ios/Podfile
7-
4. `cd ios; pod install --repo-update`
8-
9-
Note that CocoaPods 1.x no longer automatically updates pod repositories automatically on `pod install`. To make sure
10-
you get the latest version of the Branch SDK, use `--repo-update` or run `pod repo update` before `pod install`.
11-
12-
## CocoaPods
13-
#### Example Podfile
14-
In a standard installation your Podfile should look something like:
15-
```Ruby
16-
target 'MyProject' do
17-
pod 'Branch'
18-
end
19-
```
20-
21-
#### Creating a New Podfile
22-
If you do not already have a Podfile in your ios directory, you can create one with `cd ios; pod init`. Then add `pod 'Branch'` to your target. Or you
23-
can copy the simple Podfile from the [testbed_cocoapods](../examples/testbed_cocoapods/ios/Podfile) sample app
24-
and modify it for your target(s), e.g.:
25-
```Ruby
26-
use_frameworks!
27-
platform :ios, "8.0"
28-
29-
pod "Branch"
30-
31-
target "MyProject"
32-
target "MyProjectTests"
33-
```
34-
Now run `pod install` to get the Branch SDK.
35-
36-
After pod install you will from now on need to open your project using **[MyProject].xcworkspace** instead of the original .xcodeproj.
37-
38-
#### Pod Only Installation
39-
If you already use the React pod, you can simply add the react-native-branch dependency to your Podfile:
40-
```Ruby
41-
target 'MyProject' do
42-
pod 'React', path: '../node_modules/react-native'
43-
pod 'react-native-branch', path: '../node_modules/react-native-branch'
44-
end
45-
```
46-
47-
### Carthage
48-
[carthage]: https://github.com/Carthage/Carthage
49-
50-
If you would prefer to use [Carthage](carthage), you can skip steps 3 & 4 above and instead add the following to your `Cartfile`:
51-
52-
`github "BranchMetrics/ios-branch-deep-linking"`
53-
54-
Then run:
55-
56-
`carthage update`
57-
58-
If you're unfamiliar with how to add a framework to your project with [Carthage](carthage), you can [learn more here](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application). You will need to maually link the framework by adding it to the "Linked Frameworks and Libraries" section of your target settings, and copy it by adding it to the "Input Files" section of your `carthage copy-frameworks` build phase.
59-
60-
## Manual Linking
61-
#### iOS:
62-
- Drag and Drop node_modules/react-native-branch/RNBranch/RNBranch.xcodeproj into the Libraries folder of your project in XCode (as described in Step 1 [here](http://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking)). Be certain to add RNBRanch.xcodeproj
63-
*after* all the React projects in the Libraries group.
64-
65-
![RNBranch.xcodeproj after React projects](https://raw.githubusercontent.com/BranchMetrics/react-native-branch-deep-linking/master/docs/assets/RNBranch.png)
66-
- Drag and Drop the RNBranch.xcodeproj's Products's libreact-native-branch.a into your project's target's "Linked Frameworks and Libraries" section (as described in Step 2 [here](http://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking)). The order here is not important. **Note:** In version 0.9, the library is called libRNBranch.a.
67-
- If you are using version 0.9 of `react-native-branch`, add a Header Search Path pointing to `$(SRCROOT)/../node_modules/react-native-branch/ios` (as described in Step 3 [here](http://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking)).
68-
69-
![Custom Header Search Path](https://raw.githubusercontent.com/BranchMetrics/react-native-branch-deep-linking/master/docs/assets/header-search-path.png)
70-
71-
This step is not necessary if you are using version 1.0.
72-
73-
#### android:
74-
android/settings.gradle
75-
```gradle
76-
include ':react-native-branch', ':app'
77-
78-
project(':react-native-branch').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-branch/android')
79-
```
80-
android/app/build.gradle
81-
```gradle
82-
dependencies {
83-
...
84-
compile project(':react-native-branch')
85-
}
86-
```
87-
88-
Now that Branch is installed, you will need to [set up your app to handle Branch links](./setup.md).
1+
Installation docs have moved to the main [README](https://github.com/BranchMetrics/react-native-branch-deep-linking).

0 commit comments

Comments
 (0)