paulstelzer / capacitor-branch-deep-links

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@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
Param Type
eventName "init"
listenerFunc (event: BranchReferringParamsResponse) => void

Returns: any


addListener(...)

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

Returns: any


handleUrl(...)

handleUrl(options: BranchUrlParams) => any
Param Type
options BranchUrlParams

Returns: any


generateShortUrl(...)

generateShortUrl(options: BranchShortUrlParams) => any
Param Type
options BranchShortUrlParams

Returns: any


showShareSheet(...)

showShareSheet(options: BranchShowShareSheetParams) => any
Param Type
options BranchShowShareSheetParams

Returns: any


getStandardEvents()

getStandardEvents() => any

Returns: any


sendBranchEvent(...)

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

Returns: any


disableTracking(...)

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

Returns: any


setIdentity(...)

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

Returns: any


logout()

logout() => any

Returns: any


Interfaces

PluginListenerHandle

Prop Type
remove () => any

BranchUrlParams

Prop Type
url string

BranchShortUrlParams

Prop Type
analytics BranchShortUrlAnalytics
properties BranchShortUrlProperties

BranchShortUrlAnalytics

Prop Type
alias string
campaign string
channel string
duration number
feature string
stage string
tags any

BranchShortUrlProperties

Prop Type
$desktop_url string
$android_url string
$ios_url string
$ipad_url string
$match_duration number
custom_string string
custom_integer number
custom_boolean boolean

BranchShortUrlResponse

Prop Type
url string

BranchShowShareSheetParams

Prop Type
shareText string

BranchTrackingResponse

Prop Type
is_enabled boolean

BranchReferringParamsResponse

Prop Type
referringParams BranchReferringParams

BranchReferringParams

Prop Type
'+clicked_branch_link' boolean
'+is_first_session' boolean

BranchLoggedOutResponse

Prop Type
logged_out boolean

About


Languages

Language:Java 44.0%Language:Swift 37.3%Language:TypeScript 11.7%Language:Objective-C 3.0%Language:Ruby 2.8%Language:JavaScript 1.3%