Skip to content

Commit f6267c3

Browse files
committed
Document release() method and update to version 1.1.0.
1 parent e1feeef commit f6267c3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
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!
44

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
66
where applicable.
77

88
**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
8383
metadata: {prop1: 'test', prop2: 'abc'},
8484
title: 'Cool Content!',
8585
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' })
8888

8989
let shareOptions = { messageHeader: 'Check this out', messageBody: 'No really, check this out!' }
9090
let linkProperties = { feature: 'share', channel: 'RNApp' }
9191
let controlParams = { $desktop_url: 'http://example.com/home', $ios_url: 'http://example.com/ios' }
9292
let {channel, completed, error} = await branchUniversalObject.showShareSheet(shareOptions, linkProperties, controlParams)
9393
let {url} = await branchUniversalObject.generateShortUrl(linkProperties, controlParams)
94-
let viewResult = await branchUniversalObject.registerView() // deprecated. use userCompletedAction(RegisterViewEvent) instead.
9594
let spotlightResult = await branchUniversalObject.listOnSpotlight()
9695

9796
// optional: release native resources right away when finished with this BUO.
@@ -158,7 +157,7 @@ Register a user action with Branch.
158157
Create a branch universal object.
159158
**canonicalIdentifier** the unique identifier for the content.
160159
**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`.
162161

163162
##### The following methods are available on the resulting branchUniversalObject:
164163

@@ -202,6 +201,9 @@ universalObject.userCompletedAction(RegisterViewEvent)
202201

203202
The `automaticallyListOnSpotlight` property is ignored on Android.
204203

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+
205207
##### <a id='useractions'></a>[Register User Actions On An Object](#useractions)
206208

207209
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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-branch",
3-
"version": "1.0.6",
3+
"version": "1.1.0",
44
"description": "Branch Metrics React Native SDK",
55
"main": "src/index.js",
66
"files": [

0 commit comments

Comments
 (0)