Skip to content

Commit

Permalink
Merge pull request #130 from BranchMetrics/1.1-doc-update
Browse files Browse the repository at this point in the history
1.1 doc update
  • Loading branch information
jdee authored Mar 20, 2017
2 parents fe160b1 + 174a08e commit 125336f
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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!

**v1.1.0** The `createBranchUniversalObject` method is now async, so be sure to use `await` or handle the promise resolution, e.g.
```js
let buo = await branch.createBranchUniversalObject(...)
```
or
```js
branch.createBranchUniversalObject(...).then((buo) => {
this.buo = buo
})
```
This method does not throw.

**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 [email protected]. 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
where applicable.

Expand Down Expand Up @@ -78,7 +90,7 @@ branch.setIdentity('theUserId')
branch.userCompletedAction('Purchased Item', {item: 123})
branch.logout()

let branchUniversalObject = branch.createBranchUniversalObject('canonicalIdentifier', {
let branchUniversalObject = await branch.createBranchUniversalObject('canonicalIdentifier', {
automaticallyListOnSpotlight: true,
metadata: {prop1: 'test', prop2: 'abc'},
title: 'Cool Content!',
Expand Down Expand Up @@ -153,11 +165,11 @@ Logout the current user.
Register a user action with Branch.

## Branch Universal Object
###### <a id='createbranchuniversalobject'></a>[createBranchUniversalObject(canonicalIdentifier, universalObjectOptions): object](#createbranchuniversalobject)
###### <a id='createbranchuniversalobject'></a>[createBranchUniversalObject(canonicalIdentifier, universalObjectOptions): Promise](#createbranchuniversalobject)
Create a branch universal object.
**canonicalIdentifier** the unique identifier for the content.
**universalObjectOptions** options for universal object as defined [below](#universalobjectoptions).
Returns an object with methods `generateShortUrl`, `registerView`, `listOnSpotlight`, `showShareSheet`, `userCompletedAction` (v1.1.0) and `release` (v1.1.0).
Returns a promise. On resolution, the promise returns an object with methods `generateShortUrl`, `registerView`, `listOnSpotlight`, `showShareSheet`, `userCompletedAction` (v1.1.0) and `release` (v1.1.0). This method does not throw.

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

Expand Down Expand Up @@ -192,7 +204,7 @@ List the universal object on Spotlight (iOS only). **Note**: The recommended way
```js
import branch, { RegisterViewEvent } from 'react-native-branch'

let universalObject = branch.createBranchUniversalObject('abc', {
let universalObject = await branch.createBranchUniversalObject('abc', {
automaticallyListOnSpotlight: true,
title: 'Item title',
contentDescription: 'Item description',
Expand Down Expand Up @@ -224,7 +236,7 @@ We've added a series of custom events that you'll want to start tracking for ric

```js
import branch, { RegisterViewEvent } from 'react-native-branch'
let universalObject = branch.createUniversalObject('abc', {})
let universalObject = await branch.createUniversalObject('abc', {})
universalObject.userCompletedAction(RegisterViewEvent)
```

Expand Down

0 comments on commit 125336f

Please sign in to comment.