|
2 | 2 |
|
3 | 3 | This is a repository of our open source React Native SDK. Huge shoutout to our friends at [Dispatcher, Inc.](https://dispatchertrucking.com) for their help in compiling the initial version of this SDK. This SDK will help you handle iOS Universal Links, Android App Links and deferred deep links, do install attribution and much more! |
4 | 4 |
|
5 | | -**react-native v0.40 support** is available in version 1.0.0. This is a non-backwards compatible update. If you need to stay on react-native <0.40 please fix your package.json version to react-native-branch@0.9. See [Updating to 1.0.0](./docs/updating-1.0.0.md) for details. Note that some build steps differ between 0.9 and 1.0. These are highlighted |
| 5 | +**react-native v0.40 support** is available in version 1.x. This is a non-backwards compatible update. If you need to stay on react-native <0.40 please fix your package.json version to react-native-branch@0.9. See [Updating to 1.0.0](./docs/updating-1.0.0.md) for details. Note that some build steps differ between 0.9 and 1.x. These are highlighted |
6 | 6 | where applicable. |
7 | 7 |
|
8 | 8 | **v0.8.0** If you have overridden `onStop` in MainActivity.java be sure *not* to invoke `RNBranchModule.onStop()`. |
@@ -83,15 +83,14 @@ let branchUniversalObject = branch.createBranchUniversalObject('canonicalIdentif |
83 | 83 | metadata: {prop1: 'test', prop2: 'abc'}, |
84 | 84 | title: 'Cool Content!', |
85 | 85 | contentDescription: 'Cool Content Description'}) |
86 | | -let actionResult = await branchUniversalObject.userCompletedAction(RegisterViewEvent) |
87 | | -let customActionResult = await branchUniversalObject.userCompletedAction('Custom Action', { key: 'value' }) |
| 86 | +branchUniversalObject.userCompletedAction(RegisterViewEvent) |
| 87 | +branchUniversalObject.userCompletedAction('Custom Action', { key: 'value' }) |
88 | 88 |
|
89 | 89 | let shareOptions = { messageHeader: 'Check this out', messageBody: 'No really, check this out!' } |
90 | 90 | let linkProperties = { feature: 'share', channel: 'RNApp' } |
91 | 91 | let controlParams = { $desktop_url: 'http://example.com/home', $ios_url: 'http://example.com/ios' } |
92 | 92 | let {channel, completed, error} = await branchUniversalObject.showShareSheet(shareOptions, linkProperties, controlParams) |
93 | 93 | let {url} = await branchUniversalObject.generateShortUrl(linkProperties, controlParams) |
94 | | -let viewResult = await branchUniversalObject.registerView() // deprecated. use userCompletedAction(RegisterViewEvent) instead. |
95 | 94 | let spotlightResult = await branchUniversalObject.listOnSpotlight() |
96 | 95 |
|
97 | 96 | // optional: release native resources right away when finished with this BUO. |
@@ -158,7 +157,7 @@ Register a user action with Branch. |
158 | 157 | Create a branch universal object. |
159 | 158 | **canonicalIdentifier** the unique identifier for the content. |
160 | 159 | **universalObjectOptions** options for universal object as defined [below](#universalobjectoptions). |
161 | | -Returns an object with methods `generateShortUrl`, `registerView`, `listOnSpotlight`, `showShareSheet` and `userCompletedAction`. |
| 160 | +Returns an object with methods `generateShortUrl`, `registerView`, `listOnSpotlight`, `showShareSheet`, `userCompletedAction` and `release`. |
162 | 161 |
|
163 | 162 | ##### The following methods are available on the resulting branchUniversalObject: |
164 | 163 |
|
@@ -202,6 +201,9 @@ universalObject.userCompletedAction(RegisterViewEvent) |
202 | 201 |
|
203 | 202 | The `automaticallyListOnSpotlight` property is ignored on Android. |
204 | 203 |
|
| 204 | +##### <a id='release'></a>[- release()](#release) |
| 205 | +(Optional) Immediately release native resources used by this Branch Universal Object instance. Those resources will eventually be removed if they are unused for some time, but you can also call `release()` when a BUO is no longer used, e.g. in `componentWillUnmount()`. (See the [testbed](./testbed) apps in this repo.) |
| 206 | + |
205 | 207 | ##### <a id='useractions'></a>[Register User Actions On An Object](#useractions) |
206 | 208 |
|
207 | 209 | We've added a series of custom events that you'll want to start tracking for rich analytics and targeting. Here's a list below with a sample snippet that calls the register view event. |
|
0 commit comments