You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
9
10
10
-
### Draft
11
-
12
-
Please note that this is a draft of the new reference manual. Some updates will follow before the
Override onStart and onNewIntent inMainActivity.java to handle Branch links (`android/app/src/[...]/MainActivity.java`)
261
+
Override onStart and onNewIntent inMainActivity.java to handle Branch links (`android/app/src/[...]/MainActivity.java`).
262
+
This has to be done regardless whether you used `react-native link`.
260
263
```java
261
264
import io.branch.rnbranch.*; // <-- add this
262
265
import android.content.Intent; // <-- and this
@@ -287,12 +290,12 @@ public class MainActivity extends ReactActivity {
287
290
288
291
After modifying your AppDelegate:
289
292
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 DictionaryorString 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
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
-

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)).
0 commit comments