1 | # Updating to 1.0.0
|
2 |
|
3 | ## Branch API changes
|
4 |
|
5 | The method `createBranchUniversalObject` no longer returns an object as in react-native-branch version 0.9.x, instead it returns a **promise**.
|
6 |
|
7 | Change your code to handle the promise returned.
|
8 |
|
9 | ```Javascript
|
10 | // Version 0.9.x
|
11 | let branchUniversalObject = branch.createBranchUniversalObject('canonicalIdentifier', {metadata: {prop1: 'test', prop2: 'abc'}, title: 'Cool Content!', contentDescription: 'Cool Content Description'}
|
12 |
|
13 | // Version 1.1.0
|
14 | let branchUniversalObject = await branch.createBranchUniversalObject('canonicalIdentifier', {metadata: {prop1: 'test', prop2: 'abc'}, title: 'Cool Content!', contentDescription: 'Cool Content Description'}
|
15 | ```
|
16 |
|
17 | ## React changes
|
18 |
|
19 | Version 1.0.0 of react-native-branch requires version 0.40.0 or later
|
20 | of react-native. You will need to make some changes to the native iOS
|
21 | project in order to build:
|
22 |
|
23 | ### Imports
|
24 |
|
25 | Change `#import "RNBranch.h"` to `#import <react-native-branch/RNBranch.h>`
|
26 | in AppDelegate.m. The native React library also requires similar changes for
|
27 | headers, for example:
|
28 |
|
29 | ```Objective-C
|
30 | #import <React/RCTRootView.h>
|
31 | #import <react-native-branch/RNBranch.h>
|
32 | ```
|
33 |
|
34 | ### Library name
|
35 |
|
36 | Change 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 |
|
41 | Alternately, 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.
|