UNPKG

1.85 kBMarkdownView Raw
1# Updating to 1.0.0
2
3## Branch API changes
4
5The method `createBranchUniversalObject` no longer returns an object as in react-native-branch version 0.9.x, instead it returns a **promise**.
6
7Change your code to handle the promise returned.
8
9```Javascript
10// Version 0.9.x
11let branchUniversalObject = branch.createBranchUniversalObject('canonicalIdentifier', {metadata: {prop1: 'test', prop2: 'abc'}, title: 'Cool Content!', contentDescription: 'Cool Content Description'}
12
13// Version 1.1.0
14let branchUniversalObject = await branch.createBranchUniversalObject('canonicalIdentifier', {metadata: {prop1: 'test', prop2: 'abc'}, title: 'Cool Content!', contentDescription: 'Cool Content Description'}
15```
16
17## React changes
18
19Version 1.0.0 of react-native-branch requires version 0.40.0 or later
20of react-native. You will need to make some changes to the native iOS
21project in order to build:
22
23### Imports
24
25Change `#import "RNBranch.h"` to `#import <react-native-branch/RNBranch.h>`
26in AppDelegate.m. The native React library also requires similar changes for
27headers, for example:
28
29```Objective-C
30#import <React/RCTRootView.h>
31#import <react-native-branch/RNBranch.h>
32```
33
34### Library name
35
36Change the name of the library in Linked Frameworks and Libraries to
37`libreact-native-branch.a` instead of `libRNBranch.a`:
38
39![libreact-native-branch.a](https://raw.githubusercontent.com/BranchMetrics/react-native-branch-deep-linking/master/docs/assets/libreact-native-branch.png)
40
41Alternately, you can remove the `RNBranch` project reference from the Libraries group in Xcode (be sure to select Remove Reference or you'll have to reinstall the react-native-branch NPM module) and the dependency on `libRNBranch.a` in Linked Frameworks and Libraries. Then close the project or workspace and run `react-native link` to add `RNBranch` back with the correct library name.