Ionic Framework 4 is almost here. Preview the beta docs and try it out now! Try Ionic 4 Beta

BranchIo

Improve this doc

Branch.io is an attribution service for deeplinking and invitation links

Repo: https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add branch-cordova-sdk
    $ npm install --save @ionic-native/branch-io
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { BranchIo } from '@ionic-native/branch-io';


constructor(private branch: BranchIo) { }

Instance Members

setDebug(enable)

for development and debugging only

Param Type Details
enable boolean

Enable debug

Returns: Promise<any>

disableTracking(disable)

Disable tracking

Param Type Details
disable boolean

disable tracking

Returns: Promise<any>

initSession()

Initializes Branch

Returns: Promise<any>

setRequestMetadata()

Set Request Metadata

Returns: Promise<any>

setCookieBasedMatching(linkDomain)

for better Android matching

Param Type Details
linkDomain string

LinkDomain at branch

Returns: Promise<any>

getFirstReferringParams()

First data

Returns: Promise<any>

getLatestReferringParams()

Latest data

Returns: Promise<any>

setIdentity(userId)

Set identy of user

Param Type Details
userId string

Returns: Promise<any>

logout()

Logout user

Returns: Promise<any>

userCompletedAction(eventName, metaData)

Registers a custom event

Param Type Details
eventName string
metaData any

Returns: Promise<any>

sendCommerceEvent(event, metaData)

Send Commerce Event

Param Type Details
event string
metaData any

Returns: Promise<any>

createBranchUniversalObject(properties)

create a branchUniversalObj variable to reference with other Branch methods

Param Type Details
properties BranchIoProperties

Returns: Promise<BranchUniversalObject>

loadRewards(bucket)

Load credits

Param Type Details
bucket any

Returns: Promise<any>

redeemRewards(value, bucket)

Redeem Rewards

Param Type Details
value string
bucket any

Returns: Promise<any>

creditHistory()

Show credit history

Returns: Promise<any>

BranchIoPromise

Param Type Details
$identity_id number (optional)
$one_time_use boolean (optional)
+click_timestamp number (optional)
+clicked_branch_link boolean (optional)
+is_first_session boolean (optional)
+match_guaranteed boolean (optional)
contentMetadata string (optional)
source string (optional)
~campaign string (optional)
~channel string (optional)
~creation_source string (optional)
~feature string (optional)
~id number (optional)
~referring_link: string (optional)

BranchIoAnalytics

Param Type Details
channel string (optional)
feature string (optional)
campaign string (optional)
stage string (optional)
tags string[] (optional)

BranchIoProperties

Param Type Details
contentMetadata { [x: string]: any; } (optional)

BranchUniversalObject

Param Type Details
generateShortUrl Promise<any>
registerView Promise<any>
showShareSheet Promise<any>
onShareSheetLaunched void
onShareSheetDismissed void
onLinkShareResponse void
onChannelSelected void
listOnSpotlight Promise<any>

API

Native

General