@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
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
Returns: any
generateShortUrl(...)
generateShortUrl(options: BranchShortUrlParams) => any
Returns: any
showShareSheet(...)
showShareSheet(options: BranchShowShareSheetParams) => any
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()
Returns: any
Interfaces
PluginListenerHandle
Prop |
Type |
remove |
() => any |
BranchUrlParams
BranchShortUrlParams
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
BranchShowShareSheetParams
Prop |
Type |
shareText |
string |
BranchTrackingResponse
Prop |
Type |
is_enabled |
boolean |
BranchReferringParamsResponse
BranchReferringParams
Prop |
Type |
'+clicked_branch_link' |
boolean |
'+is_first_session' |
boolean |
BranchLoggedOutResponse
Prop |
Type |
logged_out |
boolean |