1.0.0 • Published 4 years ago
Share package @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 BranchUrlParams 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 BranchShowShareSheetParams 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