1.0.0 • Published 4 years ago

@innomobile/capacitor-branch-deep-links v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@innomobile/capacitor-branch-deep-links

Branch.io deep links

Please refer to Branch's SDK Documentation for Capacitor for installation. You do not need to add Branch to the MainActivitcy class in Android. Remove it if you added it.

Install

npm install @innomobile/capacitor-branch-deep-links
npx cap sync

Inside your project use

import {BranchDeepLinks, BranchShortUrlAnalytics} from '@innomobile/capacitor-branch-deep-links';

@Injectable({
  providedIn: 'root',
})
export class BranchService {
  
  async generateShortUrl(analytics, properties) {
    try {
      const response = await BranchDeepLinks.generateShortUrl({analytics, properties})
      return response.url
    } catch (err) {
      // do something on error
    }
  }
}

API

addListener(...)

addListener(eventName: 'init', listenerFunc: (event: BranchInitEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
ParamType
eventName"init"
listenerFunc(event: BranchReferringParamsResponse) => void

Returns: any


addListener(...)

addListener(eventName: 'initError', listenerFunc: (error: any) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
ParamType
eventName"initError"
listenerFunc(error: any) => void

Returns: any


handleUrl(...)

handleUrl(options: BranchUrlParams) => any
ParamType
optionsBranchUrlParams

Returns: any


generateShortUrl(...)

generateShortUrl(options: BranchShortUrlParams) => any
ParamType
optionsBranchShortUrlParams

Returns: any


showShareSheet(...)

showShareSheet(options: BranchShowShareSheetParams) => any
ParamType
optionsBranchShowShareSheetParams

Returns: any


getStandardEvents()

getStandardEvents() => any

Returns: any


sendBranchEvent(...)

sendBranchEvent(options: { eventName: string; metaData: { [key: string]: any; }; }) => any
ParamType
options{ eventName: string; metaData: { key: string: any; }; }

Returns: any


disableTracking(...)

disableTracking(options: { isEnabled: false; }) => any
ParamType
options{ isEnabled: false; }

Returns: any


setIdentity(...)

setIdentity(options: { newIdentity: string; }) => any
ParamType
options{ newIdentity: string; }

Returns: any


logout()

logout() => any

Returns: any


Interfaces

PluginListenerHandle

PropType
remove() => any

BranchUrlParams

PropType
urlstring

BranchShortUrlParams

PropType
analyticsBranchShortUrlAnalytics
propertiesBranchShortUrlProperties

BranchShortUrlAnalytics

PropType
aliasstring
campaignstring
channelstring
durationnumber
featurestring
stagestring
tagsany

BranchShortUrlProperties

PropType
$desktop_urlstring
$android_urlstring
$ios_urlstring
$ipad_urlstring
$match_durationnumber
custom_stringstring
custom_integernumber
custom_booleanboolean

BranchShortUrlResponse

PropType
urlstring

BranchShowShareSheetParams

PropType
shareTextstring

BranchTrackingResponse

PropType
is_enabledboolean

BranchReferringParamsResponse

PropType
referringParamsBranchReferringParams

BranchReferringParams

PropType
'+clicked_branch_link'boolean
'+is_first_session'boolean

BranchLoggedOutResponse

PropType
logged_outboolean
1.0.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago