diff --git a/README.md b/README.md
index 5c7bd7d9..de3ed7fd 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,7 @@
- [@nstudio/nativescript-aptabase](packages/nativescript-aptabase/README.md)
- [@nstudio/nativescript-barcodescanner](packages/nativescript-barcodescanner/README.md)
- [@nstudio/nativescript-blur](packages/nativescript-blur/README.md)
+- [@nstudio/nativescript-branch](packages/nativescript-branch/README.md)
- [@nstudio/nativescript-camera-plus](packages/nativescript-camera-plus/README.md)
- [@nstudio/nativescript-cardview](packages/nativescript-cardview/README.md)
- [@nstudio/nativescript-carousel](packages/nativescript-carousel/README.md)
diff --git a/apps/demo-angular/package.json b/apps/demo-angular/package.json
index deb16b9c..cced5edd 100644
--- a/apps/demo-angular/package.json
+++ b/apps/demo-angular/package.json
@@ -29,7 +29,8 @@
"@nstudio/nativescript-qr": "file:../../dist/packages/nativescript-qr",
"@nstudio/nativescript-tracking-transparency": "file:../../dist/packages/nativescript-tracking-transparency",
"@nstudio/nativescript-walletconnect": "file:../../dist/packages/nativescript-walletconnect",
- "@nstudio/nativescript-web-server": "file:../../dist/packages/nativescript-web-server"
+ "@nstudio/nativescript-web-server": "file:../../dist/packages/nativescript-web-server",
+ "@nstudio/nativescript-branch": "file:../../dist/packages/nativescript-branch"
},
"devDependencies": {
"@nativescript/android": "~8.9.0",
diff --git a/apps/demo-angular/src/app-routing.module.ts b/apps/demo-angular/src/app-routing.module.ts
index c6bd5f41..1074c1eb 100644
--- a/apps/demo-angular/src/app-routing.module.ts
+++ b/apps/demo-angular/src/app-routing.module.ts
@@ -4,36 +4,37 @@ import { NativeScriptRouterModule } from '@nativescript/angular';
import { HomeComponent } from './home.component';
const routes: Routes = [
- { path: '', redirectTo: '/home', pathMatch: 'full' },
- { path: 'home', component: HomeComponent },
- { path: 'nativescript-airship', loadChildren: () => import('./plugin-demos/nativescript-airship.module').then(m => m.NativescriptAirshipModule) },
- { path: 'nativescript-airship-adm', loadChildren: () => import('./plugin-demos/nativescript-airship-adm.module').then(m => m.NativescriptAirshipAdmModule) },
- { path: 'nativescript-airship-fcm', loadChildren: () => import('./plugin-demos/nativescript-airship-fcm.module').then(m => m.NativescriptAirshipFcmModule) },
- { path: 'nativescript-airship-hms', loadChildren: () => import('./plugin-demos/nativescript-airship-hms.module').then(m => m.NativescriptAirshipHmsModule) },
- { path: 'nativescript-appcues', loadChildren: () => import('./plugin-demos/nativescript-appcues.module').then(m => m.NativescriptAppcuesModule) },
- { path: 'nativescript-aptabase', loadChildren: () => import('./plugin-demos/nativescript-aptabase.module').then(m => m.NativescriptAptabaseModule) },
- { path: 'nativescript-barcodescanner', loadChildren: () => import('./plugin-demos/nativescript-barcodescanner.module').then(m => m.NativescriptBarcodescannerModule) },
- { path: 'nativescript-blur', loadChildren: () => import('./plugin-demos/nativescript-blur.module').then(m => m.NativescriptBlurModule) },
- { path: 'nativescript-camera-plus', loadChildren: () => import('./plugin-demos/nativescript-camera-plus.module').then(m => m.NativescriptCameraPlusModule) },
- { path: 'nativescript-cardview', loadChildren: () => import('./plugin-demos/nativescript-cardview.module').then(m => m.NativescriptCardviewModule) },
- { path: 'nativescript-carousel', loadChildren: () => import('./plugin-demos/nativescript-carousel.module').then(m => m.NativescriptCarouselModule) },
- { path: 'nativescript-checkbox', loadChildren: () => import('./plugin-demos/nativescript-checkbox.module').then(m => m.NativescriptCheckboxModule) },
- { path: 'nativescript-dynatrace', loadChildren: () => import('./plugin-demos/nativescript-dynatrace.module').then(m => m.NativescriptDynatraceModule) },
- { path: 'nativescript-embrace', loadChildren: () => import('./plugin-demos/nativescript-embrace.module').then(m => m.NativescriptEmbraceModule) },
- { path: 'nativescript-exoplayer', loadChildren: () => import('./plugin-demos/nativescript-exoplayer.module').then(m => m.NativescriptExoplayerModule) },
- { path: 'nativescript-fancyalert', loadChildren: () => import('./plugin-demos/nativescript-fancyalert.module').then(m => m.NativescriptFancyalertModule) },
- { path: 'nativescript-filterable-listpicker', loadChildren: () => import('./plugin-demos/nativescript-filterable-listpicker.module').then(m => m.NativescriptFilterableListpickerModule) },
- { path: 'nativescript-freshchat', loadChildren: () => import('./plugin-demos/nativescript-freshchat.module').then(m => m.NativescriptFreshchatModule) },
- { path: 'nativescript-input-mask', loadChildren: () => import('./plugin-demos/nativescript-input-mask.module').then(m => m.NativescriptInputMaskModule) },
- { path: 'nativescript-intercom', loadChildren: () => import('./plugin-demos/nativescript-intercom.module').then(m => m.NativescriptIntercomModule) },
- { path: 'nativescript-loading-indicator', loadChildren: () => import('./plugin-demos/nativescript-loading-indicator.module').then(m => m.NativescriptLoadingIndicatorModule) },
- { path: 'nativescript-onfido', loadChildren: () => import('./plugin-demos/nativescript-onfido.module').then(m => m.NativescriptOnfidoModule) },
- { path: 'nativescript-persona', loadChildren: () => import('./plugin-demos/nativescript-persona.module').then(m => m.NativescriptPersonaModule) },
- { path: 'nativescript-plaid', loadChildren: () => import('./plugin-demos/nativescript-plaid.module').then(m => m.NativescriptPlaidModule) },
- { path: 'nativescript-qr', loadChildren: () => import('./plugin-demos/nativescript-qr.module').then(m => m.NativescriptQrModule) },
- { path: 'nativescript-tracking-transparency', loadChildren: () => import('./plugin-demos/nativescript-tracking-transparency.module').then(m => m.NativescriptTrackingTransparencyModule) },
- { path: 'nativescript-walletconnect', loadChildren: () => import('./plugin-demos/nativescript-walletconnect.module').then(m => m.NativescriptWalletconnectModule) },
- { path: 'nativescript-web-server', loadChildren: () => import('./plugin-demos/nativescript-web-server.module').then(m => m.NativescriptWebServerModule) }
+ { path: '', redirectTo: '/home', pathMatch: 'full' },
+ { path: 'home', component: HomeComponent },
+ { path: 'nativescript-airship', loadChildren: () => import('./plugin-demos/nativescript-airship.module').then((m) => m.NativescriptAirshipModule) },
+ { path: 'nativescript-airship-adm', loadChildren: () => import('./plugin-demos/nativescript-airship-adm.module').then((m) => m.NativescriptAirshipAdmModule) },
+ { path: 'nativescript-airship-fcm', loadChildren: () => import('./plugin-demos/nativescript-airship-fcm.module').then((m) => m.NativescriptAirshipFcmModule) },
+ { path: 'nativescript-airship-hms', loadChildren: () => import('./plugin-demos/nativescript-airship-hms.module').then((m) => m.NativescriptAirshipHmsModule) },
+ { path: 'nativescript-appcues', loadChildren: () => import('./plugin-demos/nativescript-appcues.module').then((m) => m.NativescriptAppcuesModule) },
+ { path: 'nativescript-aptabase', loadChildren: () => import('./plugin-demos/nativescript-aptabase.module').then((m) => m.NativescriptAptabaseModule) },
+ { path: 'nativescript-barcodescanner', loadChildren: () => import('./plugin-demos/nativescript-barcodescanner.module').then((m) => m.NativescriptBarcodescannerModule) },
+ { path: 'nativescript-blur', loadChildren: () => import('./plugin-demos/nativescript-blur.module').then((m) => m.NativescriptBlurModule) },
+ { path: 'nativescript-branch', loadChildren: () => import('./plugin-demos/nativescript-branch.module').then((m) => m.NativescriptBranchModule) },
+ { path: 'nativescript-camera-plus', loadChildren: () => import('./plugin-demos/nativescript-camera-plus.module').then((m) => m.NativescriptCameraPlusModule) },
+ { path: 'nativescript-cardview', loadChildren: () => import('./plugin-demos/nativescript-cardview.module').then((m) => m.NativescriptCardviewModule) },
+ { path: 'nativescript-carousel', loadChildren: () => import('./plugin-demos/nativescript-carousel.module').then((m) => m.NativescriptCarouselModule) },
+ { path: 'nativescript-checkbox', loadChildren: () => import('./plugin-demos/nativescript-checkbox.module').then((m) => m.NativescriptCheckboxModule) },
+ { path: 'nativescript-dynatrace', loadChildren: () => import('./plugin-demos/nativescript-dynatrace.module').then((m) => m.NativescriptDynatraceModule) },
+ { path: 'nativescript-embrace', loadChildren: () => import('./plugin-demos/nativescript-embrace.module').then((m) => m.NativescriptEmbraceModule) },
+ { path: 'nativescript-exoplayer', loadChildren: () => import('./plugin-demos/nativescript-exoplayer.module').then((m) => m.NativescriptExoplayerModule) },
+ { path: 'nativescript-fancyalert', loadChildren: () => import('./plugin-demos/nativescript-fancyalert.module').then((m) => m.NativescriptFancyalertModule) },
+ { path: 'nativescript-filterable-listpicker', loadChildren: () => import('./plugin-demos/nativescript-filterable-listpicker.module').then((m) => m.NativescriptFilterableListpickerModule) },
+ { path: 'nativescript-freshchat', loadChildren: () => import('./plugin-demos/nativescript-freshchat.module').then((m) => m.NativescriptFreshchatModule) },
+ { path: 'nativescript-input-mask', loadChildren: () => import('./plugin-demos/nativescript-input-mask.module').then((m) => m.NativescriptInputMaskModule) },
+ { path: 'nativescript-intercom', loadChildren: () => import('./plugin-demos/nativescript-intercom.module').then((m) => m.NativescriptIntercomModule) },
+ { path: 'nativescript-loading-indicator', loadChildren: () => import('./plugin-demos/nativescript-loading-indicator.module').then((m) => m.NativescriptLoadingIndicatorModule) },
+ { path: 'nativescript-onfido', loadChildren: () => import('./plugin-demos/nativescript-onfido.module').then((m) => m.NativescriptOnfidoModule) },
+ { path: 'nativescript-persona', loadChildren: () => import('./plugin-demos/nativescript-persona.module').then((m) => m.NativescriptPersonaModule) },
+ { path: 'nativescript-plaid', loadChildren: () => import('./plugin-demos/nativescript-plaid.module').then((m) => m.NativescriptPlaidModule) },
+ { path: 'nativescript-qr', loadChildren: () => import('./plugin-demos/nativescript-qr.module').then((m) => m.NativescriptQrModule) },
+ { path: 'nativescript-tracking-transparency', loadChildren: () => import('./plugin-demos/nativescript-tracking-transparency.module').then((m) => m.NativescriptTrackingTransparencyModule) },
+ { path: 'nativescript-walletconnect', loadChildren: () => import('./plugin-demos/nativescript-walletconnect.module').then((m) => m.NativescriptWalletconnectModule) },
+ { path: 'nativescript-web-server', loadChildren: () => import('./plugin-demos/nativescript-web-server.module').then((m) => m.NativescriptWebServerModule) },
];
@NgModule({
diff --git a/apps/demo-angular/src/home.component.ts b/apps/demo-angular/src/home.component.ts
index 0ca7b493..65e32076 100644
--- a/apps/demo-angular/src/home.component.ts
+++ b/apps/demo-angular/src/home.component.ts
@@ -6,89 +6,92 @@ import { Component } from '@angular/core';
})
export class HomeComponent {
demos = [
- {
- name: 'nativescript-airship'
- },
- {
- name: 'nativescript-airship-adm'
- },
- {
- name: 'nativescript-airship-fcm'
- },
- {
- name: 'nativescript-airship-hms'
- },
- {
- name: 'nativescript-appcues'
- },
- {
- name: 'nativescript-aptabase'
- },
- {
- name: 'nativescript-barcodescanner'
- },
- {
- name: 'nativescript-blur'
- },
- {
- name: 'nativescript-camera-plus'
- },
- {
- name: 'nativescript-cardview'
- },
- {
- name: 'nativescript-carousel'
- },
- {
- name: 'nativescript-checkbox'
- },
- {
- name: 'nativescript-dynatrace'
- },
- {
- name: 'nativescript-embrace'
- },
- {
- name: 'nativescript-exoplayer'
- },
- {
- name: 'nativescript-fancyalert'
- },
- {
- name: 'nativescript-filterable-listpicker'
- },
- {
- name: 'nativescript-freshchat'
- },
- {
- name: 'nativescript-input-mask'
- },
- {
- name: 'nativescript-intercom'
- },
- {
- name: 'nativescript-loading-indicator'
- },
- {
- name: 'nativescript-onfido'
- },
- {
- name: 'nativescript-persona'
- },
- {
- name: 'nativescript-plaid'
- },
- {
- name: 'nativescript-qr'
- },
- {
- name: 'nativescript-tracking-transparency'
- },
- {
- name: 'nativescript-walletconnect'
- },
- {
- name: 'nativescript-web-server'
- }
-];
-}
\ No newline at end of file
+ {
+ name: 'nativescript-airship',
+ },
+ {
+ name: 'nativescript-airship-adm',
+ },
+ {
+ name: 'nativescript-airship-fcm',
+ },
+ {
+ name: 'nativescript-airship-hms',
+ },
+ {
+ name: 'nativescript-appcues',
+ },
+ {
+ name: 'nativescript-aptabase',
+ },
+ {
+ name: 'nativescript-barcodescanner',
+ },
+ {
+ name: 'nativescript-blur',
+ },
+ {
+ name: 'nativescript-branch',
+ },
+ {
+ name: 'nativescript-camera-plus',
+ },
+ {
+ name: 'nativescript-cardview',
+ },
+ {
+ name: 'nativescript-carousel',
+ },
+ {
+ name: 'nativescript-checkbox',
+ },
+ {
+ name: 'nativescript-dynatrace',
+ },
+ {
+ name: 'nativescript-embrace',
+ },
+ {
+ name: 'nativescript-exoplayer',
+ },
+ {
+ name: 'nativescript-fancyalert',
+ },
+ {
+ name: 'nativescript-filterable-listpicker',
+ },
+ {
+ name: 'nativescript-freshchat',
+ },
+ {
+ name: 'nativescript-input-mask',
+ },
+ {
+ name: 'nativescript-intercom',
+ },
+ {
+ name: 'nativescript-loading-indicator',
+ },
+ {
+ name: 'nativescript-onfido',
+ },
+ {
+ name: 'nativescript-persona',
+ },
+ {
+ name: 'nativescript-plaid',
+ },
+ {
+ name: 'nativescript-qr',
+ },
+ {
+ name: 'nativescript-tracking-transparency',
+ },
+ {
+ name: 'nativescript-walletconnect',
+ },
+ {
+ name: 'nativescript-web-server',
+ },
+ ];
+}
diff --git a/apps/demo-angular/src/plugin-demos/nativescript-branch.component.html b/apps/demo-angular/src/plugin-demos/nativescript-branch.component.html
new file mode 100644
index 00000000..ce9fe7f7
--- /dev/null
+++ b/apps/demo-angular/src/plugin-demos/nativescript-branch.component.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/apps/demo-angular/src/plugin-demos/nativescript-branch.component.ts b/apps/demo-angular/src/plugin-demos/nativescript-branch.component.ts
new file mode 100644
index 00000000..69b61a69
--- /dev/null
+++ b/apps/demo-angular/src/plugin-demos/nativescript-branch.component.ts
@@ -0,0 +1,17 @@
+import { Component, NgZone } from '@angular/core';
+import { DemoSharedNativescriptBranch } from '@demo/shared';
+import {} from '@nstudio/nativescript-branch';
+
+@Component({
+ selector: 'demo-nativescript-branch',
+ templateUrl: 'nativescript-branch.component.html',
+})
+export class NativescriptBranchComponent {
+ demoShared: DemoSharedNativescriptBranch;
+
+ constructor(private _ngZone: NgZone) {}
+
+ ngOnInit() {
+ this.demoShared = new DemoSharedNativescriptBranch();
+ }
+}
diff --git a/apps/demo-angular/src/plugin-demos/nativescript-branch.module.ts b/apps/demo-angular/src/plugin-demos/nativescript-branch.module.ts
new file mode 100644
index 00000000..8295a4f0
--- /dev/null
+++ b/apps/demo-angular/src/plugin-demos/nativescript-branch.module.ts
@@ -0,0 +1,10 @@
+import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
+import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
+import { NativescriptBranchComponent } from './nativescript-branch.component';
+
+@NgModule({
+ imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: NativescriptBranchComponent }])],
+ declarations: [NativescriptBranchComponent],
+ schemas: [NO_ERRORS_SCHEMA],
+})
+export class NativescriptBranchModule {}
diff --git a/apps/demo-angular/tsconfig.json b/apps/demo-angular/tsconfig.json
index a87eb737..0fcbf0c7 100644
--- a/apps/demo-angular/tsconfig.json
+++ b/apps/demo-angular/tsconfig.json
@@ -34,7 +34,8 @@
"@nstudio/nativescript-freshchat": ["../../packages/nativescript-freshchat/index.d.ts"],
"@nstudio/nativescript-persona": ["../../packages/nativescript-persona/index.d.ts"],
"@nstudio/nativescript-walletconnect": ["../../packages/nativescript-walletconnect/index.d.ts"],
- "@nstudio/nativescript-web-server": ["../../packages/nativescript-web-server/index.d.ts"]
+ "@nstudio/nativescript-web-server": ["../../packages/nativescript-web-server/index.d.ts"],
+ "@nstudio/nativescript-branch": ["../../packages/nativescript-branch/index.d.ts"]
}
},
"files": ["./references.d.ts", "./src/main.ts", "./src/polyfills.ts"],
diff --git a/apps/demo/package.json b/apps/demo/package.json
index 66209af2..758e434f 100644
--- a/apps/demo/package.json
+++ b/apps/demo/package.json
@@ -16,8 +16,8 @@
"@nstudio/nativescript-cardview": "file:../../packages/nativescript-cardview",
"@nstudio/nativescript-carousel": "file:../../packages/nativescript-carousel",
"@nstudio/nativescript-checkbox": "file:../../packages/nativescript-checkbox",
- "@nstudio/nativescript-dynatrace": "file:../../packages/nativescript-dynatrace",
- "@nstudio/nativescript-embrace": "file:../../packages/nativescript-embrace",
+ "@nstudio/nativescript-dynatrace": "file:../../dist/packages/nativescript-dynatrace",
+ "@nstudio/nativescript-embrace": "file:../../dist/packages/nativescript-embrace",
"@nstudio/nativescript-exoplayer": "file:../../packages/nativescript-exoplayer",
"@nstudio/nativescript-fancyalert": "file:../../packages/nativescript-fancyalert",
"@nstudio/nativescript-filterable-listpicker": "file:../../packages/nativescript-filterable-listpicker",
@@ -30,7 +30,8 @@
"@nstudio/nativescript-qr": "file:../../packages/nativescript-qr",
"@nstudio/nativescript-tracking-transparency": "file:../../packages/nativescript-tracking-transparency",
"@nstudio/nativescript-walletconnect": "file:../../packages/nativescript-walletconnect",
- "@nstudio/nativescript-web-server": "file:../../packages/nativescript-web-server"
+ "@nstudio/nativescript-web-server": "file:../../packages/nativescript-web-server",
+ "@nstudio/nativescript-branch": "file:../../packages/nativescript-branch"
},
"devDependencies": {
"@nativescript/android": "~8.9.0",
diff --git a/apps/demo/src/main-page.xml b/apps/demo/src/main-page.xml
index 93e68642..6e41143c 100644
--- a/apps/demo/src/main-page.xml
+++ b/apps/demo/src/main-page.xml
@@ -33,6 +33,7 @@
+
diff --git a/apps/demo/src/plugin-demos/nativescript-branch.ts b/apps/demo/src/plugin-demos/nativescript-branch.ts
new file mode 100644
index 00000000..d25a0785
--- /dev/null
+++ b/apps/demo/src/plugin-demos/nativescript-branch.ts
@@ -0,0 +1,10 @@
+import { Observable, EventData, Page } from '@nativescript/core';
+import { DemoSharedNativescriptBranch } from '@demo/shared';
+import {} from '@nstudio/nativescript-branch';
+
+export function navigatingTo(args: EventData) {
+ const page = args.object;
+ page.bindingContext = new DemoModel();
+}
+
+export class DemoModel extends DemoSharedNativescriptBranch {}
diff --git a/apps/demo/src/plugin-demos/nativescript-branch.xml b/apps/demo/src/plugin-demos/nativescript-branch.xml
new file mode 100644
index 00000000..fe792bcc
--- /dev/null
+++ b/apps/demo/src/plugin-demos/nativescript-branch.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/demo/tsconfig.json b/apps/demo/tsconfig.json
index 4d424a40..4f37fb3d 100644
--- a/apps/demo/tsconfig.json
+++ b/apps/demo/tsconfig.json
@@ -36,7 +36,8 @@
"@nstudio/nativescript-freshchat": ["../../packages/nativescript-freshchat/index.d.ts"],
"@nstudio/nativescript-persona": ["../../packages/nativescript-persona/index.d.ts"],
"@nstudio/nativescript-walletconnect": ["../../packages/nativescript-walletconnect/index.d.ts"],
- "@nstudio/nativescript-web-server": ["../../packages/nativescript-web-server/index.d.ts"]
+ "@nstudio/nativescript-web-server": ["../../packages/nativescript-web-server/index.d.ts"],
+ "@nstudio/nativescript-branch": ["../../packages/nativescript-branch/index.d.ts"]
}
}
}
diff --git a/packages/nativescript-branch/.eslintrc.json b/packages/nativescript-branch/.eslintrc.json
new file mode 100644
index 00000000..be41074b
--- /dev/null
+++ b/packages/nativescript-branch/.eslintrc.json
@@ -0,0 +1,18 @@
+{
+ "extends": ["../../.eslintrc.json"],
+ "ignorePatterns": ["!**/*", "node_modules/**/*"],
+ "overrides": [
+ {
+ "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
+ "rules": {}
+ },
+ {
+ "files": ["*.ts", "*.tsx"],
+ "rules": {}
+ },
+ {
+ "files": ["*.js", "*.jsx"],
+ "rules": {}
+ }
+ ]
+}
diff --git a/packages/nativescript-branch/README.md b/packages/nativescript-branch/README.md
new file mode 100644
index 00000000..6a208eec
--- /dev/null
+++ b/packages/nativescript-branch/README.md
@@ -0,0 +1,13 @@
+# @nstudio/nativescript-branch
+
+```javascript
+npm install @nstudio/nativescript-branch
+```
+
+## Usage
+
+// TODO
+
+## License
+
+Apache License Version 2.0
diff --git a/packages/nativescript-branch/common.ts b/packages/nativescript-branch/common.ts
new file mode 100644
index 00000000..ce8007b1
--- /dev/null
+++ b/packages/nativescript-branch/common.ts
@@ -0,0 +1,3 @@
+import { Observable } from '@nativescript/core';
+
+export class NativescriptBranchCommon extends Observable {}
diff --git a/packages/nativescript-branch/index.android.ts b/packages/nativescript-branch/index.android.ts
new file mode 100644
index 00000000..c6b81bf6
--- /dev/null
+++ b/packages/nativescript-branch/index.android.ts
@@ -0,0 +1,1923 @@
+import { Application, Color, ImageSource, Utils, View } from '@nativescript/core';
+import { EventType, CurrencyCode, ProductCategory } from '.';
+
+const native_ = Symbol('[[native]]');
+let didInit = false;
+
+let dateFormat: java.text.SimpleDateFormat | undefined;
+const fromISO8601UTC = function (date: string) {
+ if (dateFormat === undefined) {
+ dateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
+ dateFormat.setTimeZone(java.util.TimeZone.getTimeZone('UTC'));
+ }
+ return dateFormat.parse(date);
+};
+
+function getBranchEventType(event: EventType): io.branch.referral.util.BRANCH_STANDARD_EVENT {
+ if (typeof event === 'string') {
+ switch (event) {
+ case 'AchieveLevel':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.ACHIEVE_LEVEL;
+ case 'AddPaymentInfo':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.ADD_PAYMENT_INFO;
+ case 'AddToCart':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.ADD_TO_CART;
+ case 'AddToWishlist':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.ADD_TO_WISHLIST;
+ case 'ClickAd':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.CLICK_AD;
+ case 'CompleteRegistration':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.COMPLETE_REGISTRATION;
+ case 'CompleteStream':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.COMPLETE_STREAM;
+ case 'CompleteTutorial':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.COMPLETE_TUTORIAL;
+ case 'InitiatePurchase':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.INITIATE_PURCHASE;
+ case 'InitiateStream':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.INITIATE_STREAM;
+ case 'Invite':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.INVITE;
+ case 'Login':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.LOGIN;
+ case 'Purchase':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.PURCHASE;
+ case 'Rate':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.RATE;
+ case 'Reserve':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.RESERVE;
+ case 'Search':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.SEARCH;
+ case 'Share':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.SHARE;
+ case 'SpendCredits':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.SPEND_CREDITS;
+ case 'StartTrial':
+ return io.branch.referral.util.BRANCH_STANDARD_EVENT.START_TRIAL;
+ }
+ }
+}
+
+function getCurrencyCode(currency: CurrencyCode): io.branch.referral.util.CurrencyType {
+ switch (currency) {
+ case 'AED':
+ return io.branch.referral.util.CurrencyType.AED;
+ case 'AFN':
+ return io.branch.referral.util.CurrencyType.AFN;
+ case 'USD':
+ return io.branch.referral.util.CurrencyType.USD;
+ case 'ALL':
+ return io.branch.referral.util.CurrencyType.ALL;
+ case 'AMD':
+ return io.branch.referral.util.CurrencyType.AMD;
+ case 'ANG':
+ return io.branch.referral.util.CurrencyType.ANG;
+ case 'AOA':
+ return io.branch.referral.util.CurrencyType.AOA;
+ case 'ARS':
+ return io.branch.referral.util.CurrencyType.ARS;
+ case 'AUD':
+ return io.branch.referral.util.CurrencyType.AUD;
+ case 'AWG':
+ return io.branch.referral.util.CurrencyType.AWG;
+ case 'AZN':
+ return io.branch.referral.util.CurrencyType.AZN;
+ case 'BAM':
+ return io.branch.referral.util.CurrencyType.BAM;
+ case 'BBD':
+ return io.branch.referral.util.CurrencyType.BBD;
+ case 'BDT':
+ return io.branch.referral.util.CurrencyType.BDT;
+ case 'BGN':
+ return io.branch.referral.util.CurrencyType.BGN;
+ case 'BHD':
+ return io.branch.referral.util.CurrencyType.BHD;
+ case 'BIF':
+ return io.branch.referral.util.CurrencyType.BIF;
+ case 'BMD':
+ return io.branch.referral.util.CurrencyType.BMD;
+ case 'BND':
+ return io.branch.referral.util.CurrencyType.BND;
+ case 'BOB':
+ return io.branch.referral.util.CurrencyType.BOB;
+ case 'BOV':
+ return io.branch.referral.util.CurrencyType.BOV;
+ case 'BRL':
+ return io.branch.referral.util.CurrencyType.BRL;
+ case 'BSD':
+ return io.branch.referral.util.CurrencyType.BSD;
+ case 'BTN':
+ return io.branch.referral.util.CurrencyType.BTN;
+ case 'BWP':
+ return io.branch.referral.util.CurrencyType.BWP;
+ case 'BYN':
+ return io.branch.referral.util.CurrencyType.BYN;
+ case 'BYR':
+ return io.branch.referral.util.CurrencyType.BYR;
+ case 'CAD':
+ return io.branch.referral.util.CurrencyType.CAD;
+ case 'CDF':
+ return io.branch.referral.util.CurrencyType.CDF;
+ case 'CHE':
+ return io.branch.referral.util.CurrencyType.CHE;
+ case 'CHF':
+ return io.branch.referral.util.CurrencyType.CHF;
+ case 'CHW':
+ return io.branch.referral.util.CurrencyType.CHW;
+ case 'CLF':
+ return io.branch.referral.util.CurrencyType.CLF;
+ case 'CLP':
+ return io.branch.referral.util.CurrencyType.CLP;
+ case 'CNY':
+ return io.branch.referral.util.CurrencyType.CNY;
+ case 'COP':
+ return io.branch.referral.util.CurrencyType.COP;
+ case 'COU':
+ return io.branch.referral.util.CurrencyType.COU;
+ case 'CRC':
+ return io.branch.referral.util.CurrencyType.CRC;
+ case 'CUC':
+ return io.branch.referral.util.CurrencyType.CUC;
+ case 'CUP':
+ return io.branch.referral.util.CurrencyType.CUP;
+ case 'CVE':
+ return io.branch.referral.util.CurrencyType.CVE;
+ case 'CZK':
+ return io.branch.referral.util.CurrencyType.CZK;
+ case 'DJF':
+ return io.branch.referral.util.CurrencyType.DJF;
+ case 'DKK':
+ return io.branch.referral.util.CurrencyType.DKK;
+ case 'DOP':
+ return io.branch.referral.util.CurrencyType.DOP;
+ case 'DZD':
+ return io.branch.referral.util.CurrencyType.DZD;
+ case 'EGP':
+ return io.branch.referral.util.CurrencyType.EGP;
+ case 'ERN':
+ return io.branch.referral.util.CurrencyType.ERN;
+ case 'ETB':
+ return io.branch.referral.util.CurrencyType.ETB;
+ case 'EUR':
+ return io.branch.referral.util.CurrencyType.EUR;
+ case 'FJD':
+ return io.branch.referral.util.CurrencyType.FJD;
+ case 'FKP':
+ return io.branch.referral.util.CurrencyType.FKP;
+ case 'GBP':
+ return io.branch.referral.util.CurrencyType.GBP;
+ case 'GEL':
+ return io.branch.referral.util.CurrencyType.GEL;
+ case 'GHS':
+ return io.branch.referral.util.CurrencyType.GHS;
+ case 'GIP':
+ return io.branch.referral.util.CurrencyType.GIP;
+ case 'GMD':
+ return io.branch.referral.util.CurrencyType.GMD;
+ case 'GNF':
+ return io.branch.referral.util.CurrencyType.GNF;
+ case 'GTQ':
+ return io.branch.referral.util.CurrencyType.GTQ;
+ case 'GYD':
+ return io.branch.referral.util.CurrencyType.GYD;
+ case 'HKD':
+ return io.branch.referral.util.CurrencyType.HKD;
+ case 'HNL':
+ return io.branch.referral.util.CurrencyType.HNL;
+ case 'HRK':
+ return io.branch.referral.util.CurrencyType.HRK;
+ case 'HTG':
+ return io.branch.referral.util.CurrencyType.HTG;
+ case 'HUF':
+ return io.branch.referral.util.CurrencyType.HUF;
+ case 'IDR':
+ return io.branch.referral.util.CurrencyType.IDR;
+ case 'ILS':
+ return io.branch.referral.util.CurrencyType.ILS;
+ case 'INR':
+ return io.branch.referral.util.CurrencyType.INR;
+ case 'IQD':
+ return io.branch.referral.util.CurrencyType.IQD;
+ case 'IRR':
+ return io.branch.referral.util.CurrencyType.IRR;
+ case 'ISK':
+ return io.branch.referral.util.CurrencyType.ISK;
+ case 'JMD':
+ return io.branch.referral.util.CurrencyType.JMD;
+ case 'JOD':
+ return io.branch.referral.util.CurrencyType.JOD;
+ case 'JPY':
+ return io.branch.referral.util.CurrencyType.JPY;
+ case 'KES':
+ return io.branch.referral.util.CurrencyType.KES;
+ case 'KGS':
+ return io.branch.referral.util.CurrencyType.KGS;
+ case 'KHR':
+ return io.branch.referral.util.CurrencyType.KHR;
+ case 'KMF':
+ return io.branch.referral.util.CurrencyType.KMF;
+ case 'KPW':
+ return io.branch.referral.util.CurrencyType.KPW;
+ case 'KRW':
+ return io.branch.referral.util.CurrencyType.KRW;
+ case 'KWD':
+ return io.branch.referral.util.CurrencyType.KWD;
+ case 'KYD':
+ return io.branch.referral.util.CurrencyType.KYD;
+ case 'KZT':
+ return io.branch.referral.util.CurrencyType.KZT;
+ case 'LAK':
+ return io.branch.referral.util.CurrencyType.LAK;
+ case 'LBP':
+ return io.branch.referral.util.CurrencyType.LBP;
+ case 'LKR':
+ return io.branch.referral.util.CurrencyType.LKR;
+ case 'LRD':
+ return io.branch.referral.util.CurrencyType.LRD;
+ case 'LSL':
+ return io.branch.referral.util.CurrencyType.LSL;
+ case 'LYD':
+ return io.branch.referral.util.CurrencyType.LYD;
+ case 'MAD':
+ return io.branch.referral.util.CurrencyType.MAD;
+ case 'MDL':
+ return io.branch.referral.util.CurrencyType.MDL;
+ case 'MGA':
+ return io.branch.referral.util.CurrencyType.MGA;
+ case 'MKD':
+ return io.branch.referral.util.CurrencyType.MKD;
+ case 'MNT':
+ return io.branch.referral.util.CurrencyType.MNT;
+ case 'MOP':
+ return io.branch.referral.util.CurrencyType.MOP;
+ case 'MRO':
+ return io.branch.referral.util.CurrencyType.MRO;
+ case 'MUR':
+ return io.branch.referral.util.CurrencyType.MUR;
+ case 'MVR':
+ return io.branch.referral.util.CurrencyType.MVR;
+ case 'MWK':
+ return io.branch.referral.util.CurrencyType.MWK;
+ case 'MXN':
+ return io.branch.referral.util.CurrencyType.MXN;
+ case 'MXV':
+ return io.branch.referral.util.CurrencyType.MXV;
+ case 'MYR':
+ return io.branch.referral.util.CurrencyType.MYR;
+ case 'MZN':
+ return io.branch.referral.util.CurrencyType.MZN;
+ case 'NAD':
+ return io.branch.referral.util.CurrencyType.NAD;
+ case 'NGN':
+ return io.branch.referral.util.CurrencyType.NGN;
+ case 'NIO':
+ return io.branch.referral.util.CurrencyType.NIO;
+ case 'NOK':
+ return io.branch.referral.util.CurrencyType.NOK;
+ case 'NPR':
+ return io.branch.referral.util.CurrencyType.NPR;
+ case 'NZD':
+ return io.branch.referral.util.CurrencyType.NZD;
+ case 'OMR':
+ return io.branch.referral.util.CurrencyType.OMR;
+ case 'PAB':
+ return io.branch.referral.util.CurrencyType.PAB;
+ case 'PEN':
+ return io.branch.referral.util.CurrencyType.PEN;
+ case 'PGK':
+ return io.branch.referral.util.CurrencyType.PGK;
+ case 'PHP':
+ return io.branch.referral.util.CurrencyType.PHP;
+ case 'PKR':
+ return io.branch.referral.util.CurrencyType.PKR;
+ case 'PLN':
+ return io.branch.referral.util.CurrencyType.PLN;
+ case 'PYG':
+ return io.branch.referral.util.CurrencyType.PYG;
+ case 'QAR':
+ return io.branch.referral.util.CurrencyType.QAR;
+ case 'RON':
+ return io.branch.referral.util.CurrencyType.RON;
+ case 'RSD':
+ return io.branch.referral.util.CurrencyType.RSD;
+ case 'RUB':
+ return io.branch.referral.util.CurrencyType.RUB;
+ case 'RWF':
+ return io.branch.referral.util.CurrencyType.RWF;
+ case 'SAR':
+ return io.branch.referral.util.CurrencyType.SAR;
+ case 'SBD':
+ return io.branch.referral.util.CurrencyType.SBD;
+ case 'SCR':
+ return io.branch.referral.util.CurrencyType.SCR;
+ case 'SDG':
+ return io.branch.referral.util.CurrencyType.SDG;
+ case 'SEK':
+ return io.branch.referral.util.CurrencyType.SEK;
+ case 'SGD':
+ return io.branch.referral.util.CurrencyType.SGD;
+ case 'SHP':
+ return io.branch.referral.util.CurrencyType.SHP;
+ case 'SLL':
+ return io.branch.referral.util.CurrencyType.SLL;
+ case 'SOS':
+ return io.branch.referral.util.CurrencyType.SOS;
+ case 'SRD':
+ return io.branch.referral.util.CurrencyType.SRD;
+ case 'SSP':
+ return io.branch.referral.util.CurrencyType.SSP;
+ case 'STD':
+ return io.branch.referral.util.CurrencyType.STD;
+ case 'SYP':
+ return io.branch.referral.util.CurrencyType.SYP;
+ case 'SZL':
+ return io.branch.referral.util.CurrencyType.SZL;
+ case 'THB':
+ return io.branch.referral.util.CurrencyType.THB;
+ case 'TJS':
+ return io.branch.referral.util.CurrencyType.TJS;
+ case 'TMT':
+ return io.branch.referral.util.CurrencyType.TMT;
+ case 'TND':
+ return io.branch.referral.util.CurrencyType.TND;
+ case 'TOP':
+ return io.branch.referral.util.CurrencyType.TOP;
+ case 'TRY':
+ return io.branch.referral.util.CurrencyType.TRY;
+ case 'TTD':
+ return io.branch.referral.util.CurrencyType.TTD;
+ case 'TWD':
+ return io.branch.referral.util.CurrencyType.TWD;
+ case 'TZS':
+ return io.branch.referral.util.CurrencyType.TZS;
+ case 'UAH':
+ return io.branch.referral.util.CurrencyType.UAH;
+ case 'UGX':
+ return io.branch.referral.util.CurrencyType.UGX;
+ case 'USN':
+ return io.branch.referral.util.CurrencyType.USN;
+ case 'UYI':
+ return io.branch.referral.util.CurrencyType.UYI;
+ case 'UYU':
+ return io.branch.referral.util.CurrencyType.UYU;
+ case 'UZS':
+ return io.branch.referral.util.CurrencyType.UZS;
+ case 'VEF':
+ return io.branch.referral.util.CurrencyType.VEF;
+ case 'VND':
+ return io.branch.referral.util.CurrencyType.VND;
+ case 'VUV':
+ return io.branch.referral.util.CurrencyType.VUV;
+ case 'WST':
+ return io.branch.referral.util.CurrencyType.WST;
+ case 'XAF':
+ return io.branch.referral.util.CurrencyType.XAF;
+ case 'XAG':
+ return io.branch.referral.util.CurrencyType.XAG;
+ case 'XAU':
+ return io.branch.referral.util.CurrencyType.XAU;
+ case 'XBA':
+ return io.branch.referral.util.CurrencyType.XBA;
+ case 'XBB':
+ return io.branch.referral.util.CurrencyType.XBB;
+ case 'XBC':
+ return io.branch.referral.util.CurrencyType.XBC;
+ case 'XBD':
+ return io.branch.referral.util.CurrencyType.XBD;
+ case 'XCD':
+ return io.branch.referral.util.CurrencyType.XCD;
+ case 'XDR':
+ return io.branch.referral.util.CurrencyType.XDR;
+ case 'XFU':
+ return io.branch.referral.util.CurrencyType.XFU;
+ case 'XOF':
+ return io.branch.referral.util.CurrencyType.XOF;
+ case 'XPD':
+ return io.branch.referral.util.CurrencyType.XPD;
+ case 'XPF':
+ return io.branch.referral.util.CurrencyType.XPF;
+ case 'XPT':
+ return io.branch.referral.util.CurrencyType.XPT;
+ case 'XSU':
+ return io.branch.referral.util.CurrencyType.XSU;
+ case 'XTS':
+ return io.branch.referral.util.CurrencyType.XTS;
+ case 'XUA':
+ return io.branch.referral.util.CurrencyType.XUA;
+ case 'XXX':
+ return io.branch.referral.util.CurrencyType.XXX;
+ case 'YER':
+ return io.branch.referral.util.CurrencyType.YER;
+ case 'ZAR':
+ return io.branch.referral.util.CurrencyType.ZAR;
+ case 'ZMW':
+ return io.branch.referral.util.CurrencyType.ZMW;
+ }
+}
+
+export class LinkProperties {
+ [native_]: io.branch.referral.util.LinkProperties;
+
+ constructor(linkProperties: io.branch.referral.util.LinkProperties | null = null) {
+ if (linkProperties) {
+ this[native_] = linkProperties;
+ } else {
+ this[native_] = new io.branch.referral.util.LinkProperties();
+ }
+ }
+
+ static fromNative(native: io.branch.referral.util.LinkProperties): LinkProperties {
+ return new LinkProperties(native);
+ }
+
+ get native() {
+ return this[native_];
+ }
+
+ get alias(): string {
+ return this.native.getAlias();
+ }
+
+ set alias(value: string) {
+ this.native.setAlias(value);
+ }
+
+ get campaign(): string {
+ return this.native.getCampaign();
+ }
+
+ set campaign(value: string) {
+ this.native.setCampaign(value);
+ }
+
+ get channel(): string {
+ return this.native.getChannel();
+ }
+
+ set channel(value: string) {
+ this.native.setChannel(value);
+ }
+
+ get controlParams(): Record {
+ const params = this.native.getControlParams();
+ if (!params) {
+ return {};
+ }
+ return Utils.dataDeserialize(params);
+ }
+
+ set controlParams(value: Record) {
+ if (value) {
+ const keys = Object.keys(value);
+ for (const key of keys) {
+ const item = value[key];
+ this.native.addControlParameter(key, Utils.dataSerialize(item));
+ }
+ }
+ }
+
+ get feature(): string {
+ return this.native.getFeature();
+ }
+
+ set feature(value: string) {
+ this.native.setFeature(value);
+ }
+
+ get matchDuration(): number {
+ return this.native.getMatchDuration();
+ }
+
+ set matchDuration(value: number) {
+ this.native.setDuration(value);
+ }
+
+ get stage(): string {
+ return this.native.getStage();
+ }
+
+ set stage(value: string) {
+ this.native.setStage(value);
+ }
+
+ get tags(): Array {
+ return Utils.dataDeserialize(this.native.getTags());
+ }
+
+ set tags(value: Array) {
+ if (Array.isArray(value)) {
+ for (const tag of value) {
+ this.native.addTag(tag);
+ }
+ }
+ }
+
+ addControlParam(key: string, value: string): void {
+ this.native.addControlParameter(key, value);
+ }
+}
+
+export class ContentMetadata {
+ [native_]: io.branch.referral.util.ContentMetadata;
+
+ constructor(metadata: io.branch.referral.util.ContentMetadata | null = null) {
+ if (metadata) {
+ this[native_] = metadata;
+ } else {
+ this[native_] = new io.branch.referral.util.ContentMetadata();
+ }
+ }
+
+ get native() {
+ return this[native_];
+ }
+
+ get addressCity(): string {
+ return this.native.addressCity;
+ }
+
+ set addressCity(value: string) {
+ this.native.addressCity = value;
+ }
+
+ get addressCountry(): string {
+ return this.native.addressCountry;
+ }
+ set addressCountry(value: string) {
+ this.native.addressCountry = value;
+ }
+
+ get addressPostalCode(): string {
+ return this.native.addressPostalCode;
+ }
+ set addressPostalCode(value: string) {
+ this.native.addressPostalCode = value;
+ }
+
+ get addressRegion(): string {
+ return this.native.addressRegion;
+ }
+ set addressRegion(value: string) {
+ this.native.addressRegion = value;
+ }
+
+ get addressStreet(): string {
+ return this.native.addressStreet;
+ }
+ set addressStreet(value: string) {
+ this.native.addressStreet = value;
+ }
+
+ get condition(): string {
+ switch (this.native.condition) {
+ case io.branch.referral.util.ContentMetadata.CONDITION.FAIR:
+ return 'Excellent';
+ case io.branch.referral.util.ContentMetadata.CONDITION.GOOD:
+ return 'Good';
+ case io.branch.referral.util.ContentMetadata.CONDITION.NEW:
+ return 'New';
+ case io.branch.referral.util.ContentMetadata.CONDITION.POOR:
+ return 'Poor';
+ case io.branch.referral.util.ContentMetadata.CONDITION.REFURBISHED:
+ return 'Refurbished';
+ case io.branch.referral.util.ContentMetadata.CONDITION.USED:
+ return 'Used';
+ case io.branch.referral.util.ContentMetadata.CONDITION.EXCELLENT:
+ return 'Excellent';
+ }
+ }
+ set condition(value: string) {
+ switch (value) {
+ case 'Excellent':
+ this.native.condition = io.branch.referral.util.ContentMetadata.CONDITION.EXCELLENT;
+ break;
+ case 'Good':
+ this.native.condition = io.branch.referral.util.ContentMetadata.CONDITION.GOOD;
+ break;
+ case 'New':
+ this.native.condition = io.branch.referral.util.ContentMetadata.CONDITION.NEW;
+ break;
+ case 'Poor':
+ this.native.condition = io.branch.referral.util.ContentMetadata.CONDITION.POOR;
+ break;
+ case 'Refurbished':
+ this.native.condition = io.branch.referral.util.ContentMetadata.CONDITION.REFURBISHED;
+ break;
+ case 'Used':
+ this.native.condition = io.branch.referral.util.ContentMetadata.CONDITION.USED;
+ break;
+ case 'Fair':
+ this.native.condition = io.branch.referral.util.ContentMetadata.CONDITION.FAIR;
+ break;
+ }
+ }
+
+ get contentSchema(): string {
+ // todo
+ return '';
+ }
+ set contentSchema(value: string) {
+ this.native.setContentSchema(value);
+ }
+
+ get currency(): string {
+ switch (this.native.currencyType) {
+ case io.branch.referral.util.CurrencyType.AED:
+ return 'AED';
+ case io.branch.referral.util.CurrencyType.AED:
+ return 'AED';
+ case io.branch.referral.util.CurrencyType.AFN:
+ return 'AFN';
+ case io.branch.referral.util.CurrencyType.USD:
+ return 'USD';
+ case io.branch.referral.util.CurrencyType.ALL:
+ return 'ALL';
+ case io.branch.referral.util.CurrencyType.AMD:
+ return 'AMD';
+ case io.branch.referral.util.CurrencyType.ANG:
+ return 'ANG';
+ case io.branch.referral.util.CurrencyType.AOA:
+ return 'AOA';
+ case io.branch.referral.util.CurrencyType.ARS:
+ return 'ARS';
+ case io.branch.referral.util.CurrencyType.AUD:
+ return 'AUD';
+ case io.branch.referral.util.CurrencyType.AWG:
+ return 'AWG';
+ case io.branch.referral.util.CurrencyType.AZN:
+ return 'AZN';
+ case io.branch.referral.util.CurrencyType.BAM:
+ return 'BAM';
+ case io.branch.referral.util.CurrencyType.BBD:
+ return 'BBD';
+ case io.branch.referral.util.CurrencyType.BDT:
+ return 'BDT';
+ case io.branch.referral.util.CurrencyType.BGN:
+ return 'BGN';
+ case io.branch.referral.util.CurrencyType.BHD:
+ return 'BHD';
+ case io.branch.referral.util.CurrencyType.BIF:
+ return 'BIF';
+ case io.branch.referral.util.CurrencyType.BMD:
+ return 'BMD';
+ case io.branch.referral.util.CurrencyType.BND:
+ return 'BND';
+ case io.branch.referral.util.CurrencyType.BOB:
+ return 'BOB';
+ case io.branch.referral.util.CurrencyType.BOV:
+ return 'BOV';
+ case io.branch.referral.util.CurrencyType.BRL:
+ return 'BRL';
+ case io.branch.referral.util.CurrencyType.BSD:
+ return 'BSD';
+ case io.branch.referral.util.CurrencyType.BTN:
+ return 'BTN';
+ case io.branch.referral.util.CurrencyType.BWP:
+ return 'BWP';
+ case io.branch.referral.util.CurrencyType.BYN:
+ return 'BYN';
+ case io.branch.referral.util.CurrencyType.BYR:
+ return 'BYR';
+ case io.branch.referral.util.CurrencyType.CAD:
+ return 'CAD';
+ case io.branch.referral.util.CurrencyType.CDF:
+ return 'CDF';
+ case io.branch.referral.util.CurrencyType.CHE:
+ return 'CHE';
+ case io.branch.referral.util.CurrencyType.CHF:
+ return 'CHF';
+ case io.branch.referral.util.CurrencyType.CHW:
+ return 'CHW';
+ case io.branch.referral.util.CurrencyType.CLF:
+ return 'CLF';
+ case io.branch.referral.util.CurrencyType.CLP:
+ return 'CLP';
+ case io.branch.referral.util.CurrencyType.CNY:
+ return 'CNY';
+ case io.branch.referral.util.CurrencyType.COP:
+ return 'COP';
+ case io.branch.referral.util.CurrencyType.COU:
+ return 'COU';
+ case io.branch.referral.util.CurrencyType.CRC:
+ return 'CRC';
+ case io.branch.referral.util.CurrencyType.CUC:
+ return 'CUC';
+ case io.branch.referral.util.CurrencyType.CUP:
+ return 'CUP';
+ case io.branch.referral.util.CurrencyType.CVE:
+ return 'CVE';
+ case io.branch.referral.util.CurrencyType.CZK:
+ return 'CZK';
+ case io.branch.referral.util.CurrencyType.DJF:
+ return 'DJF';
+ case io.branch.referral.util.CurrencyType.DKK:
+ return 'DKK';
+ case io.branch.referral.util.CurrencyType.DOP:
+ return 'DOP';
+ case io.branch.referral.util.CurrencyType.DZD:
+ return 'DZD';
+ case io.branch.referral.util.CurrencyType.EGP:
+ return 'EGP';
+ case io.branch.referral.util.CurrencyType.ERN:
+ return 'ERN';
+ case io.branch.referral.util.CurrencyType.ETB:
+ return 'ETB';
+ case io.branch.referral.util.CurrencyType.EUR:
+ return 'EUR';
+ case io.branch.referral.util.CurrencyType.FJD:
+ return 'FJD';
+ case io.branch.referral.util.CurrencyType.FKP:
+ return 'FKP';
+ case io.branch.referral.util.CurrencyType.GBP:
+ return 'GBP';
+ case io.branch.referral.util.CurrencyType.GEL:
+ return 'GEL';
+ case io.branch.referral.util.CurrencyType.GHS:
+ return 'GHS';
+ case io.branch.referral.util.CurrencyType.GIP:
+ return 'GIP';
+ case io.branch.referral.util.CurrencyType.GMD:
+ return 'GMD';
+ case io.branch.referral.util.CurrencyType.GNF:
+ return 'GNF';
+ case io.branch.referral.util.CurrencyType.GTQ:
+ return 'GTQ';
+ case io.branch.referral.util.CurrencyType.GYD:
+ return 'GYD';
+ case io.branch.referral.util.CurrencyType.HKD:
+ return 'HKD';
+ case io.branch.referral.util.CurrencyType.HNL:
+ return 'HNL';
+ case io.branch.referral.util.CurrencyType.HRK:
+ return 'HRK';
+ case io.branch.referral.util.CurrencyType.HTG:
+ return 'HTG';
+ case io.branch.referral.util.CurrencyType.HUF:
+ return 'HUF';
+ case io.branch.referral.util.CurrencyType.IDR:
+ return 'IDR';
+ case io.branch.referral.util.CurrencyType.ILS:
+ return 'ILS';
+ case io.branch.referral.util.CurrencyType.INR:
+ return 'INR';
+ case io.branch.referral.util.CurrencyType.IQD:
+ return 'IQD';
+ case io.branch.referral.util.CurrencyType.IRR:
+ return 'IRR';
+ case io.branch.referral.util.CurrencyType.ISK:
+ return 'ISK';
+ case io.branch.referral.util.CurrencyType.JMD:
+ return 'JMD';
+ case io.branch.referral.util.CurrencyType.JOD:
+ return 'JOD';
+ case io.branch.referral.util.CurrencyType.JPY:
+ return 'JPY';
+ case io.branch.referral.util.CurrencyType.KES:
+ return 'KES';
+ case io.branch.referral.util.CurrencyType.KGS:
+ return 'KGS';
+ case io.branch.referral.util.CurrencyType.KHR:
+ return 'KHR';
+ case io.branch.referral.util.CurrencyType.KMF:
+ return 'KMF';
+ case io.branch.referral.util.CurrencyType.KPW:
+ return 'KPW';
+ case io.branch.referral.util.CurrencyType.KRW:
+ return 'KRW';
+ case io.branch.referral.util.CurrencyType.KWD:
+ return 'KWD';
+ case io.branch.referral.util.CurrencyType.KYD:
+ return 'KYD';
+ case io.branch.referral.util.CurrencyType.KZT:
+ return 'KZT';
+ case io.branch.referral.util.CurrencyType.LAK:
+ return 'LAK';
+ case io.branch.referral.util.CurrencyType.LBP:
+ return 'LBP';
+ case io.branch.referral.util.CurrencyType.LKR:
+ return 'LKR';
+ case io.branch.referral.util.CurrencyType.LRD:
+ return 'LRD';
+ case io.branch.referral.util.CurrencyType.LSL:
+ return 'LSL';
+ case io.branch.referral.util.CurrencyType.LYD:
+ return 'LYD';
+ case io.branch.referral.util.CurrencyType.MAD:
+ return 'MAD';
+ case io.branch.referral.util.CurrencyType.MDL:
+ return 'MDL';
+ case io.branch.referral.util.CurrencyType.MGA:
+ return 'MGA';
+ case io.branch.referral.util.CurrencyType.MKD:
+ return 'MKD';
+ case io.branch.referral.util.CurrencyType.MNT:
+ return 'MNT';
+ case io.branch.referral.util.CurrencyType.MOP:
+ return 'MOP';
+ case io.branch.referral.util.CurrencyType.MRO:
+ return 'MRO';
+ case io.branch.referral.util.CurrencyType.MUR:
+ return 'MUR';
+ case io.branch.referral.util.CurrencyType.MVR:
+ return 'MVR';
+ case io.branch.referral.util.CurrencyType.MWK:
+ return 'MWK';
+ case io.branch.referral.util.CurrencyType.MXN:
+ return 'MXN';
+ case io.branch.referral.util.CurrencyType.MXV:
+ return 'MXV';
+ case io.branch.referral.util.CurrencyType.MYR:
+ return 'MYR';
+ case io.branch.referral.util.CurrencyType.MZN:
+ return 'MZN';
+ case io.branch.referral.util.CurrencyType.NAD:
+ return 'NAD';
+ case io.branch.referral.util.CurrencyType.NGN:
+ return 'NGN';
+ case io.branch.referral.util.CurrencyType.NIO:
+ return 'NIO';
+ case io.branch.referral.util.CurrencyType.NOK:
+ return 'NOK';
+ case io.branch.referral.util.CurrencyType.NPR:
+ return 'NPR';
+ case io.branch.referral.util.CurrencyType.NZD:
+ return 'NZD';
+ case io.branch.referral.util.CurrencyType.OMR:
+ return 'OMR';
+ case io.branch.referral.util.CurrencyType.PAB:
+ return 'PAB';
+ case io.branch.referral.util.CurrencyType.PEN:
+ return 'PEN';
+ case io.branch.referral.util.CurrencyType.PGK:
+ return 'PGK';
+ case io.branch.referral.util.CurrencyType.PHP:
+ return 'PHP';
+ case io.branch.referral.util.CurrencyType.PKR:
+ return 'PKR';
+ case io.branch.referral.util.CurrencyType.PLN:
+ return 'PLN';
+ case io.branch.referral.util.CurrencyType.PYG:
+ return 'PYG';
+ case io.branch.referral.util.CurrencyType.QAR:
+ return 'QAR';
+ case io.branch.referral.util.CurrencyType.RON:
+ return 'RON';
+ case io.branch.referral.util.CurrencyType.RSD:
+ return 'RSD';
+ case io.branch.referral.util.CurrencyType.RUB:
+ return 'RUB';
+ case io.branch.referral.util.CurrencyType.RWF:
+ return 'RWF';
+ case io.branch.referral.util.CurrencyType.SAR:
+ return 'SAR';
+ case io.branch.referral.util.CurrencyType.SBD:
+ return 'SBD';
+ case io.branch.referral.util.CurrencyType.SCR:
+ return 'SCR';
+ case io.branch.referral.util.CurrencyType.SDG:
+ return 'SDG';
+ case io.branch.referral.util.CurrencyType.SEK:
+ return 'SEK';
+ case io.branch.referral.util.CurrencyType.SGD:
+ return 'SGD';
+ case io.branch.referral.util.CurrencyType.SHP:
+ return 'SHP';
+ case io.branch.referral.util.CurrencyType.SLL:
+ return 'SLL';
+ case io.branch.referral.util.CurrencyType.SOS:
+ return 'SOS';
+ case io.branch.referral.util.CurrencyType.SRD:
+ return 'SRD';
+ case io.branch.referral.util.CurrencyType.SSP:
+ return 'SSP';
+ case io.branch.referral.util.CurrencyType.STD:
+ return 'STD';
+ case io.branch.referral.util.CurrencyType.SYP:
+ return 'SYP';
+ case io.branch.referral.util.CurrencyType.SZL:
+ return 'SZL';
+ case io.branch.referral.util.CurrencyType.THB:
+ return 'THB';
+ case io.branch.referral.util.CurrencyType.TJS:
+ return 'TJS';
+ case io.branch.referral.util.CurrencyType.TMT:
+ return 'TMT';
+ case io.branch.referral.util.CurrencyType.TND:
+ return 'TND';
+ case io.branch.referral.util.CurrencyType.TOP:
+ return 'TOP';
+ case io.branch.referral.util.CurrencyType.TRY:
+ return 'TRY';
+ case io.branch.referral.util.CurrencyType.TTD:
+ return 'TTD';
+ case io.branch.referral.util.CurrencyType.TWD:
+ return 'TWD';
+ case io.branch.referral.util.CurrencyType.TZS:
+ return 'TZS';
+ case io.branch.referral.util.CurrencyType.UAH:
+ return 'UAH';
+ case io.branch.referral.util.CurrencyType.UGX:
+ return 'UGX';
+ case io.branch.referral.util.CurrencyType.USN:
+ return 'USN';
+ case io.branch.referral.util.CurrencyType.UYI:
+ return 'UYI';
+ case io.branch.referral.util.CurrencyType.UYU:
+ return 'UYU';
+ case io.branch.referral.util.CurrencyType.UZS:
+ return 'UZS';
+ case io.branch.referral.util.CurrencyType.VEF:
+ return 'VEF';
+ case io.branch.referral.util.CurrencyType.VND:
+ return 'VND';
+ case io.branch.referral.util.CurrencyType.VUV:
+ return 'VUV';
+ case io.branch.referral.util.CurrencyType.WST:
+ return 'WST';
+ case io.branch.referral.util.CurrencyType.XAF:
+ return 'XAF';
+ case io.branch.referral.util.CurrencyType.XAG:
+ return 'XAG';
+ case io.branch.referral.util.CurrencyType.XAU:
+ return 'XAU';
+ case io.branch.referral.util.CurrencyType.XBA:
+ return 'XBA';
+ case io.branch.referral.util.CurrencyType.XBB:
+ return 'XBB';
+ case io.branch.referral.util.CurrencyType.XBC:
+ return 'XBC';
+ case io.branch.referral.util.CurrencyType.XBD:
+ return 'XBD';
+ case io.branch.referral.util.CurrencyType.XCD:
+ return 'XCD';
+ case io.branch.referral.util.CurrencyType.XDR:
+ return 'XDR';
+ case io.branch.referral.util.CurrencyType.XFU:
+ return 'XFU';
+ case io.branch.referral.util.CurrencyType.XOF:
+ return 'XOF';
+ case io.branch.referral.util.CurrencyType.XPD:
+ return 'XPD';
+ case io.branch.referral.util.CurrencyType.XPF:
+ return 'XPF';
+ case io.branch.referral.util.CurrencyType.XPT:
+ return 'XPT';
+ case io.branch.referral.util.CurrencyType.XSU:
+ return 'XSU';
+ case io.branch.referral.util.CurrencyType.XTS:
+ return 'XTS';
+ case io.branch.referral.util.CurrencyType.XUA:
+ return 'XUA';
+ case io.branch.referral.util.CurrencyType.XXX:
+ return 'XXX';
+ case io.branch.referral.util.CurrencyType.YER:
+ return 'YER';
+ case io.branch.referral.util.CurrencyType.ZAR:
+ return 'ZAR';
+ case io.branch.referral.util.CurrencyType.ZMW:
+ return 'ZMW';
+ }
+ }
+
+ set currency(value: string) {
+ const type = getCurrencyCode(value as never);
+ if (type) {
+ this.native.currencyType = type;
+ }
+ }
+
+ get customMetadata(): Record {
+ return Utils.dataDeserialize(this.native.getCustomMetadata());
+ }
+ set customMetadata(value: Record) {
+ if (value) {
+ const keys = Object.keys(value);
+ for (const key of keys) {
+ const item = value[key];
+ this.native.addCustomMetadata(key, item);
+ }
+ }
+ }
+
+ get imageCaptions(): Array {
+ return Utils.dataDeserialize(this.native.getImageCaptions());
+ }
+ set imageCaptions(value: Array) {
+ if (Array.isArray(value)) {
+ for (const caption of value) {
+ this.native.addImageCaptions(caption);
+ }
+ }
+ }
+
+ get latitude(): number {
+ return this.native.latitude.doubleValue();
+ }
+ set latitude(value: number) {
+ this.native.latitude = double(value);
+ }
+
+ get longitude(): number {
+ return this.native.longitude.doubleValue();
+ }
+ set longitude(value: number) {
+ this.native.longitude = double(value);
+ }
+
+ get price() {
+ return this.native.price.doubleValue();
+ }
+ set price(value: number) {
+ this.native.price = double(value);
+ }
+
+ get productBrand(): string {
+ return this.native.productBrand;
+ }
+ set productBrand(value: string) {
+ this.native.productBrand = value;
+ }
+
+ get productCategory(): ProductCategory {
+ switch (this.native.productCategory) {
+ case io.branch.referral.util.ProductCategory.ANIMALS_AND_PET_SUPPLIES:
+ return 'AnimalSupplies';
+ case io.branch.referral.util.ProductCategory.APPAREL_AND_ACCESSORIES:
+ return 'Apparel';
+ case io.branch.referral.util.ProductCategory.ARTS_AND_ENTERTAINMENT:
+ return 'ArtsEntertainment';
+ case io.branch.referral.util.ProductCategory.BABY_AND_TODDLER:
+ return 'BabyToddler';
+ case io.branch.referral.util.ProductCategory.BUSINESS_AND_INDUSTRIAL:
+ return 'BusinessIndustrial';
+ case io.branch.referral.util.ProductCategory.CAMERAS_AND_OPTICS:
+ return 'CamerasOptics';
+ case io.branch.referral.util.ProductCategory.ELECTRONICS:
+ return 'Electronics';
+ case io.branch.referral.util.ProductCategory.FOOD_BEVERAGES_AND_TOBACCO:
+ return 'FoodBeverageTobacco';
+ case io.branch.referral.util.ProductCategory.FURNITURE:
+ return 'Furniture';
+ case io.branch.referral.util.ProductCategory.HARDWARE:
+ return 'Hardware';
+ case io.branch.referral.util.ProductCategory.HEALTH_AND_BEAUTY:
+ return 'HealthBeauty';
+ case io.branch.referral.util.ProductCategory.HOME_AND_GARDEN:
+ return 'HomeGarden';
+ case io.branch.referral.util.ProductCategory.LUGGAGE_AND_BAGS:
+ return 'LuggageBags';
+ case io.branch.referral.util.ProductCategory.MATURE:
+ return 'Mature';
+ case io.branch.referral.util.ProductCategory.MEDIA:
+ return 'Media';
+ case io.branch.referral.util.ProductCategory.OFFICE_SUPPLIES:
+ return 'OfficeSupplies';
+ case io.branch.referral.util.ProductCategory.RELIGIOUS_AND_CEREMONIAL:
+ return 'Religious';
+ case io.branch.referral.util.ProductCategory.SOFTWARE:
+ return 'Software';
+ case io.branch.referral.util.ProductCategory.SPORTING_GOODS:
+ return 'SportingGoods';
+ case io.branch.referral.util.ProductCategory.TOYS_AND_GAMES:
+ return 'ToysGames';
+ case io.branch.referral.util.ProductCategory.VEHICLES_AND_PARTS:
+ return 'VehiclesParts';
+ }
+ }
+ set productCategory(value: ProductCategory) {
+ if (typeof value === 'string') {
+ switch (value) {
+ case 'AnimalSupplies':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.ANIMALS_AND_PET_SUPPLIES;
+ break;
+ case 'Apparel':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.APPAREL_AND_ACCESSORIES;
+ break;
+ case 'ArtsEntertainment':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.ARTS_AND_ENTERTAINMENT;
+ break;
+ case 'BabyToddler':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.BABY_AND_TODDLER;
+ break;
+ case 'BusinessIndustrial':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.BUSINESS_AND_INDUSTRIAL;
+ break;
+ case 'CamerasOptics':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.CAMERAS_AND_OPTICS;
+ break;
+ case 'Electronics':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.ELECTRONICS;
+ break;
+ case 'FoodBeverageTobacco':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.FOOD_BEVERAGES_AND_TOBACCO;
+ break;
+ case 'Furniture':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.FURNITURE;
+ break;
+ case 'Hardware':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.HARDWARE;
+ break;
+ case 'HealthBeauty':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.HEALTH_AND_BEAUTY;
+ break;
+ case 'HomeGarden':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.HOME_AND_GARDEN;
+ break;
+ case 'LuggageBags':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.LUGGAGE_AND_BAGS;
+ break;
+ case 'Mature':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.MATURE;
+ break;
+ case 'Media':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.MEDIA;
+ break;
+ case 'OfficeSupplies':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.OFFICE_SUPPLIES;
+ break;
+ case 'Religious':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.RELIGIOUS_AND_CEREMONIAL;
+ break;
+ case 'Software':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.SOFTWARE;
+ break;
+ case 'SportingGoods':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.SPORTING_GOODS;
+ break;
+ case 'ToysGames':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.TOYS_AND_GAMES;
+ break;
+ case 'VehiclesParts':
+ this.native.productCategory = io.branch.referral.util.ProductCategory.VEHICLES_AND_PARTS;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ get productName(): string {
+ return this.native.productName;
+ }
+ set productName(value: string) {
+ this.native.productName = value;
+ }
+
+ get productVariant(): string {
+ return this.native.productVariant;
+ }
+ set productVariant(value: string) {
+ this.native.productVariant = value;
+ }
+
+ get quantity(): number {
+ return this.native.quantity.doubleValue();
+ }
+ set quantity(value: number) {
+ this.native.quantity = double(value);
+ }
+
+ get rating(): number {
+ return this.native.rating.doubleValue();
+ }
+ set rating(value: number) {
+ this.native.rating = double(value);
+ }
+
+ get ratingAverage(): number {
+ return this.native.ratingAverage.doubleValue();
+ }
+ set ratingAverage(value: number) {
+ this.native.ratingAverage = double(value);
+ }
+
+ get ratingCount(): number {
+ return this.native.ratingCount.doubleValue();
+ }
+ set ratingCount(value: number) {
+ this.native.ratingCount = double(value);
+ }
+
+ get ratingMax(): number {
+ return this.native.ratingMax.doubleValue();
+ }
+ set ratingMax(value: number) {
+ this.native.ratingMax = double(value);
+ }
+
+ get sku(): string {
+ return this.native.sku;
+ }
+ set sku(value: string) {
+ this.native.sku = value;
+ }
+
+ static fromNative(native: io.branch.referral.util.ContentMetadata): ContentMetadata {
+ return new ContentMetadata(native);
+ }
+}
+
+export class UniversalObject {
+ [native_]: io.branch.indexing.BranchUniversalObject;
+ constructor(link: io.branch.indexing.BranchUniversalObject | null = null) {
+ if (link) {
+ this[native_] = link;
+ } else {
+ this[native_] = new io.branch.indexing.BranchUniversalObject();
+ }
+ this[native_];
+ }
+
+ static fromNative(native: io.branch.indexing.BranchUniversalObject): UniversalObject {
+ return new UniversalObject(native);
+ }
+
+ get native() {
+ return this[native_];
+ }
+
+ share(linkProperties: LinkProperties, shareText?: string) {
+ return new Promise((resolve, reject) => {
+ const style = new io.branch.referral.util.ShareSheetStyle(Utils.android.getCurrentActivity(), shareText ?? '', '');
+
+ this.native.showShareSheet(
+ Utils.android.getCurrentActivity(),
+ linkProperties.native,
+ style,
+ new io.branch.referral.Branch.BranchLinkShareListener({
+ onShareLinkDialogLaunched() {},
+ onShareLinkDialogDismissed() {
+ resolve({
+ channel: null,
+ completed: false,
+ });
+ },
+ onLinkShareResponse(link: string, channel: string, error: io.branch.referral.BranchError) {
+ if (error) {
+ reject(error);
+ } else {
+ resolve({
+ channel: channel,
+ completed: true,
+ });
+ }
+ },
+ onChannelSelected(param0: string) {},
+ })
+ );
+ });
+ }
+
+ get canonicalIdentifier() {
+ return this.native.getCanonicalIdentifier();
+ }
+
+ set canonicalIdentifier(value: string) {
+ this.native.setCanonicalIdentifier(value);
+ }
+
+ get canonicalUrl(): string {
+ return this.native.getCanonicalUrl();
+ }
+ set canonicalUrl(value: string) {
+ this.native.setCanonicalUrl(value);
+ }
+
+ get contentDescription(): string {
+ // todo: check if this is correct
+ return this.native.getDescription();
+ }
+
+ set contentDescription(value: string) {
+ this.native.setContentDescription(value);
+ }
+
+ get contentIndexMode() {
+ if (this.native.isPublicallyIndexable()) {
+ return 'public';
+ } else if (this.native.isLocallyIndexable()) {
+ return 'private';
+ }
+ }
+
+ set contentIndexMode(value: 'public' | 'private') {
+ switch (value) {
+ case 'public':
+ this.native.setContentIndexingMode(io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE.PUBLIC);
+ break;
+ case 'private':
+ this.native.setContentIndexingMode(io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE.PRIVATE);
+ break;
+ }
+ }
+
+ get contentMetadata() {
+ return ContentMetadata.fromNative(this.native.getContentMetadata());
+ }
+
+ set contentMetadata(value: ContentMetadata) {
+ this.native.setContentMetadata(value[native_]);
+ }
+
+ get currency(): string {
+ return this.native.getCurrencyType();
+ }
+
+ set currency(value: string) {
+ this.native.setPrice(this.native.getPrice(), value);
+ }
+
+ get expirationDate(): Date {
+ return new Date(this.native.getExpirationTime());
+ }
+
+ set expirationDate(value: Date) {
+ this.native.setContentExpiration(fromISO8601UTC(value.toISOString()));
+ }
+
+ get imageUrl(): string {
+ return this.native.getImageUrl();
+ }
+
+ set imageUrl(value: string) {
+ this.native.setContentImageUrl(value);
+ }
+
+ get keywords(): Array {
+ return Utils.dataDeserialize(this.native.getKeywords);
+ }
+
+ get locallyIndex(): boolean {
+ return this.native.isLocallyIndexable();
+ }
+
+ set locallyIndex(value: boolean) {
+ this.native.setLocalIndexMode(value ? io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE.PUBLIC : io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE.PRIVATE);
+ }
+
+ get metadata(): Record {
+ const metadata = this.native.getMetadata();
+ if (!metadata) {
+ return {};
+ }
+ return Utils.dataDeserialize(metadata);
+ }
+
+ get price(): number {
+ return this.native.getPrice();
+ }
+
+ set price(value: number) {
+ this.native.setPrice(value, this.native.getCurrencyType());
+ }
+
+ get publiclyIndex(): boolean {
+ return this.native.isPublicallyIndexable();
+ }
+ set publiclyIndex(value: boolean) {
+ this.native.setContentIndexingMode(value ? io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE.PUBLIC : io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE.PRIVATE);
+ }
+
+ get title(): string {
+ return this.native.getTitle();
+ }
+
+ set title(value: string) {
+ this.native.setTitle(value);
+ }
+
+ get type(): string {
+ return this.native.getType();
+ }
+
+ set type(value: string) {
+ this.native.setContentType(value);
+ }
+}
+
+export class Event {
+ [native_]: io.branch.referral.util.BranchEvent;
+ constructor(event: io.branch.referral.util.BranchEvent | EventType | null = null, eventName: string | null = null) {
+ if (typeof event === 'string') {
+ switch (event) {
+ case 'OptIn':
+ this[native_] = new io.branch.referral.util.BranchEvent('OPT_IN');
+ break;
+ case 'OptOut':
+ this[native_] = new io.branch.referral.util.BranchEvent('OPT_OUT');
+ break;
+ case 'Custom':
+ this[native_] = new io.branch.referral.util.BranchEvent(eventName ?? 'CUSTOM');
+ if (!eventName) {
+ console.warn('Custom event name is not provided. Please provide a valid event name.');
+ }
+ break;
+ default:
+ this[native_] = new io.branch.referral.util.BranchEvent(getBranchEventType(event));
+ break;
+ }
+ } else if (event) {
+ this[native_] = event;
+ }
+ }
+
+ static fromNative(native: io.branch.referral.util.BranchEvent): Event {
+ return new Event(native);
+ }
+
+ logEvent() {
+ return new Promise((resolve, reject) => {
+ this.native.logEvent(
+ Utils.android.getApplicationContext(),
+ new io.branch.referral.util.BranchEvent.BranchLogEventCallback({
+ onSuccess(status: number) {
+ resolve(status === 200);
+ },
+ onFailure(param0: java.lang.Exception) {
+ reject(param0);
+ },
+ })
+ );
+ });
+ }
+
+ get native() {
+ return this[native_];
+ }
+
+ private __adType: 'banner' | 'interstitial' | 'rewarded' | 'native' | 'none' = 'none';
+
+ get adType() {
+ return this.native['__adType'] ?? this.__adType ?? 'none';
+ }
+
+ set adType(value: 'banner' | 'interstitial' | 'rewarded' | 'native' | 'none') {
+ switch (value) {
+ case 'banner':
+ this.native.setAdType(io.branch.referral.util.AdType.BANNER);
+ this.__adType = 'banner';
+ break;
+ case 'interstitial':
+ this.native.setAdType(io.branch.referral.util.AdType.INTERSTITIAL);
+ this.__adType = 'interstitial';
+ break;
+ case 'rewarded':
+ this.native.setAdType(io.branch.referral.util.AdType.REWARDED_VIDEO);
+ this.__adType = 'rewarded';
+ break;
+ case 'native':
+ this.native.setAdType(io.branch.referral.util.AdType.NATIVE);
+ this.__adType = 'native';
+ break;
+ case 'none':
+ this.native.setAdType(null);
+ this.__adType = 'none';
+ break;
+ }
+ }
+
+ get affiliation() {
+ // todo
+ return '';
+ }
+
+ set affiliation(value: string) {
+ this.native.setAffiliation(value);
+ }
+
+ get alias() {
+ // todo
+ return '';
+ }
+
+ set alias(value: string) {
+ this.native.setCustomerEventAlias(value);
+ }
+
+ get contentItems(): Array {
+ // todo
+ return [];
+ }
+
+ set contentItems(value: Array) {
+ if (Array.isArray(value)) {
+ this.native.addContentItems(value.map((item) => item.native));
+ }
+ }
+
+ get coupon(): string {
+ // todo
+ return '';
+ }
+
+ set coupon(value: string) {
+ this.native.setCoupon(value);
+ }
+
+ get currency(): string {
+ // todo
+ return '';
+ }
+
+ set currency(value: string) {
+ const currencyCode = getCurrencyCode(value as CurrencyCode);
+ if (!currencyCode) {
+ return;
+ }
+ this.native.setCurrency(currencyCode);
+ }
+
+ get customData(): Record {
+ // todo
+ return {};
+ }
+
+ set customData(value: Record) {
+ if (value && typeof value === 'object') {
+ const keys = Object.keys(value);
+ for (const key of keys) {
+ const item = value[key];
+ this.native.addCustomDataProperty(key, item);
+ }
+ }
+ }
+
+ get revenue() {
+ // todo
+ return 0;
+ }
+
+ set revenue(value: number) {
+ this.native.setRevenue(value);
+ }
+
+ get searchQuery(): string {
+ // todo
+ return '';
+ }
+
+ set searchQuery(value: string) {
+ this.native.setSearchQuery(value);
+ }
+
+ get shipping() {
+ // todo
+ return 0;
+ }
+
+ set shipping(value: number) {
+ this.native.setShipping(value);
+ }
+
+ get tax() {
+ // todo
+ return 0;
+ }
+
+ set tax(value: number) {
+ this.native.setTax(value);
+ }
+
+ get transactionID() {
+ // todo
+ return '0';
+ }
+ set transactionID(value: string) {
+ this.native.setTransactionID(value);
+ }
+}
+
+export class QRCode {
+ [native_]: io.branch.referral.QRCode.BranchQRCode;
+
+ constructor(qrCode: io.branch.referral.QRCode.BranchQRCode | null = null) {
+ if (qrCode) {
+ this[native_] = qrCode;
+ } else {
+ this[native_] = new io.branch.referral.QRCode.BranchQRCode();
+ }
+ }
+
+ static fromNative(native: io.branch.referral.QRCode.BranchQRCode): QRCode {
+ return new QRCode(native);
+ }
+
+ get native() {
+ return this[native_];
+ }
+
+ _backgroundColor: Color | string | null = new Color('white');
+ get backgroundColor() {
+ // todo
+ return this._backgroundColor;
+ }
+
+ set backgroundColor(value: Color | string) {
+ if (value instanceof Color) {
+ this.native.setBackgroundColor(value.android);
+ this._backgroundColor = value;
+ } else {
+ const color = new Color(value);
+ this.native.setBackgroundColor(color.android);
+ this._backgroundColor = color;
+ }
+ }
+
+ set centerLogo(value: string) {
+ this.native.setCenterLogo(value);
+ }
+
+ get centerLogo(): string {
+ // todo
+ return '';
+ }
+
+ private _codeColor: Color | string | null = new Color('black');
+ get codeColor() {
+ return this._codeColor;
+ }
+
+ set codeColor(value: Color | string) {
+ if (value instanceof Color) {
+ this.native.setCodeColor(value.android);
+ this._codeColor = value;
+ } else {
+ const color = new Color(value);
+ this.native.setCodeColor(color.android);
+ this._codeColor = color;
+ }
+ }
+
+ private _imageFormat: 'png' | 'jpeg' = 'png';
+ get imageFormat() {
+ return this._imageFormat;
+ }
+
+ set imageFormat(value: 'png' | 'jpeg') {
+ switch (value) {
+ case 'png':
+ this.native.setImageFormat(BranchQRCodeImageFormat.PNG);
+ this._imageFormat = 'png';
+ break;
+ case 'jpeg':
+ this.native.setImageFormat(BranchQRCodeImageFormat.JPEG);
+ this._imageFormat = 'jpeg';
+ break;
+ }
+ }
+
+ private _margin: number = 0;
+ get margin() {
+ return this._margin;
+ }
+ set margin(value: number) {
+ this.native.setMargin(java.lang.Integer.valueOf(value));
+ }
+
+ get width() {
+ return 0;
+ }
+
+ set width(value: number) {
+ this.native.setWidth(java.lang.Integer.valueOf(value));
+ }
+
+ getQrCode(options: { asData?: boolean; uo: UniversalObject; lp: LinkProperties }) {
+ return new Promise((resolve, reject) => {
+ if (options.asData) {
+ this.native.getQRCodeAsData(
+ Utils.android.getApplication(),
+ options.uo.native,
+ options.lp.native,
+ new io.branch.referral.QRCode.BranchQRCode.BranchQRCodeDataHandler({
+ onSuccess(param0: number[]) {
+ // todo move to kotlin
+ let buffer = java.nio.ByteBuffer.allocate(param0.length);
+ buffer.put(param0);
+ buffer.rewind();
+ // @ts-ignore
+ resolve(ArrayBuffer.from(buffer));
+ },
+ onFailure(error: java.lang.Exception) {
+ reject(error);
+ },
+ })
+ );
+ } else {
+ this.native.getQRCodeAsImage(
+ Utils.android.getCurrentActivity(),
+ options.uo.native,
+ options.lp.native,
+ new io.branch.referral.QRCode.BranchQRCode.BranchQRCodeImageHandler({
+ onSuccess(image) {
+ resolve(new ImageSource(image));
+ },
+ onFailure(error: java.lang.Exception) {
+ reject(error);
+ },
+ })
+ );
+ }
+ });
+ }
+
+ showSheet(options: { anchor: View; uo: UniversalObject; lp: LinkProperties }) {
+ return Promise.reject(new Error('QRCode.showSheet is not implemented on Android. Please use getQrCode instead.'));
+ }
+}
+
+export class BranchIO {
+ [native_]: io.branch.referral.Branch;
+
+ public static init() {
+ if (didInit) {
+ return;
+ }
+ Application.once(Application.launchEvent, (args) => {
+ io.branch.referral.Branch.getAutoInstance(Utils.ad.getApplicationContext());
+ });
+ didInit = true;
+ }
+
+ static instance: BranchIO | null = null;
+
+ get native() {
+ return this[native_];
+ }
+
+ static fromNative(native: io.branch.referral.Branch): BranchIO {
+ const instance = new BranchIO();
+ instance[native_] = native;
+ return instance;
+ }
+ static getInstance(): BranchIO {
+ if (this.instance) {
+ return this.instance;
+ }
+ const instance = io.branch.referral.Branch.getInstance();
+ if (instance === null) {
+ throw new Error('Branch SDK is not initialized. Please call BranchIO.init() before using BranchIO.');
+ }
+ const ret = BranchIO.fromNative(instance);
+ this.instance = ret;
+ return ret;
+ }
+
+ static useTestInstance() {
+ io.branch.referral.Branch.enableTestMode();
+ if (this.instance) {
+ this.instance[native_] = io.branch.referral.Branch.getInstance();
+ }
+ return this;
+ }
+
+ static get disableTracking(): boolean {
+ return this.getInstance()?.native?.isTrackingDisabled?.() ?? false;
+ }
+
+ static set disableTracking(value: boolean) {
+ this.getInstance()?.native?.disableTracking?.(value);
+ }
+
+ static enableLogging() {
+ io.branch.referral.Branch.enableLogging();
+ }
+
+ static disableLogging() {
+ io.branch.referral.Branch.disableLogging();
+ }
+
+ static setBranchKey(key: string) {
+ this.getInstance()?.native?.setBranchKey?.(key);
+ }
+
+ static setAPIUrl(url: string): void {
+ io.branch.referral.Branch.setAPIUrl(url);
+ }
+
+ initSession(
+ options: {
+ android?: {
+ data: android.net.Uri | null;
+ reInit?: boolean;
+ };
+ },
+ callback: (
+ response: {
+ linkProperties?: LinkProperties;
+ universalObject?: UniversalObject;
+ },
+ error
+ ) => void
+ ): void {
+ let builder = io.branch.referral.Branch.sessionBuilder(Utils.android.getCurrentActivity()).withCallback(
+ new io.branch.referral.Branch.BranchUniversalReferralInitListener({
+ onInitFinished(universalObject: io.branch.indexing.BranchUniversalObject, linkProperties: io.branch.referral.util.LinkProperties, error: io.branch.referral.BranchError) {
+ if (error) {
+ callback(null, error);
+ return;
+ }
+
+ if (universalObject || linkProperties) {
+ callback(
+ {
+ linkProperties: LinkProperties.fromNative(linkProperties) ?? undefined,
+ universalObject: UniversalObject.fromNative(universalObject) ?? undefined,
+ },
+ null
+ );
+ } else {
+ console.warn('BranchIO initSession response is null');
+ }
+ },
+ })
+ );
+
+ if (options?.android?.data) {
+ builder = builder.withData(options.android.data);
+ }
+
+ if (options?.android?.reInit) {
+ builder.reInit();
+ } else {
+ builder.init();
+ }
+ }
+
+ setRequestMetadata(key: string, value: string) {
+ this.native.setRequestMetadata(key, value);
+ }
+
+ clearPartnerParameters() {
+ this.native.clearPartnerParameters();
+ }
+
+ addFacebookPartnerParameter(key: string, value: string) {
+ this.native.addFacebookPartnerParameterWithName(key, value);
+ }
+
+ addSnapPartnerParameter(key: string, value: string) {
+ this.native.addSnapPartnerParameterWithName(key, value);
+ }
+
+ getLatestReferringParams(sync: boolean = false): Record | null {
+ let params: org.json.JSONObject | null = null;
+ if (sync) {
+ params = this.native.getLatestReferringParams();
+ } else {
+ params = this.native.getLatestReferringParamsSync();
+ }
+ if (!params) {
+ return Utils.dataDeserialize(params);
+ }
+ return null;
+ }
+
+ getFirstReferringParams(): Record | null {
+ const params = this.native.getFirstReferringParams();
+ if (!params) {
+ return null;
+ }
+ return Utils.dataDeserialize(params);
+ }
+
+ lastAttributedTouchData(id: number) {
+ return new Promise>((resolve, reject) => {
+ this.native.getLastAttributedTouchData(
+ new io.branch.referral.ServerRequestGetLATD.BranchLastAttributedTouchDataListener({
+ onDataFetched(data, error) {
+ if (error) {
+ reject(error);
+ } else {
+ resolve(Utils.dataDeserialize(data));
+ }
+ },
+ })
+ );
+ });
+ }
+
+ setIdentity(identity: string): void {
+ this.native.setIdentity(identity);
+ }
+
+ logout() {
+ return new Promise((resolve, reject) => {
+ this.native.logout(
+ new io.branch.referral.Branch.LogoutStatusListener({
+ onLogoutFinished(done, error) {
+ if (error) {
+ reject(error);
+ } else {
+ resolve(done);
+ }
+ },
+ })
+ );
+ });
+ }
+
+ logoutSync(): void {
+ this.native.logout();
+ }
+}
diff --git a/packages/nativescript-branch/index.d.ts b/packages/nativescript-branch/index.d.ts
new file mode 100644
index 00000000..f0c10bef
--- /dev/null
+++ b/packages/nativescript-branch/index.d.ts
@@ -0,0 +1,432 @@
+export type EventType = 'AchieveLevel' | 'AddPaymentInfo' | 'AddToCart' | 'AddToWishlist' | 'ClickAd' | 'CompleteRegistration' | 'CompleteStream' | 'CompleteTutorial' | 'Custom' | 'InitiatePurchase' | 'InitiateStream' | 'Invite' | 'Login' | 'OptIn' | 'OptOut' | 'Purchase' | 'Rate' | 'Reserve' | 'Search' | 'Share' | 'SpendCredits' | 'StartTrial' | 'Subscribe' | 'UnlockAchievement' | 'ViewAd' | 'ViewCart' | 'ViewItem' | 'ViewItems';
+
+export type CurrencyCode =
+ | 'AED'
+ | 'AFN'
+ | 'USD'
+ | 'ALL'
+ | 'AMD'
+ | 'ANG'
+ | 'AOA'
+ | 'ARS'
+ | 'AUD'
+ | 'AWG'
+ | 'AZN'
+ | 'BAM'
+ | 'BBD'
+ | 'BDT'
+ | 'BGN'
+ | 'BHD'
+ | 'BIF'
+ | 'BMD'
+ | 'BND'
+ | 'BOB'
+ | 'BOV'
+ | 'BRL'
+ | 'BSD'
+ | 'BTN'
+ | 'BWP'
+ | 'BYN'
+ | 'BYR'
+ | 'CAD'
+ | 'CDF'
+ | 'CHE'
+ | 'CHF'
+ | 'CHW'
+ | 'CLF'
+ | 'CLP'
+ | 'CNY'
+ | 'COP'
+ | 'COU'
+ | 'CRC'
+ | 'CUC'
+ | 'CUP'
+ | 'CVE'
+ | 'CZK'
+ | 'DJF'
+ | 'DKK'
+ | 'DOP'
+ | 'DZD'
+ | 'EGP'
+ | 'ERN'
+ | 'ETB'
+ | 'EUR'
+ | 'FJD'
+ | 'FKP'
+ | 'GBP'
+ | 'GEL'
+ | 'GHS'
+ | 'GIP'
+ | 'GMD'
+ | 'GNF'
+ | 'GTQ'
+ | 'GYD'
+ | 'HKD'
+ | 'HNL'
+ | 'HRK'
+ | 'HTG'
+ | 'HUF'
+ | 'IDR'
+ | 'ILS'
+ | 'INR'
+ | 'IQD'
+ | 'IRR'
+ | 'ISK'
+ | 'JMD'
+ | 'JOD'
+ | 'JPY'
+ | 'KES'
+ | 'KGS'
+ | 'KHR'
+ | 'KMF'
+ | 'KPW'
+ | 'KRW'
+ | 'KWD'
+ | 'KYD'
+ | 'KZT'
+ | 'LAK'
+ | 'LBP'
+ | 'LKR'
+ | 'LRD'
+ | 'LSL'
+ | 'LYD'
+ | 'MAD'
+ | 'MDL'
+ | 'MGA'
+ | 'MKD'
+ | 'MNT'
+ | 'MOP'
+ | 'MRO'
+ | 'MUR'
+ | 'MVR'
+ | 'MWK'
+ | 'MXN'
+ | 'MXV'
+ | 'MYR'
+ | 'MZN'
+ | 'NAD'
+ | 'NGN'
+ | 'NIO'
+ | 'NOK'
+ | 'NPR'
+ | 'NZD'
+ | 'OMR'
+ | 'PAB'
+ | 'PEN'
+ | 'PGK'
+ | 'PHP'
+ | 'PKR'
+ | 'PLN'
+ | 'PYG'
+ | 'QAR'
+ | 'RON'
+ | 'RSD'
+ | 'RUB'
+ | 'RWF'
+ | 'SAR'
+ | 'SBD'
+ | 'SCR'
+ | 'SDG'
+ | 'SEK'
+ | 'SGD'
+ | 'SHP'
+ | 'SLL'
+ | 'SOS'
+ | 'SRD'
+ | 'SSP'
+ | 'STD'
+ | 'SYP'
+ | 'SZL'
+ | 'THB'
+ | 'TJS'
+ | 'TMT'
+ | 'TND'
+ | 'TOP'
+ | 'TRY'
+ | 'TTD'
+ | 'TWD'
+ | 'TZS'
+ | 'UAH'
+ | 'UGX'
+ | 'USN'
+ | 'UYI'
+ | 'UYU'
+ | 'UZS'
+ | 'VEF'
+ | 'VND'
+ | 'VUV'
+ | 'WST'
+ | 'XAF'
+ | 'XAG'
+ | 'XAU'
+ | 'XBA'
+ | 'XBB'
+ | 'XBC'
+ | 'XBD'
+ | 'XCD'
+ | 'XDR'
+ | 'XFU'
+ | 'XOF'
+ | 'XPD'
+ | 'XPF'
+ | 'XPT'
+ | 'XSU'
+ | 'XTS'
+ | 'XUA'
+ | 'XXX'
+ | 'YER'
+ | 'ZAR'
+ | 'ZMW';
+
+export type ProductCategory = 'AnimalSupplies' | 'Apparel' | 'ArtsEntertainment' | 'BabyToddler' | 'BusinessIndustrial' | 'CamerasOptics' | 'Electronics' | 'FoodBeverageTobacco' | 'Furniture' | 'Hardware' | 'HealthBeauty' | 'HomeGarden' | 'LuggageBags' | 'Mature' | 'Media' | 'OfficeSupplies' | 'Religious' | 'Software' | 'SportingGoods' | 'ToysGames' | 'VehiclesParts';
+
+export class LinkProperties {
+ readonly native;
+
+ alias: string;
+
+ campaign: string;
+
+ channel: string;
+
+ controlParams: Record;
+
+ feature: string;
+
+ matchDuration: number;
+
+ stage: string;
+
+ tags: Array;
+
+ addControlParamWithValue(controlParam: string, value: string): void;
+
+ addControlParam(key: string, value: string): void {
+ this.native.addControlParamWithValue(key, value);
+ }
+}
+
+export class ContentMetadata {
+ constructor();
+ readonly native;
+
+ addressCity: string;
+
+ addressCountry: string;
+
+ addressPostalCode: string;
+
+ addressRegion: string;
+
+ addressStreet: string;
+
+ condition: string;
+
+ contentSchema: string;
+
+ currency: string;
+
+ customMetadata: Record;
+
+ imageCaptions: Array;
+
+ latitude: number;
+
+ longitude: number;
+
+ price: number;
+
+ productBrand: string;
+
+ productCategory: ProductCategory;
+
+ productName: string;
+
+ productVariant: string;
+
+ quantity: number;
+
+ rating: number;
+
+ ratingAverage: number;
+
+ ratingCount: number;
+
+ ratingMax: number;
+
+ sku: string;
+
+ static fromNative(native: BranchContentMetadata): ContentMetadata {
+ return new ContentMetadata(native);
+ }
+}
+
+export class UniversalObject {
+ constructor();
+
+ readonly native;
+
+ share(linkProperties: LinkProperties, shareText: string): Promise<{ channel: string | null; completed: boolean }>;
+
+ automaticallyListOnSpotlight: boolean;
+
+ canonicalIdentifier: string;
+
+ canonicalUrl: string;
+
+ contentDescription: string;
+
+ contentIndexMode: 'private' | 'public';
+
+ contentMetadata: ContentMetadata;
+
+ creationDate: Date;
+
+ currency: string;
+
+ expirationDate: Date;
+
+ imageUrl: string;
+
+ keywords: Array;
+
+ locallyIndex: boolean;
+
+ metadata: Record;
+
+ price: number;
+
+ publiclyIndex: boolean;
+
+ spotlightIdentifier: string;
+
+ title: string;
+
+ type: string;
+}
+
+export class Event {
+ constructor(event: BranchEvent | null, customName: string | null);
+
+ logEvent(): Promise;
+
+ readonly native;
+
+ adType: 'banner' | 'interstitial' | 'rewarded' | 'native' | 'none';
+
+ affiliation: string;
+
+ alias: string;
+
+ contentItems: Array;
+
+ coupon: string;
+
+ currency: string;
+
+ customData: Record;
+
+ eventDescription: string;
+
+ revenue: number;
+
+ searchQuery: string;
+
+ shipping: number;
+
+ tax: number;
+
+ transactionID: string;
+}
+
+export class QRCode {
+ constructor();
+
+ readonly native;
+
+ backgroundColor: Color | string;
+
+ centerLogo: string;
+
+ codeColor: Color | string;
+
+ imageFormat: 'png' | 'jpeg';
+
+ margin: number;
+
+ width: number;
+
+ getQrCode(options: { asData?: boolean; uo: UniversalObject; lp: LinkProperties }): Promise;
+
+ showSheet(options: { anchor: View; uo: UniversalObject; lp: LinkProperties }): Promise;
+}
+
+export class BranchIO {
+ readonly native: any;
+
+ static init();
+
+ static getInstance(): BranchIO;
+
+ static get disableTracking(): boolean;
+
+ static set disableTracking(value: boolean);
+
+ static continueUserActivity(userActivity: NSUserActivity): boolean;
+
+ static openURL(application: UIApplication, url: NSURL, options: NSDictionary): boolean;
+
+ static useTestInstance(): this;
+
+ static enableLogging();
+
+ static disableLogging();
+
+ static setBranchKey(key: string);
+
+ static setAPIUrl(url: string): void {
+ io.branch.referral.Branch.setAPIUrl(url);
+ }
+
+ initSession(
+ options: {
+ ios?: {
+ launchOptions?: NSDictionary | null;
+ isReferrable?: boolean;
+ explicitlyRequestedReferrable?: boolean;
+ automaticallyDisplayController?: boolean;
+ };
+ android?: {
+ data: android.net.Uri | null;
+ reInit?: boolean;
+ };
+ },
+ callback: (
+ response: {
+ linkProperties?: LinkProperties;
+ universalObject?: UniversalObject;
+ },
+ error
+ ) => void
+ ): void;
+
+ setRequestMetadata(key: string, value: string);
+
+ clearPartnerParameters();
+
+ addFacebookPartnerParameter(key: string, value: string);
+
+ addSnapPartnerParameter(key: string, value: string);
+
+ getLatestReferringParams(sync: boolean = false): Record | null;
+
+ getFirstReferringParams(): Record | null;
+
+ lastAttributedTouchData(id: number): Promise>;
+
+ setIdentity(identity: string): void;
+
+ logout(): Promise;
+
+ logoutSync(): void;
+}
diff --git a/packages/nativescript-branch/index.ios.ts b/packages/nativescript-branch/index.ios.ts
new file mode 100644
index 00000000..19671a2f
--- /dev/null
+++ b/packages/nativescript-branch/index.ios.ts
@@ -0,0 +1,1025 @@
+import { Color, ImageSource, Utils, View } from '@nativescript/core';
+import { ProductCategory } from '.';
+
+const native_ = Symbol('[[native]]');
+
+export class LinkProperties {
+ [native_]: BranchLinkProperties;
+ static fromNative(native: BranchLinkProperties): LinkProperties {
+ const instance = new LinkProperties();
+ instance[native_] = native;
+ return instance;
+ }
+
+ get native() {
+ return this[native_];
+ }
+
+ get alias(): string {
+ return this.native.alias;
+ }
+
+ set alias(value: string) {
+ this.native.alias = value;
+ }
+
+ get campaign(): string {
+ return this.native.campaign;
+ }
+
+ set campaign(value: string) {
+ this.native.campaign = value;
+ }
+
+ get channel(): string {
+ return this.native.channel;
+ }
+
+ set channel(value: string) {
+ this.native.channel = value;
+ }
+
+ get controlParams(): Record {
+ const params = this.native.controlParams;
+ if (!params) {
+ return {};
+ }
+ return Utils.dataDeserialize(params);
+ }
+
+ set controlParams(value: Record) {
+ this.native.controlParams = Utils.dataSerialize(value);
+ }
+
+ get feature(): string {
+ return this.native.feature;
+ }
+
+ set feature(value: string) {
+ this.native.feature = value;
+ }
+
+ get matchDuration(): number {
+ return this.native.matchDuration;
+ }
+
+ set matchDuration(value: number) {
+ this.native.matchDuration = value;
+ }
+
+ get stage(): string {
+ return this.native.stage;
+ }
+
+ set stage(value: string) {
+ this.native.stage = value;
+ }
+
+ get tags(): Array {
+ return Utils.dataDeserialize(this.native.tags);
+ }
+
+ set tags(value: Array) {
+ this.native.tags = Utils.dataSerialize(value);
+ }
+
+ addControlParam(key: string, value: string): void {
+ this.native.addControlParamWithValue(key, value);
+ }
+}
+
+export class ContentMetadata {
+ [native_]: BranchContentMetadata;
+
+ constructor(metadata: BranchContentMetadata | null = null) {
+ if (metadata) {
+ this[native_] = metadata;
+ } else {
+ this[native_] = BranchContentMetadata.new();
+ }
+ }
+ get native() {
+ return this[native_];
+ }
+
+ get addressCity(): string {
+ return this.native.addressCity;
+ }
+
+ set addressCity(value: string) {
+ this.native.addressCity = value;
+ }
+
+ get addressCountry(): string {
+ return this.native.addressCountry;
+ }
+ set addressCountry(value: string) {
+ this.native.addressCountry = value;
+ }
+
+ get addressPostalCode(): string {
+ return this.native.addressPostalCode;
+ }
+ set addressPostalCode(value: string) {
+ this.native.addressPostalCode = value;
+ }
+
+ get addressRegion(): string {
+ return this.native.addressRegion;
+ }
+ set addressRegion(value: string) {
+ this.native.addressRegion = value;
+ }
+
+ get addressStreet(): string {
+ return this.native.addressStreet;
+ }
+ set addressStreet(value: string) {
+ this.native.addressStreet = value;
+ }
+
+ get condition(): string {
+ return this.native.condition;
+ }
+ set condition(value: string) {
+ this.native.condition = value;
+ }
+
+ get contentSchema(): string {
+ return this.native.contentSchema;
+ }
+ set contentSchema(value: string) {
+ this.native.contentSchema = value;
+ }
+
+ get currency(): string {
+ return this.native.currency;
+ }
+ set currency(value: string) {
+ this.native.currency = value;
+ }
+
+ get customMetadata(): Record {
+ return Utils.dataDeserialize(this.native.customMetadata);
+ }
+ set customMetadata(value: Record) {
+ this.native.customMetadata = Utils.dataSerialize(value);
+ }
+
+ get imageCaptions(): Array {
+ return Utils.dataDeserialize(this.native.imageCaptions);
+ }
+ set imageCaptions(value: Array) {
+ this.native.imageCaptions = Utils.dataSerialize(value);
+ }
+
+ get latitude(): number {
+ return this.native.latitude;
+ }
+ set latitude(value: number) {
+ this.native.latitude = value;
+ }
+
+ get longitude(): number {
+ return this.native.longitude;
+ }
+ set longitude(value: number) {
+ this.native.longitude = value;
+ }
+
+ get price(): number {
+ return this.native.price.doubleValue;
+ }
+ set price(value: number) {
+ this.native.price = NSDecimalNumber.decimalNumberWithDecimal(NSNumber.alloc().initWithDouble(value).decimalValue);
+ }
+
+ get productBrand(): string {
+ return this.native.productBrand;
+ }
+ set productBrand(value: string) {
+ this.native.productBrand = value;
+ }
+
+ get productCategory(): ProductCategory {
+ switch (this.native.productCategory) {
+ case BNCProductCategoryAnimalSupplies:
+ return 'AnimalSupplies';
+ case BNCProductCategoryApparel:
+ return 'Apparel';
+ case BNCProductCategoryArtsEntertainment:
+ return 'ArtsEntertainment';
+ case BNCProductCategoryBabyToddler:
+ return 'BabyToddler';
+ case BNCProductCategoryBusinessIndustrial:
+ return 'BusinessIndustrial';
+ case BNCProductCategoryCamerasOptics:
+ return 'CamerasOptics';
+ case BNCProductCategoryElectronics:
+ return 'Electronics';
+ case BNCProductCategoryFoodBeverageTobacco:
+ return 'FoodBeverageTobacco';
+ case BNCProductCategoryFurniture:
+ return 'Furniture';
+ case BNCProductCategoryHardware:
+ return 'Hardware';
+ case BNCProductCategoryHealthBeauty:
+ return 'HealthBeauty';
+ case BNCProductCategoryHomeGarden:
+ return 'HomeGarden';
+ case BNCProductCategoryLuggageBags:
+ return 'LuggageBags';
+ case BNCProductCategoryMature:
+ return 'Mature';
+ case BNCProductCategoryMedia:
+ return 'Media';
+ case BNCProductCategoryOfficeSupplies:
+ return 'OfficeSupplies';
+ case BNCProductCategoryReligious:
+ return 'Religious';
+ case BNCProductCategorySoftware:
+ return 'Software';
+ case BNCProductCategorySportingGoods:
+ return 'SportingGoods';
+ case BNCProductCategoryToysGames:
+ return 'ToysGames';
+ case BNCProductCategoryVehiclesParts:
+ return 'VehiclesParts';
+ default:
+ return 'Unknown' as ProductCategory;
+ }
+ }
+
+ set productCategory(value: ProductCategory) {
+ if (typeof value === 'string') {
+ switch (value) {
+ case 'AnimalSupplies':
+ this.native.productCategory = BNCProductCategoryAnimalSupplies;
+ break;
+ case 'Apparel':
+ this.native.productCategory = BNCProductCategoryApparel;
+ break;
+ case 'ArtsEntertainment':
+ this.native.productCategory = BNCProductCategoryArtsEntertainment;
+ break;
+ case 'BabyToddler':
+ this.native.productCategory = BNCProductCategoryBabyToddler;
+ break;
+ case 'BusinessIndustrial':
+ this.native.productCategory = BNCProductCategoryBusinessIndustrial;
+ break;
+ case 'CamerasOptics':
+ this.native.productCategory = BNCProductCategoryCamerasOptics;
+ break;
+ case 'Electronics':
+ this.native.productCategory = BNCProductCategoryElectronics;
+ break;
+ case 'FoodBeverageTobacco':
+ this.native.productCategory = BNCProductCategoryFoodBeverageTobacco;
+ break;
+ case 'Furniture':
+ this.native.productCategory = BNCProductCategoryFurniture;
+ break;
+ case 'Hardware':
+ this.native.productCategory = BNCProductCategoryHardware;
+ break;
+ case 'HealthBeauty':
+ this.native.productCategory = BNCProductCategoryHealthBeauty;
+ break;
+ case 'HomeGarden':
+ this.native.productCategory = BNCProductCategoryHomeGarden;
+ break;
+ case 'LuggageBags':
+ this.native.productCategory = BNCProductCategoryLuggageBags;
+ break;
+ case 'Mature':
+ this.native.productCategory = BNCProductCategoryMature;
+ break;
+ case 'Media':
+ this.native.productCategory = BNCProductCategoryMedia;
+ break;
+ case 'OfficeSupplies':
+ this.native.productCategory = BNCProductCategoryOfficeSupplies;
+ break;
+ case 'Religious':
+ this.native.productCategory = BNCProductCategoryReligious;
+ break;
+ case 'Software':
+ this.native.productCategory = BNCProductCategorySoftware;
+ break;
+ case 'SportingGoods':
+ this.native.productCategory = BNCProductCategorySportingGoods;
+ break;
+ case 'ToysGames':
+ this.native.productCategory = BNCProductCategoryToysGames;
+ break;
+ case 'VehiclesParts':
+ this.native.productCategory = BNCProductCategoryVehiclesParts;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ get productName(): string {
+ return this.native.productName;
+ }
+ set productName(value: string) {
+ this.native.productName = value;
+ }
+
+ get productVariant(): string {
+ return this.native.productVariant;
+ }
+ set productVariant(value: string) {
+ this.native.productVariant = value;
+ }
+
+ get quantity(): number {
+ return this.native.quantity;
+ }
+ set quantity(value: number) {
+ this.native.quantity = value;
+ }
+
+ get rating(): number {
+ return this.native.rating;
+ }
+ set rating(value: number) {
+ this.native.rating = value;
+ }
+
+ get ratingAverage(): number {
+ return this.native.ratingAverage;
+ }
+ set ratingAverage(value: number) {
+ this.native.ratingAverage = value;
+ }
+
+ get ratingCount(): number {
+ return this.native.ratingCount;
+ }
+ set ratingCount(value: number) {
+ this.native.ratingCount = value;
+ }
+
+ get ratingMax(): number {
+ return this.native.ratingMax;
+ }
+ set ratingMax(value: number) {
+ this.native.ratingMax = value;
+ }
+
+ get sku(): string {
+ return this.native.sku;
+ }
+ set sku(value: string) {
+ this.native.sku = value;
+ }
+
+ static fromNative(native: BranchContentMetadata): ContentMetadata {
+ return new ContentMetadata(native);
+ }
+}
+
+export class UniversalObject {
+ [native_]: BranchUniversalObject;
+ constructor(link: BranchUniversalObject | null = null) {
+ if (link) {
+ this[native_] = link;
+ } else {
+ this[native_] = BranchUniversalObject.new();
+ }
+ this[native_];
+ }
+
+ static fromNative(native: BranchUniversalObject): UniversalObject {
+ return new UniversalObject(native);
+ }
+
+ get native() {
+ return this[native_];
+ }
+
+ share(linkProperties: LinkProperties, shareText: string) {
+ return new Promise((resolve, reject) => {
+ this.native.showShareSheetWithLinkPropertiesAndShareTextFromViewControllerCompletionWithError(linkProperties.native, shareText, Utils.ios.getRootViewController(), (activityType, done: boolean, error: NSError) => {
+ if (error) {
+ reject(error);
+ } else {
+ resolve({
+ channel: activityType ?? null,
+ completed: done,
+ });
+ }
+ });
+ });
+ }
+
+ get automaticallyListOnSpotlight() {
+ return this.native.automaticallyListOnSpotlight;
+ }
+ set automaticallyListOnSpotlight(value: boolean) {
+ this.native.automaticallyListOnSpotlight = value;
+ }
+
+ get canonicalIdentifier() {
+ return this.native.canonicalIdentifier;
+ }
+ set canonicalIdentifier(value: string) {
+ this.native.canonicalIdentifier = value;
+ }
+
+ get canonicalUrl(): string {
+ return this.native.canonicalUrl;
+ }
+ set canonicalUrl(value: string) {
+ this.native.canonicalUrl = value;
+ }
+
+ get contentDescription(): string {
+ return this.native.contentDescription;
+ }
+
+ set contentDescription(value: string) {
+ this.native.contentDescription = value;
+ }
+
+ get contentIndexMode() {
+ switch (this.native.contentIndexMode) {
+ case BranchContentIndexMode.Public:
+ return 'public';
+ case BranchContentIndexMode.Private:
+ return 'private';
+ }
+ }
+
+ set contentIndexMode(value: 'public' | 'private') {
+ switch (value) {
+ case 'public':
+ this.native.contentIndexMode = BranchContentIndexMode.Public;
+ break;
+ case 'private':
+ this.native.contentIndexMode = BranchContentIndexMode.Private;
+ break;
+ }
+ }
+
+ get contentMetadata() {
+ return ContentMetadata.fromNative(this.native.contentMetadata);
+ }
+
+ set contentMetadata(value: ContentMetadata) {
+ this.native.contentMetadata = value[native_];
+ }
+
+ get creationDate(): Date {
+ return this.native.creationDate;
+ }
+
+ set creationDate(value: Date) {
+ this.native.creationDate = value;
+ }
+
+ get currency(): string {
+ return this.native.currency;
+ }
+
+ set currency(value: string) {
+ this.native.currency = value;
+ }
+
+ get expirationDate(): Date {
+ return this.native.expirationDate;
+ }
+
+ set expirationDate(value: Date) {
+ this.native.expirationDate = value;
+ }
+
+ get imageUrl(): string {
+ return this.native.imageUrl;
+ }
+
+ set imageUrl(value: string) {
+ this.native.imageUrl = value;
+ }
+
+ get keywords(): Array {
+ return Utils.dataDeserialize(this.native.keywords);
+ }
+
+ get locallyIndex(): boolean {
+ return this.native.locallyIndex;
+ }
+
+ set locallyIndex(value: boolean) {
+ this.native.locallyIndex = value;
+ }
+
+ get metadata(): Record {
+ const metadata = this.native.metadata;
+ if (!metadata) {
+ return {};
+ }
+ return Utils.dataDeserialize(metadata);
+ }
+
+ get price(): number {
+ return this.native.price;
+ }
+
+ set price(value: number) {
+ this.native.price = value;
+ }
+
+ get publiclyIndex(): boolean {
+ return this.native.publiclyIndex;
+ }
+ set publiclyIndex(value: boolean) {
+ this.native.publiclyIndex = value;
+ }
+
+ get spotlightIdentifier(): string {
+ return this.native.spotlightIdentifier;
+ }
+
+ set spotlightIdentifier(value: string) {
+ this.native.spotlightIdentifier = value;
+ }
+
+ get title(): string {
+ return this.native.title;
+ }
+
+ set title(value: string) {
+ this.native.title = value;
+ }
+
+ get type(): string {
+ return this.native.type;
+ }
+
+ set type(value: string) {
+ this.native.type = value;
+ }
+}
+
+export class Event {
+ [native_]: BranchEvent;
+ constructor(event: BranchEvent | null = null) {
+ if (event) {
+ this[native_] = event;
+ } else {
+ this[native_] = BranchEvent.new();
+ }
+ }
+ static fromNative(native: BranchEvent): Event {
+ return new Event(native);
+ }
+
+ logEvent() {
+ return new Promise((resolve, reject) => {
+ this.native.logEventWithCompletion((done: boolean, error: NSError) => {
+ if (error) {
+ reject(error);
+ } else {
+ resolve(done);
+ }
+ });
+ });
+ }
+
+ get native() {
+ return this[native_];
+ }
+
+ get adType() {
+ switch (this.native.adType) {
+ case BranchEventAdType.Banner:
+ return 'banner';
+ case BranchEventAdType.Interstitial:
+ return 'interstitial';
+ case BranchEventAdType.RewardedVideo:
+ return 'rewarded';
+ case BranchEventAdType.Native:
+ return 'native';
+ case BranchEventAdType.None:
+ return 'none';
+ }
+ }
+
+ set adType(value: 'banner' | 'interstitial' | 'rewarded' | 'native' | 'none') {
+ switch (value) {
+ case 'banner':
+ this.native.adType = BranchEventAdType.Banner;
+ break;
+ case 'interstitial':
+ this.native.adType = BranchEventAdType.Interstitial;
+ break;
+ case 'rewarded':
+ this.native.adType = BranchEventAdType.RewardedVideo;
+ break;
+ case 'native':
+ this.native.adType = BranchEventAdType.Native;
+ break;
+ case 'none':
+ this.native.adType = BranchEventAdType.None;
+ break;
+ }
+ }
+
+ get affiliation() {
+ return this.native.affiliation;
+ }
+
+ set affiliation(value: string) {
+ this.native.affiliation = value;
+ }
+
+ get alias() {
+ return this.native.alias;
+ }
+
+ set alias(value: string) {
+ this.native.alias = value;
+ }
+
+ get contentItems(): Array {
+ const items = this.native.contentItems;
+ if (!items) {
+ return [];
+ }
+ const count = items.count;
+ const ret = new Array(count);
+ for (let i = 0; i < count; i++) {
+ const item = items.objectAtIndex(i);
+ ret[i] = UniversalObject.fromNative(item);
+ }
+ return ret;
+ }
+
+ set contentItems(value: Array) {
+ if (Array.isArray(value)) {
+ const items = NSMutableArray.arrayWithCapacity(value.length);
+ for (const item of value) {
+ items.addObject(item[native_]);
+ }
+ this.native.contentItems = items;
+ }
+ }
+
+ get coupon(): string {
+ return this.native.coupon;
+ }
+
+ set coupon(value: string) {
+ this.native.coupon = value;
+ }
+
+ get currency(): string {
+ return this.native.currency;
+ }
+
+ set currency(value: string) {
+ this.native.currency = value;
+ }
+
+ get customData(): Record {
+ return Utils.dataDeserialize(this.native.customData);
+ }
+
+ set customData(value: Record) {
+ this.native.customData = Utils.dataSerialize(value);
+ }
+
+ get revenue() {
+ return this.native.revenue.doubleValue;
+ }
+
+ set revenue(value: number) {
+ this.native.revenue = NSDecimalNumber.decimalNumberWithDecimal(NSNumber.alloc().initWithDouble(value).decimalValue);
+ }
+
+ get searchQuery(): string {
+ return this.native.searchQuery;
+ }
+
+ set searchQuery(value: string) {
+ this.native.searchQuery = value;
+ }
+
+ get shipping() {
+ return this.native.shipping.doubleValue;
+ }
+
+ set shipping(value: number) {
+ this.native.shipping = NSDecimalNumber.decimalNumberWithDecimal(NSNumber.alloc().initWithDouble(value).decimalValue);
+ }
+
+ get tax() {
+ return this.native.tax.doubleValue;
+ }
+
+ set tax(value: number) {
+ this.native.tax = NSDecimalNumber.decimalNumberWithDecimal(NSNumber.alloc().initWithDouble(value).decimalValue);
+ }
+
+ get transactionID() {
+ return this.native.transactionID;
+ }
+ set transactionID(value: string) {
+ this.native.transactionID = value;
+ }
+}
+
+export class QRCode {
+ [native_]: BranchQRCode;
+
+ constructor(qrCode: BranchQRCode | null = null) {
+ if (qrCode) {
+ this[native_] = qrCode;
+ } else {
+ this[native_] = BranchQRCode.new();
+ }
+ }
+
+ static fromNative(native: BranchQRCode): QRCode {
+ return new QRCode(native);
+ }
+
+ get native() {
+ return this[native_];
+ }
+
+ get backgroundColor() {
+ return Color.fromIosColor(this.native.backgroundColor);
+ }
+
+ set backgroundColor(value: Color | string) {
+ if (value instanceof Color) {
+ this.native.backgroundColor = value.ios;
+ } else {
+ this.native.backgroundColor = new Color(value).ios;
+ }
+ }
+
+ set centerLogo(value: string) {
+ this.native.centerLogo = value;
+ }
+
+ get centerLogo(): string {
+ return this.native.centerLogo;
+ }
+
+ get codeColor() {
+ return Color.fromIosColor(this.native.codeColor);
+ }
+
+ set codeColor(value: Color | string) {
+ if (value instanceof Color) {
+ this.native.codeColor = value.ios;
+ } else {
+ this.native.codeColor = new Color(value).ios;
+ }
+ }
+
+ get imageFormat() {
+ switch (this.native.imageFormat) {
+ case BranchQRCodeImageFormat.PNG:
+ return 'png';
+ case BranchQRCodeImageFormat.JPEG:
+ return 'jpeg';
+ }
+ }
+
+ set imageFormat(value: 'png' | 'jpeg') {
+ switch (value) {
+ case 'png':
+ this.native.imageFormat = BranchQRCodeImageFormat.PNG;
+ break;
+ case 'jpeg':
+ this.native.imageFormat = BranchQRCodeImageFormat.JPEG;
+ break;
+ }
+ }
+
+ get margin() {
+ return this.native.margin;
+ }
+ set margin(value: number) {
+ this.native.margin = value;
+ }
+
+ get width() {
+ return this.native.width;
+ }
+
+ getQrCode(options: { asData?: boolean; uo: UniversalObject; lp: LinkProperties }) {
+ return new Promise((resolve, reject) => {
+ if (options.asData) {
+ this.native.getQRCodeAsDataLinkPropertiesCompletion(options.uo.native, options.lp.native, (data: NSData, error: NSError) => {
+ if (error) {
+ reject(error);
+ } else {
+ resolve(interop.bufferFromData(data));
+ }
+ });
+ } else {
+ this.native.getQRCodeAsImageLinkPropertiesCompletion(options.uo.native, options.lp.native, (image: UIImage, error: NSError) => {
+ if (error) {
+ reject(error);
+ } else {
+ resolve(new ImageSource(image));
+ }
+ });
+ }
+ });
+ }
+
+ showSheet(options: { anchor: View; uo: UniversalObject; lp: LinkProperties }) {
+ return new Promise((resolve, reject) => {
+ this.native.showShareSheetWithQRCodeFromViewControllerAnchorUniversalObjectLinkPropertiesCompletion(Utils.ios.getRootViewController(), options.anchor.nativeView, options.uo.native, options.lp.native, (error: NSError) => {
+ if (error) {
+ reject(error);
+ } else {
+ resolve();
+ }
+ });
+ });
+ }
+}
+
+export class BranchIO {
+ [native_]: Branch;
+
+ get native(): Branch {
+ return this[native_];
+ }
+
+ private static instance: BranchIO | null = null;
+
+ static init() {
+ // noop
+ }
+
+ static fromNative(native: Branch): BranchIO {
+ const instance = new BranchIO();
+ instance[native_] = native;
+ return instance;
+ }
+
+ static getInstance(): BranchIO {
+ if (this.instance) {
+ return this.instance;
+ }
+ const instance = BranchIO.fromNative(Branch.getInstance());
+ this.instance = instance;
+ return instance;
+ }
+
+ static get disableTracking(): boolean {
+ return Branch.trackingDisabled();
+ }
+
+ static set disableTracking(value: boolean) {
+ Branch.setTrackingDisabled(value);
+ }
+
+ static continueUserActivity(userActivity: NSUserActivity): boolean {
+ return this.getInstance().native?.continueUserActivity?.(userActivity) ?? false;
+ }
+
+ static openURL(application: UIApplication, url: NSURL, options: NSDictionary): boolean {
+ return this.getInstance()?.native?.applicationOpenURLOptions?.(application, url, options ?? null) ?? false;
+ }
+
+ static useTestInstance() {
+ Branch.setUseTestBranchKey(true);
+ if (this.instance) {
+ this.instance[native_] = Branch.getInstance();
+ }
+ return this;
+ }
+
+ static enableLogging() {
+ Branch.enableLogging();
+ }
+
+ static disableLogging() {
+ // todo
+ }
+
+ static setBranchKey(key: string) {
+ Branch.setBranchKey(key);
+ }
+
+ static setAPIUrl(url: string): void {
+ Branch.setAPIUrl(url);
+ }
+
+ initSession(
+ options: {
+ ios: {
+ launchOptions?: NSDictionary | null;
+ isReferrable?: boolean;
+ explicitlyRequestedReferrable?: boolean;
+ automaticallyDisplayController?: boolean;
+ };
+ },
+ callback: (
+ response: {
+ linkProperties?: LinkProperties;
+ universalObject?: UniversalObject;
+ },
+ error
+ ) => void
+ ): void {
+ this.native.initSceneSessionWithLaunchOptionsIsReferrableExplicitlyRequestedReferrableAutomaticallyDisplayControllerRegisterDeepLinkHandler(options.ios?.launchOptions ?? NSDictionary.new(), options.ios?.isReferrable ?? false, options.ios?.explicitlyRequestedReferrable ?? options.ios?.isReferrable ?? false, options.ios?.automaticallyDisplayController ?? false, (response, error) => {
+ if (error) {
+ callback(null, error);
+ return;
+ }
+ if (response) {
+ callback(
+ {
+ linkProperties: response.linkProperties ? LinkProperties.fromNative(response.linkProperties) : undefined,
+ universalObject: response.universalObject ? UniversalObject.fromNative(response.universalObject) : undefined,
+ },
+ null
+ );
+ } else {
+ console.warn('BranchIO initSession response is null');
+ }
+ });
+ }
+
+ setRequestMetadata(key: string, value: string) {
+ this.native.setRequestMetadataKeyValue(key, value);
+ }
+
+ clearPartnerParameters() {
+ this.native.clearPartnerParameters();
+ }
+
+ addFacebookPartnerParameter(key: string, value: string) {
+ this.native.addFacebookPartnerParameterWithNameValue(key, value);
+ }
+
+ addSnapPartnerParameter(key: string, value: string) {
+ this.native.addSnapPartnerParameterWithNameValue(key, value);
+ }
+
+ getLatestReferringParams(sync: boolean = false): Record | null {
+ let params: NSDictionary | null = null;
+ if (sync) {
+ params = this.native.getLatestReferringParams();
+ } else {
+ params = this.native.getLatestReferringParamsSynchronous();
+ }
+ if (!params) {
+ return Utils.dataDeserialize(params);
+ }
+ return null;
+ }
+
+ getFirstReferringParams(): Record | null {
+ const params = this.native.getFirstReferringParams();
+ if (!params) {
+ return null;
+ }
+ return Utils.dataDeserialize(params);
+ }
+
+ lastAttributedTouchData(id: number) {
+ return new Promise>((resolve, reject) => {
+ this.native.lastAttributedTouchDataWithAttributionWindowCompletion(id, (data, error) => {
+ if (error) {
+ reject(error);
+ } else {
+ resolve(Utils.dataDeserialize(data.lastAttributedTouchJSON));
+ }
+ });
+ });
+ }
+
+ setIdentity(identity: string): void {
+ this.native.setIdentity(identity);
+ }
+
+ logout() {
+ return new Promise((resolve, reject) => {
+ this.native.logoutWithCallback((done: boolean, error: NSError) => {
+ if (error) {
+ reject(error);
+ } else {
+ resolve(done);
+ }
+ });
+ });
+ }
+
+ logoutSync(): void {
+ this.native.logout();
+ }
+}
diff --git a/packages/nativescript-branch/nativescript.config.ts b/packages/nativescript-branch/nativescript.config.ts
new file mode 100644
index 00000000..5423f355
--- /dev/null
+++ b/packages/nativescript-branch/nativescript.config.ts
@@ -0,0 +1,14 @@
+import { NativeScriptConfig } from '@nativescript/core';
+
+export default {
+ ios: {
+ SPMPackages: [
+ {
+ name: 'BranchSDK',
+ libs: ['BranchSDK'],
+ repositoryURL: 'https://github.com/BranchMetrics/ios-branch-sdk-spm',
+ version: '3.12.1',
+ },
+ ],
+ },
+} as NativeScriptConfig;
diff --git a/packages/nativescript-branch/package.json b/packages/nativescript-branch/package.json
new file mode 100644
index 00000000..d36dc806
--- /dev/null
+++ b/packages/nativescript-branch/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "@nstudio/nativescript-branch",
+ "version": "1.0.0",
+ "description": "Add a plugin description",
+ "main": "index",
+ "types": "index.d.ts",
+ "nativescript": {
+ "platforms": {
+ "ios": "6.0.0",
+ "android": "6.0.0"
+ }
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/nstudio/nativescript-plugins.git"
+ },
+ "keywords": [
+ "NativeScript",
+ "JavaScript",
+ "TypeScript",
+ "iOS",
+ "Android"
+ ],
+ "author": {
+ "name": "nStudio",
+ "email": "team@nstudio.io"
+ },
+ "bugs": {
+ "url": "https://github.com/nstudio/nativescript-plugins/issues"
+ },
+ "license": "Apache-2.0",
+ "homepage": "https://github.com/nstudio/nativescript-plugins",
+ "readmeFilename": "README.md",
+ "bootstrapper": "@nativescript/plugin-seed"
+}
diff --git a/packages/nativescript-branch/platforms/android/include.gradle b/packages/nativescript-branch/platforms/android/include.gradle
new file mode 100644
index 00000000..95bec6d0
--- /dev/null
+++ b/packages/nativescript-branch/platforms/android/include.gradle
@@ -0,0 +1,7 @@
+dependencies {
+ implementation('io.branch.sdk.android:library:5.19.0')
+ implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
+
+ implementation("com.android.billingclient:billing:6.0.1")
+ implementation("store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:4.0.0")
+}
diff --git a/packages/nativescript-branch/project.json b/packages/nativescript-branch/project.json
new file mode 100644
index 00000000..a81fcaba
--- /dev/null
+++ b/packages/nativescript-branch/project.json
@@ -0,0 +1,65 @@
+{
+ "name": "nativescript-branch",
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
+ "projectType": "library",
+ "sourceRoot": "packages/nativescript-branch",
+ "targets": {
+ "build": {
+ "executor": "@nx/js:tsc",
+ "options": {
+ "outputPath": "dist/packages/nativescript-branch",
+ "tsConfig": "packages/nativescript-branch/tsconfig.json",
+ "packageJson": "packages/nativescript-branch/package.json",
+ "main": "packages/nativescript-branch/index.d.ts",
+ "assets": [
+ "packages/nativescript-branch/*.md",
+ "packages/nativescript-branch/index.d.ts",
+ "LICENSE",
+ {
+ "glob": "**/*",
+ "input": "packages/nativescript-branch/platforms/",
+ "output": "./platforms/"
+ }
+ ],
+ "dependsOn": [
+ {
+ "target": "build.all",
+ "projects": "dependencies"
+ }
+ ]
+ }
+ },
+ "build.all": {
+ "executor": "nx:run-commands",
+ "options": {
+ "commands": ["node tools/scripts/build-finish.ts nativescript-branch"],
+ "parallel": false
+ },
+ "outputs": ["{workspaceRoot}/dist/packages/nativescript-branch"],
+ "dependsOn": [
+ {
+ "target": "build.all",
+ "projects": "dependencies"
+ },
+ {
+ "target": "build",
+ "projects": "self"
+ }
+ ]
+ },
+ "focus": {
+ "executor": "nx:run-commands",
+ "options": {
+ "commands": ["nx g @nativescript/plugin-tools:focus-packages nativescript-branch"],
+ "parallel": false
+ }
+ },
+ "lint": {
+ "executor": "@nx/eslint:eslint",
+ "options": {
+ "lintFilePatterns": ["packages/nativescript-branch/**/*.ts"]
+ }
+ }
+ },
+ "tags": []
+}
diff --git a/packages/nativescript-branch/references.d.ts b/packages/nativescript-branch/references.d.ts
new file mode 100644
index 00000000..22bac92c
--- /dev/null
+++ b/packages/nativescript-branch/references.d.ts
@@ -0,0 +1 @@
+///
diff --git a/packages/nativescript-branch/tsconfig.json b/packages/nativescript-branch/tsconfig.json
new file mode 100644
index 00000000..52cfe522
--- /dev/null
+++ b/packages/nativescript-branch/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": "../../dist/out-tsc",
+ "rootDir": "."
+ },
+ "exclude": ["**/*.spec.ts", "**/*.test.ts", "angular"],
+ "include": ["**/*.ts", "references.d.ts"]
+}
diff --git a/packages/nativescript-branch/typings/android.d.ts b/packages/nativescript-branch/typings/android.d.ts
new file mode 100644
index 00000000..05779e0b
--- /dev/null
+++ b/packages/nativescript-branch/typings/android.d.ts
@@ -0,0 +1,3035 @@
+declare module io {
+ export module branch {
+ export module data {
+ export class InstallReferrerResult {
+ public static class: java.lang.Class;
+ public component4(): number;
+ public component5(): java.lang.Long;
+ public setInstallBeginTimestampSeconds(value: number): void;
+ public component6(): java.lang.Long;
+ public constructor(appStore: string, installBeginTimestampSeconds: number, installReferrer: string, referrerClickTimestampSeconds: number, installBeginTimestampServerSeconds: java.lang.Long, referrerClickTimestampServerSeconds: java.lang.Long, isClickThrough: boolean);
+ public setInstallReferrer(value: string): void;
+ public setClickThrough(value: boolean): void;
+ public equals(other: any): boolean;
+ public getReferrerClickTimestampServerSeconds(): java.lang.Long;
+ public getInstallBeginTimestampSeconds(): number;
+ public setInstallBeginTimestampServerSeconds(value: java.lang.Long): void;
+ public hashCode(): number;
+ public getReferrerClickTimestampSeconds(): number;
+ public copy(appStore: string, installBeginTimestampSeconds: number, installReferrer: string, referrerClickTimestampSeconds: number, installBeginTimestampServerSeconds: java.lang.Long, referrerClickTimestampServerSeconds: java.lang.Long, isClickThrough: boolean): io.branch.data.InstallReferrerResult;
+ public component7(): boolean;
+ public component1(): string;
+ public component2(): number;
+ public getInstallBeginTimestampServerSeconds(): java.lang.Long;
+ public toString(): string;
+ public getAppStore(): string;
+ public getInstallReferrer(): string;
+ public setReferrerClickTimestampServerSeconds(value: java.lang.Long): void;
+ public component3(): string;
+ public setReferrerClickTimestampSeconds(value: number): void;
+ public isClickThrough(): boolean;
+ public setAppStore(value: string): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module indexing {
+ export class BranchUniversalObject {
+ public static class: java.lang.Class;
+ public static CREATOR: globalAndroid.os.Parcelable.Creator;
+ /** @deprecated */
+ public addContentMetadata(key: string, value: string): io.branch.indexing.BranchUniversalObject;
+ public getImageUrl(): string;
+ public isPublicallyIndexable(): boolean;
+ public isLocallyIndexable(): boolean;
+ public convertToJson(): org.json.JSONObject;
+ /** @deprecated */
+ public getPrice(): number;
+ /** @deprecated */
+ public getCurrencyType(): string;
+ /** @deprecated */
+ public setPrice(price: number, currency: io.branch.referral.util.CurrencyType): io.branch.indexing.BranchUniversalObject;
+ public getDescription(): string;
+ public writeToParcel(dest: globalAndroid.os.Parcel, flags: number): void;
+ /** @deprecated */
+ public addContentMetadata(keys: java.util.HashMap): io.branch.indexing.BranchUniversalObject;
+ /** @deprecated */
+ public getMetadata(): java.util.HashMap;
+ /** @deprecated */
+ public showShareSheet(this_: globalAndroid.app.Activity, activity: io.branch.referral.util.LinkProperties, linkProperties: io.branch.referral.util.ShareSheetStyle, style: io.branch.referral.Branch.BranchLinkShareListener, callback: io.branch.referral.Branch.IChannelProperties): void;
+ /** @deprecated */
+ public setContentType(type: string): io.branch.indexing.BranchUniversalObject;
+ public static getReferredBranchUniversalObject(): io.branch.indexing.BranchUniversalObject;
+ public constructor();
+ public getCanonicalIdentifier(): string;
+ public getCanonicalUrl(): string;
+ public setContentIndexingMode(indexMode: io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE): io.branch.indexing.BranchUniversalObject;
+ public generateShortUrl(context: globalAndroid.content.Context, linkProperties: io.branch.referral.util.LinkProperties, callback: io.branch.referral.Branch.BranchLinkCreateListener): void;
+ public setLocalIndexMode(localIndexMode: io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE): io.branch.indexing.BranchUniversalObject;
+ public addKeyWord(keyword: string): io.branch.indexing.BranchUniversalObject;
+ public getShortUrl(context: globalAndroid.content.Context, linkProperties: io.branch.referral.util.LinkProperties, defaultToLongUrl: boolean): string;
+ public getContentMetadata(): io.branch.referral.util.ContentMetadata;
+ public setContentExpiration(expirationDate: java.util.Date): io.branch.indexing.BranchUniversalObject;
+ public setTitle(title: string): io.branch.indexing.BranchUniversalObject;
+ public setContentDescription(description: string): io.branch.indexing.BranchUniversalObject;
+ public setCanonicalIdentifier(canonicalIdentifier: string): io.branch.indexing.BranchUniversalObject;
+ public getShortUrl(context: globalAndroid.content.Context, linkProperties: io.branch.referral.util.LinkProperties): string;
+ public registerView(): void;
+ /** @deprecated */
+ public getType(): string;
+ public static createInstance(i: org.json.JSONObject): io.branch.indexing.BranchUniversalObject;
+ public getKeywords(): java.util.ArrayList;
+ public addKeyWords(keywords: java.util.ArrayList): io.branch.indexing.BranchUniversalObject;
+ public getExpirationTime(): number;
+ public getTitle(): string;
+ public registerView(callback: io.branch.indexing.BranchUniversalObject.RegisterViewStatusListener): void;
+ public generateShortUrl(context: globalAndroid.content.Context, linkProperties: io.branch.referral.util.LinkProperties, callback: io.branch.referral.Branch.BranchLinkCreateListener, defaultToLongUrl: boolean): void;
+ /** @deprecated */
+ public showShareSheet(activity: globalAndroid.app.Activity, linkProperties: io.branch.referral.util.LinkProperties, style: io.branch.referral.util.ShareSheetStyle, callback: io.branch.referral.Branch.BranchLinkShareListener): void;
+ public setContentMetadata(metadata: io.branch.referral.util.ContentMetadata): io.branch.indexing.BranchUniversalObject;
+ public getKeywordsJsonArray(): org.json.JSONArray;
+ public describeContents(): number;
+ public setContentImageUrl(imageUrl: string): io.branch.indexing.BranchUniversalObject;
+ public setCanonicalUrl(canonicalUrl: string): io.branch.indexing.BranchUniversalObject;
+ }
+ export module BranchUniversalObject {
+ export class CONTENT_INDEX_MODE {
+ public static class: java.lang.Class;
+ public static PUBLIC: io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE;
+ public static PRIVATE: io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE;
+ public static valueOf(name: string): io.branch.indexing.BranchUniversalObject.CONTENT_INDEX_MODE;
+ public static values(): androidNative.Array;
+ }
+ export class LinkShareListenerWrapper extends io.branch.referral.Branch.BranchLinkShareListener {
+ public static class: java.lang.Class;
+ public onShareLinkDialogLaunched(): void;
+ public onLinkShareResponse(param0: string, param1: string, param2: io.branch.referral.BranchError): void;
+ public onShareLinkDialogDismissed(): void;
+ public onChannelSelected(channelName: string): void;
+ public onChannelSelected(param0: string): void;
+ public onLinkShareResponse(sharedLink: string, sharedChannel: string, error: io.branch.referral.BranchError): void;
+ }
+ export class RegisterViewStatusListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.indexing.BranchUniversalObject$RegisterViewStatusListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onRegisterViewFinished(param0: boolean, param1: io.branch.referral.BranchError): void });
+ public constructor();
+ public onRegisterViewFinished(param0: boolean, param1: io.branch.referral.BranchError): void;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module interfaces {
+ export class IBranchLoggingCallbacks {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.interfaces.IBranchLoggingCallbacks interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onBranchLog(param0: string, param1: string): void });
+ public constructor();
+ public onBranchLog(param0: string, param1: string): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module receivers {
+ export class SharingBroadcastReceiver {
+ public static class: java.lang.Class;
+ public onReceive(this_: globalAndroid.content.Context, context: globalAndroid.content.Intent): void;
+ public constructor();
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class AnimatedDialog {
+ public static class: java.lang.Class;
+ public setContentView(layoutResID: number): void;
+ public constructor(context: globalAndroid.content.Context, isFullWidthStyle: boolean);
+ public constructor(context: globalAndroid.content.Context, theme: number);
+ public cancel(): void;
+ public onCreate(this_: globalAndroid.os.Bundle): void;
+ public show(): void;
+ public setDialogWindowAttributes(): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ApkParser {
+ public static class: java.lang.Class;
+ public decompressXMLForValidator(host: androidNative.Array, domainList: globalAndroid.content.Context): org.json.JSONObject;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class AppStoreReferrer {
+ public static class: java.lang.Class;
+ public static getInstallationID(): string;
+ public static processReferrerInfo(splitter: globalAndroid.content.Context, keyValue: string, referrerParam: number, referrerMap: number, referralParams: string, e: java.lang.Boolean, e: java.lang.Long, context: java.lang.Long): void;
+ public constructor();
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class Base64 {
+ public static class: java.lang.Class;
+ public static DEFAULT: number = 0;
+ public static NO_PADDING: number = 1;
+ public static NO_WRAP: number = 2;
+ public static CRLF: number = 4;
+ public static URL_SAFE: number = 8;
+ public static NO_CLOSE: number = 16;
+ public static decode(str: string, flags: number): androidNative.Array;
+ public static encodeToString(e: androidNative.Array, input: number): string;
+ public static decode(input: androidNative.Array, flags: number): androidNative.Array;
+ public static encodeToString(e: androidNative.Array, input: number, offset: number, len: number): string;
+ public static decode(input: androidNative.Array, offset: number, len: number, flags: number): androidNative.Array;
+ public static encode(input: androidNative.Array, offset: number, len: number, flags: number): androidNative.Array;
+ public static encode(input: androidNative.Array, flags: number): androidNative.Array;
+ }
+ export module Base64 {
+ export abstract class Coder {
+ public static class: java.lang.Class;
+ public output: androidNative.Array;
+ public op: number;
+ public process(param0: androidNative.Array, param1: number, param2: number, param3: boolean): boolean;
+ public maxOutputSize(param0: number): number;
+ }
+ export class Decoder extends io.branch.referral.Base64.Coder {
+ public static class: java.lang.Class;
+ public constructor(flags: number, output: androidNative.Array);
+ public maxOutputSize(len: number): number;
+ public process(this_: androidNative.Array, input: number, offset: number, len: boolean): boolean;
+ }
+ export class Encoder extends io.branch.referral.Base64.Coder {
+ public static class: java.lang.Class;
+ public static LINE_GROUPS: number = 19;
+ public do_padding: boolean;
+ public do_newline: boolean;
+ public do_cr: boolean;
+ public process(t: androidNative.Array, this_: number, input: number, offset: boolean): boolean;
+ public constructor(flags: number, output: androidNative.Array);
+ public maxOutputSize(len: number): number;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BillingGooglePlay {
+ public static class: java.lang.Class;
+ public billingClient: com.android.billingclient.api.BillingClient;
+ public setBillingClient(value: com.android.billingclient.api.BillingClient): void;
+ public getBillingClient(): com.android.billingclient.api.BillingClient;
+ public startBillingClient(callback: any): void;
+ public createAndLogEventForPurchase(context: globalAndroid.content.Context, purchase: com.android.billingclient.api.Purchase, contentItems: java.util.List, currency: io.branch.referral.util.CurrencyType, revenue: number, productType: string): void;
+ public logEventWithPurchase(subsProduct: globalAndroid.content.Context, productId: com.android.billingclient.api.Purchase): void;
+ }
+ export module BillingGooglePlay {
+ export class Companion {
+ public static class: java.lang.Class;
+ public getInstance(): io.branch.referral.BillingGooglePlay;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class Branch {
+ public static class: java.lang.Class;
+ public static FEATURE_TAG_SHARE: string = 'share';
+ public static REDIRECT_DESKTOP_URL: string = '$desktop_url';
+ public static REDIRECT_ANDROID_URL: string = '$android_url';
+ public static REDIRECT_IOS_URL: string = '$ios_url';
+ public static REDIRECT_IPAD_URL: string = '$ipad_url';
+ public static REDIRECT_FIRE_URL: string = '$fire_url';
+ public static REDIRECT_BLACKBERRY_URL: string = '$blackberry_url';
+ public static REDIRECT_WINDOWS_PHONE_URL: string = '$windows_phone_url';
+ public static OG_TITLE: string = '$og_title';
+ public static OG_DESC: string = '$og_description';
+ public static OG_IMAGE_URL: string = '$og_image_url';
+ public static OG_VIDEO: string = '$og_video';
+ public static OG_URL: string = '$og_url';
+ public static OG_APP_ID: string = '$og_app_id';
+ public static DEEPLINK_PATH: string = '$deeplink_path';
+ public static ALWAYS_DEEPLINK: string = '$always_deeplink';
+ public static LINK_TYPE_UNLIMITED_USE: number = 0;
+ public static LINK_TYPE_ONE_TIME_USE: number = 1;
+ public static _userAgentString: string;
+ public requestQueue_: io.branch.referral.ServerRequestQueue;
+ public closeRequestNeeded: boolean;
+ public static installDeveloperId: string;
+ public static getAutoInstance(context: globalAndroid.content.Context, branchKey: string): io.branch.referral.Branch;
+ public getApplicationContext(): globalAndroid.content.Context;
+ public static enableLogging(): void;
+ public setNetworkTimeout(timeout: number): void;
+ /** @deprecated */
+ public disableTracking(disableTracking: boolean): void;
+ public static enableLogging(iBranchLogging: io.branch.interfaces.IBranchLoggingCallbacks, level: io.branch.referral.BranchLogger.BranchLogLevel): void;
+ public setPreinstallPartner(preInstallPartner: string): io.branch.referral.Branch;
+ public static showInstallPrompt(e: globalAndroid.app.Activity, referringLink: number): boolean;
+ public static showInstallPrompt(activity: globalAndroid.app.Activity, requestCode: number, buo: io.branch.indexing.BranchUniversalObject): boolean;
+ public static registerPlugin(name: string, version: string): void;
+ public static isWaitingForIntent(): boolean;
+ public static getSdkVersionNumber(): string;
+ public share(activity: globalAndroid.app.Activity, buo: io.branch.indexing.BranchUniversalObject, linkProperties: io.branch.referral.util.LinkProperties, callback: io.branch.referral.Branch.BranchNativeLinkShareListener, title: string, subject: string): void;
+ public static enableLogging(iBranchLogging: io.branch.interfaces.IBranchLoggingCallbacks): void;
+ public static bypassWaitingForIntent(bypassIntent: boolean): void;
+ public getLastAttributedTouchData(callback: io.branch.referral.ServerRequestGetLATD.BranchLastAttributedTouchDataListener): void;
+ public notifyNetworkAvailable(): void;
+ public static setReferringLinkAttributionForPreinstalledAppsEnabled(): void;
+ public removeSessionInitializationDelay(): void;
+ public setConsumerProtectionAttributionLevel(level: io.branch.referral.Defines.BranchAttributionLevel): void;
+ public logout(callback: io.branch.referral.Branch.LogoutStatusListener): void;
+ public setInstantDeepLinkPossible(instantDeepLinkPossible: boolean): void;
+ public setConsumerProtectionAttributionLevel(level: io.branch.referral.Defines.BranchAttributionLevel, callback: io.branch.referral.Branch.TrackingStateCallback): void;
+ public disableAdNetworkCallouts(disabled: boolean): void;
+ public static notifyNativeToInit(): void;
+ public addInstallMetadata(key: string, value: string): io.branch.referral.Branch;
+ public static disableLogging(): void;
+ public getLatestReferringParams(): org.json.JSONObject;
+ public setIdentity(userId: string, callback: io.branch.referral.Branch.BranchReferralInitListener): void;
+ public isUserIdentified(): boolean;
+ public getConfigurationController(): io.branch.referral.BranchConfigurationController;
+ public setRetryInterval(retryInterval: number): void;
+ public static setAPIUrl(url: string): void;
+ public getTrackingController(): io.branch.referral.TrackingController;
+ public static expectDelayedSessionInitialization(expectDelayedInit: boolean): void;
+ public static getIsUserAgentSync(): boolean;
+ public logEventWithPurchase(context: globalAndroid.content.Context, purchase: com.android.billingclient.api.Purchase): void;
+ public getFirstReferringParams(): org.json.JSONObject;
+ public static setFBAppID(fbAppID: string): void;
+ public registerView(branchUniversalObject: io.branch.indexing.BranchUniversalObject, callback: io.branch.indexing.BranchUniversalObject.RegisterViewStatusListener): void;
+ /** @deprecated */
+ public disableAppList(): void;
+ public setIdentity(userId: string): void;
+ public getBranchRemoteInterface(): io.branch.referral.network.BranchRemoteInterface;
+ public setReferrerGclidValidForWindow(window: number): void;
+ public static sessionBuilder(activity: globalAndroid.app.Activity): io.branch.referral.Branch.InitSessionBuilder;
+ public addUriHostsToSkip(urlSkipPattern: string): io.branch.referral.Branch;
+ public setBranchRemoteInterface(remoteInterface: io.branch.referral.network.BranchRemoteInterface): void;
+ public logout(): void;
+ public setPreinstallCampaign(preInstallCampaign: string): io.branch.referral.Branch;
+ public static isReferringLinkAttributionForPreinstalledAppsEnabled(): boolean;
+ public static getPluginVersion(): string;
+ public setNetworkConnectTimeout(connectTimeout: number): void;
+ public static enableLogging(level: io.branch.referral.BranchLogger.BranchLogLevel): void;
+ /** @deprecated */
+ public static enableForcedSession(): void;
+ public setRetryCount(retryCount: number): void;
+ public setDeepLinkDebugMode(debugParams: org.json.JSONObject): void;
+ public isTrackingDisabled(): boolean;
+ public getDeeplinkDebugParams(): org.json.JSONObject;
+ public setNoConnectionRetryMax(retryMax: number): void;
+ /** @deprecated */
+ public static disableForcedSession(): void;
+ public getLatestReferringParamsSync(): org.json.JSONObject;
+ public openBrowserExperience(weblinkUrl: org.json.JSONObject): void;
+ /** @deprecated */
+ public disableTracking(disableTracking: boolean, callback: io.branch.referral.Branch.TrackingStateCallback): void;
+ public getDeviceInfo(): io.branch.referral.DeviceInfo;
+ /** @deprecated */
+ public static isForceSessionEnabled(): boolean;
+ public getLastAttributedTouchData(callback: io.branch.referral.ServerRequestGetLATD.BranchLastAttributedTouchDataListener, attributionWindow: number): void;
+ public unlockPendingIntent(): void;
+ public static isAutoDeepLinkLaunch(activity: globalAndroid.app.Activity): boolean;
+ public addFacebookPartnerParameterWithName(key: string, value: string): void;
+ public static isInstantApp(context: globalAndroid.content.Context): boolean;
+ public addWhiteListedScheme(urlWhiteListPattern: string): io.branch.referral.Branch;
+ public setWhiteListedSchemes(urlWhiteListPatternList: java.util.List): io.branch.referral.Branch;
+ public getFirstReferringParamsSync(): org.json.JSONObject;
+ public static enableTestMode(): void;
+ public setLimitFacebookTracking(isLimitFacebookTracking: boolean): void;
+ public static getAutoInstance(context: globalAndroid.content.Context): io.branch.referral.Branch;
+ public setCustomTabsIntent(customTabsIntent: androidx.browser.customtabs.CustomTabsIntent): void;
+ public isInstantDeepLinkPossible(): boolean;
+ public static enableBypassCurrentActivityIntentState(): void;
+ public static setCDNBaseUrl(url: string): void;
+ public getBranchQRCodeCache(): io.branch.referral.BranchQRCodeCache;
+ public cancelShareLinkDialog(animateClose: boolean): void;
+ public setBranchKey(branchKey: string): void;
+ public addSnapPartnerParameterWithName(key: string, value: string): void;
+ public setDMAParamsForEEA(eeaRegion: boolean, adPersonalizationConsent: boolean, adUserDataUsageConsent: boolean): void;
+ public static disableTestMode(): void;
+ public clearPartnerParameters(): void;
+ public resetUserSession(): void;
+ public static disableInstantDeepLinking(disableIDL: boolean): void;
+ public static getInstance(): io.branch.referral.Branch;
+ public setRequestMetadata(key: string, value: string): void;
+ public static useEUEndpoint(): void;
+ public static disableDeviceIDFetch(deviceIdFetch: java.lang.Boolean): void;
+ public static isDeviceIDFetchDisabled(): boolean;
+ public static setIsUserAgentSync(sync: boolean): void;
+ public getBranchPluginSupport(): io.branch.referral.BranchPluginSupport;
+ public static bypassCurrentActivityIntentState(): boolean;
+ public static showInstallPrompt(activity: globalAndroid.app.Activity, requestCode: number, referrer: string): boolean;
+ }
+ export module Branch {
+ export class BranchLinkCreateListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$BranchLinkCreateListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onLinkCreate(param0: string, param1: io.branch.referral.BranchError): void });
+ public constructor();
+ public onLinkCreate(param0: string, param1: io.branch.referral.BranchError): void;
+ }
+ export class BranchLinkShareListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$BranchLinkShareListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onShareLinkDialogLaunched(): void; onShareLinkDialogDismissed(): void; onLinkShareResponse(param0: string, param1: string, param2: io.branch.referral.BranchError): void; onChannelSelected(param0: string): void });
+ public constructor();
+ public onShareLinkDialogLaunched(): void;
+ public onLinkShareResponse(param0: string, param1: string, param2: io.branch.referral.BranchError): void;
+ public onShareLinkDialogDismissed(): void;
+ public onChannelSelected(param0: string): void;
+ }
+ export class BranchListResponseListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$BranchListResponseListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onReceivingResponse(param0: org.json.JSONArray, param1: io.branch.referral.BranchError): void });
+ public constructor();
+ public onReceivingResponse(param0: org.json.JSONArray, param1: io.branch.referral.BranchError): void;
+ }
+ export class BranchNativeLinkShareListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$BranchNativeLinkShareListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onLinkShareResponse(param0: string, param1: io.branch.referral.BranchError): void; onChannelSelected(param0: string): void });
+ public constructor();
+ public onLinkShareResponse(param0: string, param1: io.branch.referral.BranchError): void;
+ public onChannelSelected(param0: string): void;
+ }
+ export class BranchReferralInitListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$BranchReferralInitListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onInitFinished(param0: org.json.JSONObject, param1: io.branch.referral.BranchError): void });
+ public constructor();
+ public onInitFinished(param0: org.json.JSONObject, param1: io.branch.referral.BranchError): void;
+ }
+ export class BranchReferralStateChangedListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$BranchReferralStateChangedListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onStateChanged(param0: boolean, param1: io.branch.referral.BranchError): void });
+ public constructor();
+ public onStateChanged(param0: boolean, param1: io.branch.referral.BranchError): void;
+ }
+ export class BranchUniversalReferralInitListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$BranchUniversalReferralInitListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onInitFinished(param0: io.branch.indexing.BranchUniversalObject, param1: io.branch.referral.util.LinkProperties, param2: io.branch.referral.BranchError): void });
+ public constructor();
+ public onInitFinished(param0: io.branch.indexing.BranchUniversalObject, param1: io.branch.referral.util.LinkProperties, param2: io.branch.referral.BranchError): void;
+ }
+ export class ExtendedBranchLinkShareListener extends io.branch.referral.Branch.BranchLinkShareListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$ExtendedBranchLinkShareListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onChannelSelected(param0: string, param1: io.branch.indexing.BranchUniversalObject, param2: io.branch.referral.util.LinkProperties): boolean; onShareLinkDialogLaunched(): void; onShareLinkDialogDismissed(): void; onLinkShareResponse(param0: string, param1: string, param2: io.branch.referral.BranchError): void; onChannelSelected(param0: string): void });
+ public constructor();
+ public onShareLinkDialogLaunched(): void;
+ public onLinkShareResponse(param0: string, param1: string, param2: io.branch.referral.BranchError): void;
+ public onShareLinkDialogDismissed(): void;
+ public onChannelSelected(param0: string, param1: io.branch.indexing.BranchUniversalObject, param2: io.branch.referral.util.LinkProperties): boolean;
+ public onChannelSelected(param0: string): void;
+ }
+ export class GetShortLinkTask extends globalAndroid.os.AsyncTask {
+ public static class: java.lang.Class;
+ public doInBackground(serverRequests: androidNative.Array): io.branch.referral.ServerResponse;
+ }
+ export class IChannelProperties {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$IChannelProperties interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { getSharingTitleForChannel(param0: string): string; getSharingMessageForChannel(param0: string): string });
+ public constructor();
+ public getSharingTitleForChannel(param0: string): string;
+ public getSharingMessageForChannel(param0: string): string;
+ }
+ export class INTENT_STATE {
+ public static class: java.lang.Class;
+ public static PENDING: io.branch.referral.Branch.INTENT_STATE;
+ public static READY: io.branch.referral.Branch.INTENT_STATE;
+ public static valueOf(name: string): io.branch.referral.Branch.INTENT_STATE;
+ public static values(): androidNative.Array;
+ }
+ export class InitSessionBuilder {
+ public static class: java.lang.Class;
+ public ignoreIntent(ignore: boolean): io.branch.referral.Branch.InitSessionBuilder;
+ public withCallback(callback: io.branch.referral.Branch.BranchUniversalReferralInitListener): io.branch.referral.Branch.InitSessionBuilder;
+ public withDelay(delayMillis: number): io.branch.referral.Branch.InitSessionBuilder;
+ /** @deprecated */
+ public isReferrable(isReferrable: boolean): io.branch.referral.Branch.InitSessionBuilder;
+ public withData(uri: globalAndroid.net.Uri): io.branch.referral.Branch.InitSessionBuilder;
+ public withCallback(callback: io.branch.referral.Branch.BranchReferralInitListener): io.branch.referral.Branch.InitSessionBuilder;
+ public init(): void;
+ public reInit(): void;
+ }
+ export class LogoutStatusListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$LogoutStatusListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onLogoutFinished(param0: boolean, param1: io.branch.referral.BranchError): void });
+ public constructor();
+ public onLogoutFinished(param0: boolean, param1: io.branch.referral.BranchError): void;
+ }
+ export class SESSION_STATE {
+ public static class: java.lang.Class;
+ public static INITIALISED: io.branch.referral.Branch.SESSION_STATE;
+ public static INITIALISING: io.branch.referral.Branch.SESSION_STATE;
+ public static UNINITIALISED: io.branch.referral.Branch.SESSION_STATE;
+ public static valueOf(name: string): io.branch.referral.Branch.SESSION_STATE;
+ public static values(): androidNative.Array;
+ }
+ export class TrackingStateCallback {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.Branch$TrackingStateCallback interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onTrackingStateChanged(param0: boolean, param1: org.json.JSONObject, param2: io.branch.referral.BranchError): void });
+ public constructor();
+ public onTrackingStateChanged(param0: boolean, param1: org.json.JSONObject, param2: io.branch.referral.BranchError): void;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchActivityLifecycleObserver {
+ public static class: java.lang.Class;
+ public onActivityStarted(activity: globalAndroid.app.Activity): void;
+ public onActivitySaveInstanceState(activity: globalAndroid.app.Activity, bundle: globalAndroid.os.Bundle): void;
+ public onActivityCreated(activity: globalAndroid.app.Activity, bundle: globalAndroid.os.Bundle): void;
+ public onActivityDestroyed(activity: globalAndroid.app.Activity): void;
+ public onActivityResumed(activity: globalAndroid.app.Activity): void;
+ public onActivityPaused(activity: globalAndroid.app.Activity): void;
+ public onActivityStopped(activity: globalAndroid.app.Activity): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchApp {
+ public static class: java.lang.Class;
+ public onCreate(): void;
+ public constructor();
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export abstract class BranchAsyncTask extends globalAndroid.os.AsyncTask {
+ public static class: java.lang.Class>;
+ public executeTask(this_: androidNative.Array): globalAndroid.os.AsyncTask;
+ public constructor();
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchConfigurationController {
+ public static class: java.lang.Class;
+ public static KEY_INSTANT_DEEP_LINKING_ENABLED: string = 'bnc_instant_deep_linking_enabled';
+ public static KEY_DEFER_INIT_FOR_PLUGIN_RUNTIME: string = 'bnc_defer_init_for_plugin_runtime';
+ public setTestModeEnabled(enabled: boolean): void;
+ public serializeConfiguration(): org.json.JSONObject;
+ public isInstantDeepLinkingEnabled(): boolean;
+ public setDeferInitForPluginRuntime(deferred: boolean): void;
+ public setDelayedSessionInitUsed(branch: boolean): void;
+ public setInstantDeepLinkingEnabled(enabled: boolean): void;
+ public isTestModeEnabled(): boolean;
+ public getBranchKeySource(): string;
+ public isBranchKeyFallbackUsed(): boolean;
+ public constructor();
+ }
+ export module BranchConfigurationController {
+ export class Companion {
+ public static class: java.lang.Class;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchError {
+ public static class: java.lang.Class;
+ public static ERR_NO_SESSION: number = -101;
+ public static ERR_NO_INTERNET_PERMISSION: number = -102;
+ public static ERR_BRANCH_INIT_FAILED: number = -104;
+ public static ERR_BRANCH_DUPLICATE_URL: number = -105;
+ public static ERR_API_LVL_14_NEEDED: number = -108;
+ public static ERR_BRANCH_NOT_INSTANTIATED: number = -109;
+ public static ERR_BRANCH_NO_SHARE_OPTION: number = -110;
+ public static ERR_BRANCH_REQ_TIMED_OUT: number = -111;
+ public static ERR_BRANCH_UNABLE_TO_REACH_SERVERS: number = -112;
+ public static ERR_BRANCH_NO_CONNECTIVITY: number = -113;
+ public static ERR_BRANCH_KEY_INVALID: number = -114;
+ public static ERR_BRANCH_RESOURCE_CONFLICT: number = -115;
+ public static ERR_BRANCH_INVALID_REQUEST: number = -116;
+ public static ERR_BRANCH_TRACKING_DISABLED: number = -117;
+ public static ERR_BRANCH_ALREADY_INITIALIZED: number = -118;
+ public static ERR_IMPROPER_REINITIALIZATION: number = -119;
+ public static ERR_BRANCH_TASK_TIMEOUT: number = -120;
+ public static ERR_NETWORK_ON_MAIN: number = -121;
+ public static ERR_OTHER: number = -122;
+ public constructor(failMsg: string, statusCode: number);
+ public getMessage(): string;
+ public getErrorCode(): number;
+ public toString(): string;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchJsonConfig {
+ public static class: java.lang.Class;
+ public static TAG: string = 'BranchJsonConfig';
+ public isValid(key: io.branch.referral.BranchJsonConfig.BranchJsonKey): boolean;
+ public getUseTestInstance(): java.lang.Boolean;
+ public static getInstance(context: globalAndroid.content.Context): io.branch.referral.BranchJsonConfig;
+ public getAPIUrl(): string;
+ public getConsumerProtectionAttributionLevel(): string;
+ public getBranchKey(): string;
+ public getEnableLogging(): java.lang.Boolean;
+ public isValid(): boolean;
+ public get(this_: io.branch.referral.BranchJsonConfig.BranchJsonKey): any;
+ public getDeferInitForPluginRuntime(): java.lang.Boolean;
+ public getFbAppId(): string;
+ }
+ export module BranchJsonConfig {
+ export class BranchJsonKey {
+ public static class: java.lang.Class;
+ public static branchKey: io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static testKey: io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static liveKey: io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static useTestInstance: io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static enableLogging: io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static deferInitForPluginRuntime: io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static apiUrl: io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static fbAppId: io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static cppLevel: io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static valueOf(name: string): io.branch.referral.BranchJsonConfig.BranchJsonKey;
+ public static values(): androidNative.Array;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchLinkData {
+ public static class: java.lang.Class;
+ public getChannel(): string;
+ public putChannel(channel: string): void;
+ public getAlias(): string;
+ public putFeature(feature: string): void;
+ public getType(): number;
+ public putStage(stage: string): void;
+ public getDuration(): number;
+ public putDuration(duration: number): void;
+ public getCampaign(): string;
+ public putCampaign(campaign: string): void;
+ public putSource(): void;
+ public putAlias(alias: string): void;
+ public constructor();
+ public equals(obj: any): boolean;
+ public getTags(): java.util.Collection;
+ public getFeature(): string;
+ public putParams(params: org.json.JSONObject): void;
+ public getLinkDataJsonObject(): org.json.JSONObject;
+ public hashCode(): number;
+ public getSource(): string;
+ public putTags(tagArray: java.util.Collection): void;
+ public getParams(): org.json.JSONObject;
+ public putType(type: number): void;
+ public getStage(): string;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchLogger {
+ public static class: java.lang.Class;
+ public static INSTANCE: io.branch.referral.BranchLogger;
+ public static setLoggingEnabled(value: boolean): void;
+ public static getLoggingEnabled(): boolean;
+ public static logAlways(message: string): void;
+ public static e(message: string): void;
+ public static getLoggerCallback(): io.branch.interfaces.IBranchLoggingCallbacks;
+ public static v(message: string): void;
+ public static i(message: string): void;
+ public static setLoggingLevel(value: io.branch.referral.BranchLogger.BranchLogLevel): void;
+ public static getLoggingLevel(): io.branch.referral.BranchLogger.BranchLogLevel;
+ public static stackTraceToString(writer: java.lang.Exception): string;
+ public static d(message: string): void;
+ public static setLoggerCallback(value: io.branch.interfaces.IBranchLoggingCallbacks): void;
+ public static w(message: string): void;
+ }
+ export module BranchLogger {
+ export class BranchLogLevel {
+ public static class: java.lang.Class;
+ public static ERROR: io.branch.referral.BranchLogger.BranchLogLevel;
+ public static WARN: io.branch.referral.BranchLogger.BranchLogLevel;
+ public static INFO: io.branch.referral.BranchLogger.BranchLogLevel;
+ public static DEBUG: io.branch.referral.BranchLogger.BranchLogLevel;
+ public static VERBOSE: io.branch.referral.BranchLogger.BranchLogLevel;
+ public static valueOf(value: string): io.branch.referral.BranchLogger.BranchLogLevel;
+ public getLevel(): number;
+ public static values(): androidNative.Array;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchPartnerParameters {
+ public static class: java.lang.Class;
+ public constructor();
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchPluginSupport {
+ public static class: java.lang.Class;
+ public getHardwareID(): io.branch.referral.SystemObserver.UniqueId;
+ public static getInstance(): io.branch.referral.BranchPluginSupport;
+ public deviceDescription(): java.util.Map;
+ public static isNullOrEmptyOrBlank(str: string): boolean;
+ }
+ export module BranchPluginSupport {
+ export class SystemObserverInstance extends io.branch.referral.SystemObserver {
+ public static class: java.lang.Class;
+ public constructor(param0: io.branch.referral.BranchPluginSupport);
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchPreinstall {
+ public static class: java.lang.Class;
+ public static setBranchPreInstallGoogleReferrer(context: globalAndroid.content.Context, referrerMap: java.util.HashMap): void;
+ public static getBranchFileContent(datakey: org.json.JSONObject, branchPreinstallData: io.branch.referral.Branch, preinstallDataKeys: globalAndroid.content.Context): void;
+ public static getPreinstallSystemData(branchFilePath: io.branch.referral.Branch, branchInstance: globalAndroid.content.Context): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchQRCodeCache {
+ public static class: java.lang.Class;
+ public cache: java.util.concurrent.ConcurrentHashMap>;
+ public checkQRCodeCache(e: org.json.JSONObject): androidNative.Array;
+ public static getInstance(): io.branch.referral.BranchQRCodeCache;
+ public addQRCodeToCache(this_: org.json.JSONObject, parameters: androidNative.Array): void;
+ public static areEqual(ob1: any, ob2: any): boolean;
+ }
+ export module BranchQRCodeCache {
+ export class SystemObserverInstance extends io.branch.referral.SystemObserver {
+ public static class: java.lang.Class;
+ public constructor(param0: io.branch.referral.BranchQRCodeCache);
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchShareSheetBuilder {
+ public static class: java.lang.Class;
+ public setAsFullWidthStyle(setFullWidthStyle: boolean): io.branch.referral.BranchShareSheetBuilder;
+ public getShareMsg(): string;
+ public getDialogThemeResourceID(): number;
+ public setDialogThemeResourceID(styleResourceID: number): io.branch.referral.BranchShareSheetBuilder;
+ public setShortLinkBuilderInternal(shortLinkBuilder: io.branch.referral.BranchShortLinkBuilder): void;
+ public setCopyUrlStyle(drawableIconID: number, stringLabelID: number, stringMessageID: number): io.branch.referral.BranchShareSheetBuilder;
+ public getUrlCopiedMessage(): string;
+ public addPreferredSharingOption(preferredOption: io.branch.referral.SharingHelper.SHARE_WITH): io.branch.referral.BranchShareSheetBuilder;
+ public setSubject(subject: string): io.branch.referral.BranchShareSheetBuilder;
+ public setDefaultURL(url: string): io.branch.referral.BranchShareSheetBuilder;
+ public getDefaultURL(): string;
+ public getDividerHeight(): number;
+ public setCopyUrlStyle(icon: globalAndroid.graphics.drawable.Drawable, label: string, message: string): io.branch.referral.BranchShareSheetBuilder;
+ public setFeature(feature: string): io.branch.referral.BranchShareSheetBuilder;
+ public setChannelProperties(channelPropertiesCallback: io.branch.referral.Branch.IChannelProperties): io.branch.referral.BranchShareSheetBuilder;
+ public getActivity(): globalAndroid.app.Activity;
+ public includeInShareSheet(packageName: androidNative.Array): io.branch.referral.BranchShareSheetBuilder;
+ public setMoreOptionStyle(icon: globalAndroid.graphics.drawable.Drawable, label: string): io.branch.referral.BranchShareSheetBuilder;
+ public addTags(tags: java.util.ArrayList): io.branch.referral.BranchShareSheetBuilder;
+ public setMatchDuration(matchDuration: number): io.branch.referral.BranchShareSheetBuilder;
+ public getCopyUrlIcon(): globalAndroid.graphics.drawable.Drawable;
+ public getShareSub(): string;
+ public getChannelPropertiesCallback(): io.branch.referral.Branch.IChannelProperties;
+ public setSharingTitle(titleView: globalAndroid.view.View): io.branch.referral.BranchShareSheetBuilder;
+ public getIconSize(): number;
+ public addParam(this_: string, key: string): io.branch.referral.BranchShareSheetBuilder;
+ public setIconSize(iconSize: number): io.branch.referral.BranchShareSheetBuilder;
+ public getCallback(): io.branch.referral.Branch.BranchLinkShareListener;
+ public setCallback(callback: io.branch.referral.Branch.BranchLinkShareListener): io.branch.referral.BranchShareSheetBuilder;
+ public setSharingTitle(title: string): io.branch.referral.BranchShareSheetBuilder;
+ public setDividerHeight(height: number): io.branch.referral.BranchShareSheetBuilder;
+ public constructor(activity: globalAndroid.app.Activity, shortLinkBuilder: io.branch.referral.BranchShortLinkBuilder);
+ public getCopyURlText(): string;
+ public setMoreOptionStyle(drawableIconID: number, stringLabelID: number): io.branch.referral.BranchShareSheetBuilder;
+ public getIsFullWidthStyle(): boolean;
+ public includeInShareSheet(packageNames: java.util.List): io.branch.referral.BranchShareSheetBuilder;
+ public getSharingTitleView(): globalAndroid.view.View;
+ public getStyleResourceID(): number;
+ public excludeFromShareSheet(packageNames: java.util.List): io.branch.referral.BranchShareSheetBuilder;
+ /** @deprecated */
+ public getBranch(): io.branch.referral.Branch;
+ public constructor(keys: globalAndroid.app.Activity, e: org.json.JSONObject);
+ public getPreferredOptions(): java.util.ArrayList;
+ public setAlias(alias: string): io.branch.referral.BranchShareSheetBuilder;
+ public addPreferredSharingOptions(preferredOptions: java.util.ArrayList): io.branch.referral.BranchShareSheetBuilder;
+ public includeInShareSheet(packageName: string): io.branch.referral.BranchShareSheetBuilder;
+ public shareLink(): void;
+ public setMessage(message: string): io.branch.referral.BranchShareSheetBuilder;
+ public getMoreOptionIcon(): globalAndroid.graphics.drawable.Drawable;
+ public excludeFromShareSheet(packageName: string): io.branch.referral.BranchShareSheetBuilder;
+ public setStyleResourceID(resourceID: number): void;
+ public excludeFromShareSheet(packageName: androidNative.Array): io.branch.referral.BranchShareSheetBuilder;
+ public getShortLinkBuilder(): io.branch.referral.BranchShortLinkBuilder;
+ public getMoreOptionText(): string;
+ public getSharingTitle(): string;
+ public addTag(tag: string): io.branch.referral.BranchShareSheetBuilder;
+ public setStage(stage: string): io.branch.referral.BranchShareSheetBuilder;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchShortLinkBuilder extends io.branch.referral.BranchUrlBuilder {
+ public static class: java.lang.Class;
+ public setAlias(alias: string): io.branch.referral.BranchShortLinkBuilder;
+ public setParameters(parameters: org.json.JSONObject): io.branch.referral.BranchShortLinkBuilder;
+ public constructor(context: globalAndroid.content.Context);
+ public setDuration(duration: number): io.branch.referral.BranchShortLinkBuilder;
+ public setCampaign(campaign: string): io.branch.referral.BranchShortLinkBuilder;
+ public getShortUrl(): string;
+ public generateShortUrl(callback: io.branch.referral.Branch.BranchLinkCreateListener): void;
+ public setStage(stage: string): io.branch.referral.BranchShortLinkBuilder;
+ public setFeature(feature: string): io.branch.referral.BranchShortLinkBuilder;
+ public setType(type: number): io.branch.referral.BranchShortLinkBuilder;
+ public setChannel(channel: string): io.branch.referral.BranchShortLinkBuilder;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchUniversalReferralInitWrapper extends io.branch.referral.Branch.BranchReferralInitListener {
+ public static class: java.lang.Class;
+ public onInitFinished(linkProperties: org.json.JSONObject, this_: io.branch.referral.BranchError): void;
+ public onInitFinished(param0: org.json.JSONObject, param1: io.branch.referral.BranchError): void;
+ public constructor(universalReferralInitListener: io.branch.referral.Branch.BranchUniversalReferralInitListener);
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export abstract class BranchUrlBuilder extends java.lang.Object {
+ public static class: java.lang.Class>;
+ public params_: org.json.JSONObject;
+ public channel_: string;
+ public feature_: string;
+ public stage_: string;
+ public campaign_: string;
+ public alias_: string;
+ public type_: number;
+ public duration_: number;
+ public tags_: java.util.ArrayList;
+ public branchReferral_: io.branch.referral.Branch;
+ public addTag(tag: string): T;
+ public setDefaultToLongUrl(defaultToLongUrl: boolean): T;
+ public generateUrlInternal(this_: io.branch.referral.Branch.BranchLinkCreateListener): void;
+ public constructor(context: globalAndroid.content.Context);
+ public getUrl(): string;
+ public addTags(tags: java.util.List): T;
+ public addParameters(this_: string, key: any): T;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchUrlQueryParameter {
+ public static class: java.lang.Class;
+ public isDeepLink(): boolean;
+ public getValidityWindow(): number;
+ public setName(value: string): void;
+ public getTimestamp(): java.util.Date;
+ public setTimestamp(value: java.util.Date): void;
+ public component4(): boolean;
+ public copy(name: string, value: string, timestamp: java.util.Date, isDeepLink: boolean, validityWindow: number): io.branch.referral.BranchUrlQueryParameter;
+ public component1(): string;
+ public component3(): java.util.Date;
+ public getValue(): string;
+ public getName(): string;
+ public constructor(name: string, value: string, timestamp: java.util.Date, isDeepLink: boolean, validityWindow: number);
+ public toString(): string;
+ public setValidityWindow(value: number): void;
+ public constructor();
+ public component5(): number;
+ public equals(other: any): boolean;
+ public hashCode(): number;
+ public setDeepLink(value: boolean): void;
+ public component2(): string;
+ public setValue(value: string): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BranchUtil {
+ public static class: java.lang.Class;
+ public static decodeResourceId(e: globalAndroid.content.Context, context: number): string;
+ public static getDeepLinkSchemes(e: globalAndroid.content.Context): org.json.JSONObject;
+ public static getDeferInitForPluginRuntimeConfig(context: globalAndroid.content.Context): boolean;
+ public static isTestModeEnabled(): boolean;
+ public static getDrawable(context: globalAndroid.content.Context, drawableID: number): globalAndroid.graphics.drawable.Drawable;
+ public static setCPPLevelFromConfig(cppLevel: globalAndroid.content.Context): void;
+ public constructor();
+ public static setAPIBaseUrlFromConfig(context: globalAndroid.content.Context): void;
+ public static readBranchKey(context: globalAndroid.content.Context): string;
+ public static setFbAppIdFromConfig(context: globalAndroid.content.Context): void;
+ public static isLowOnMemory(context: globalAndroid.content.Context): boolean;
+ public static getEnableLoggingConfig(context: globalAndroid.content.Context): boolean;
+ public static dpToPx(context: globalAndroid.content.Context, dp: number): number;
+ }
+ export module BranchUtil {
+ export class JsonReader {
+ public static class: java.lang.Class;
+ public readOutInt(key: string, fallback: java.lang.Integer): java.lang.Integer;
+ public readOutBoolean(key: string): boolean;
+ public readOutLong(key: string): number;
+ public readOutDouble(key: string, fallback: java.lang.Double): java.lang.Double;
+ public has(key: string): boolean;
+ public readOut(key: string): any;
+ public readOutInt(key: string): number;
+ public readOutString(key: string): string;
+ public constructor(this_: org.json.JSONObject);
+ public readOutString(key: string, fallback: string): string;
+ public readOutJsonArray(key: string): org.json.JSONArray;
+ public getJsonObject(): org.json.JSONObject;
+ public keys(): java.util.Iterator;
+ public readOutDouble(key: string): number;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class BuildConfig {
+ public static class: java.lang.Class;
+ public static DEBUG: boolean = 0;
+ public static LIBRARY_PACKAGE_NAME: string = 'io.branch.referral';
+ public static BUILD_TYPE: string = 'release';
+ public static VERSION_CODE: number = 21696;
+ public static VERSION_NAME: string = '5.19.0';
+ public constructor();
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class Defines {
+ public static class: java.lang.Class;
+ public constructor();
+ }
+ export module Defines {
+ export class BranchAttributionLevel {
+ public static class: java.lang.Class;
+ public static FULL: io.branch.referral.Defines.BranchAttributionLevel;
+ public static REDUCED: io.branch.referral.Defines.BranchAttributionLevel;
+ public static MINIMAL: io.branch.referral.Defines.BranchAttributionLevel;
+ public static NONE: io.branch.referral.Defines.BranchAttributionLevel;
+ public static valueOf(name: string): io.branch.referral.Defines.BranchAttributionLevel;
+ public static values(): androidNative.Array;
+ }
+ export class HeaderKey {
+ public static class: java.lang.Class;
+ public static RequestId: io.branch.referral.Defines.HeaderKey;
+ public static SendCloseRequest: io.branch.referral.Defines.HeaderKey;
+ public getKey(): string;
+ public toString(): string;
+ public static valueOf(name: string): io.branch.referral.Defines.HeaderKey;
+ public static values(): androidNative.Array;
+ }
+ export class IntentKeys {
+ public static class: java.lang.Class;
+ public static BranchData: io.branch.referral.Defines.IntentKeys;
+ public static ForceNewBranchSession: io.branch.referral.Defines.IntentKeys;
+ public static BranchLinkUsed: io.branch.referral.Defines.IntentKeys;
+ public static BranchURI: io.branch.referral.Defines.IntentKeys;
+ public static AutoDeepLinked: io.branch.referral.Defines.IntentKeys;
+ public getKey(): string;
+ public static values(): androidNative.Array;
+ public toString(): string;
+ public static valueOf(name: string): io.branch.referral.Defines.IntentKeys;
+ }
+ export class Jsonkey {
+ public static class: java.lang.Class;
+ public static RandomizedBundleToken: io.branch.referral.Defines.Jsonkey;
+ public static Identity: io.branch.referral.Defines.Jsonkey;
+ public static RandomizedDeviceToken: io.branch.referral.Defines.Jsonkey;
+ public static SessionID: io.branch.referral.Defines.Jsonkey;
+ public static LinkClickID: io.branch.referral.Defines.Jsonkey;
+ public static GoogleSearchInstallReferrer: io.branch.referral.Defines.Jsonkey;
+ public static GooglePlayInstallReferrer: io.branch.referral.Defines.Jsonkey;
+ public static ClickedReferrerTimeStamp: io.branch.referral.Defines.Jsonkey;
+ public static ClickedReferrerServerTimeStamp: io.branch.referral.Defines.Jsonkey;
+ public static Gclid: io.branch.referral.Defines.Jsonkey;
+ public static IsDeeplinkGclid: io.branch.referral.Defines.Jsonkey;
+ public static ReferrerGclid: io.branch.referral.Defines.Jsonkey;
+ public static ReferringUrlQueryParameters: io.branch.referral.Defines.Jsonkey;
+ public static InstallBeginTimeStamp: io.branch.referral.Defines.Jsonkey;
+ public static InstallBeginServerTimeStamp: io.branch.referral.Defines.Jsonkey;
+ public static BranchLinkUsed: io.branch.referral.Defines.Jsonkey;
+ public static ReferringBranchIdentity: io.branch.referral.Defines.Jsonkey;
+ public static BranchIdentity: io.branch.referral.Defines.Jsonkey;
+ public static BranchKey: io.branch.referral.Defines.Jsonkey;
+ public static BranchData: io.branch.referral.Defines.Jsonkey;
+ public static PlayAutoInstalls: io.branch.referral.Defines.Jsonkey;
+ public static UTMCampaign: io.branch.referral.Defines.Jsonkey;
+ public static UTMMedium: io.branch.referral.Defines.Jsonkey;
+ public static InitialReferrer: io.branch.referral.Defines.Jsonkey;
+ public static Bucket: io.branch.referral.Defines.Jsonkey;
+ public static DefaultBucket: io.branch.referral.Defines.Jsonkey;
+ public static Amount: io.branch.referral.Defines.Jsonkey;
+ public static CalculationType: io.branch.referral.Defines.Jsonkey;
+ public static Location: io.branch.referral.Defines.Jsonkey;
+ public static Type: io.branch.referral.Defines.Jsonkey;
+ public static CreationSource: io.branch.referral.Defines.Jsonkey;
+ public static Prefix: io.branch.referral.Defines.Jsonkey;
+ public static Expiration: io.branch.referral.Defines.Jsonkey;
+ public static Event: io.branch.referral.Defines.Jsonkey;
+ public static Metadata: io.branch.referral.Defines.Jsonkey;
+ public static CommerceData: io.branch.referral.Defines.Jsonkey;
+ public static Total: io.branch.referral.Defines.Jsonkey;
+ public static Unique: io.branch.referral.Defines.Jsonkey;
+ public static Length: io.branch.referral.Defines.Jsonkey;
+ public static Direction: io.branch.referral.Defines.Jsonkey;
+ public static BeginAfterID: io.branch.referral.Defines.Jsonkey;
+ public static Link: io.branch.referral.Defines.Jsonkey;
+ public static ReferringData: io.branch.referral.Defines.Jsonkey;
+ public static ReferringLink: io.branch.referral.Defines.Jsonkey;
+ public static IsFullAppConv: io.branch.referral.Defines.Jsonkey;
+ public static Data: io.branch.referral.Defines.Jsonkey;
+ public static OS: io.branch.referral.Defines.Jsonkey;
+ public static HardwareID: io.branch.referral.Defines.Jsonkey;
+ public static AndroidID: io.branch.referral.Defines.Jsonkey;
+ public static UnidentifiedDevice: io.branch.referral.Defines.Jsonkey;
+ public static HardwareIDType: io.branch.referral.Defines.Jsonkey;
+ public static HardwareIDTypeVendor: io.branch.referral.Defines.Jsonkey;
+ public static HardwareIDTypeRandom: io.branch.referral.Defines.Jsonkey;
+ public static IsHardwareIDReal: io.branch.referral.Defines.Jsonkey;
+ public static AnonID: io.branch.referral.Defines.Jsonkey;
+ public static AppVersion: io.branch.referral.Defines.Jsonkey;
+ public static APILevel: io.branch.referral.Defines.Jsonkey;
+ public static Country: io.branch.referral.Defines.Jsonkey;
+ public static Language: io.branch.referral.Defines.Jsonkey;
+ public static Update: io.branch.referral.Defines.Jsonkey;
+ public static OriginalInstallTime: io.branch.referral.Defines.Jsonkey;
+ public static FirstInstallTime: io.branch.referral.Defines.Jsonkey;
+ public static LastUpdateTime: io.branch.referral.Defines.Jsonkey;
+ public static PreviousUpdateTime: io.branch.referral.Defines.Jsonkey;
+ public static URIScheme: io.branch.referral.Defines.Jsonkey;
+ public static AppLinks: io.branch.referral.Defines.Jsonkey;
+ public static AppIdentifier: io.branch.referral.Defines.Jsonkey;
+ public static LinkIdentifier: io.branch.referral.Defines.Jsonkey;
+ public static GoogleAdvertisingID: io.branch.referral.Defines.Jsonkey;
+ public static AAID: io.branch.referral.Defines.Jsonkey;
+ public static FireAdId: io.branch.referral.Defines.Jsonkey;
+ public static OpenAdvertisingID: io.branch.referral.Defines.Jsonkey;
+ public static LATVal: io.branch.referral.Defines.Jsonkey;
+ public static LimitedAdTracking: io.branch.referral.Defines.Jsonkey;
+ public static limitFacebookTracking: io.branch.referral.Defines.Jsonkey;
+ public static Debug: io.branch.referral.Defines.Jsonkey;
+ public static Brand: io.branch.referral.Defines.Jsonkey;
+ public static Model: io.branch.referral.Defines.Jsonkey;
+ public static ScreenDpi: io.branch.referral.Defines.Jsonkey;
+ public static ScreenHeight: io.branch.referral.Defines.Jsonkey;
+ public static ScreenWidth: io.branch.referral.Defines.Jsonkey;
+ public static WiFi: io.branch.referral.Defines.Jsonkey;
+ public static LocalIP: io.branch.referral.Defines.Jsonkey;
+ public static UserData: io.branch.referral.Defines.Jsonkey;
+ public static AdvertisingIDs: io.branch.referral.Defines.Jsonkey;
+ public static DeveloperIdentity: io.branch.referral.Defines.Jsonkey;
+ public static UserAgent: io.branch.referral.Defines.Jsonkey;
+ public static SDK: io.branch.referral.Defines.Jsonkey;
+ public static SdkVersion: io.branch.referral.Defines.Jsonkey;
+ public static UIMode: io.branch.referral.Defines.Jsonkey;
+ public static InstallMetadata: io.branch.referral.Defines.Jsonkey;
+ public static LATDAttributionWindow: io.branch.referral.Defines.Jsonkey;
+ public static Clicked_Branch_Link: io.branch.referral.Defines.Jsonkey;
+ public static IsFirstSession: io.branch.referral.Defines.Jsonkey;
+ public static AndroidDeepLinkPath: io.branch.referral.Defines.Jsonkey;
+ public static DeepLinkPath: io.branch.referral.Defines.Jsonkey;
+ public static AndroidAppLinkURL: io.branch.referral.Defines.Jsonkey;
+ public static AndroidPushNotificationKey: io.branch.referral.Defines.Jsonkey;
+ public static AndroidPushIdentifier: io.branch.referral.Defines.Jsonkey;
+ public static CanonicalIdentifier: io.branch.referral.Defines.Jsonkey;
+ public static ContentTitle: io.branch.referral.Defines.Jsonkey;
+ public static ContentDesc: io.branch.referral.Defines.Jsonkey;
+ public static ContentImgUrl: io.branch.referral.Defines.Jsonkey;
+ public static CanonicalUrl: io.branch.referral.Defines.Jsonkey;
+ public static ContentType: io.branch.referral.Defines.Jsonkey;
+ public static PublicallyIndexable: io.branch.referral.Defines.Jsonkey;
+ public static LocallyIndexable: io.branch.referral.Defines.Jsonkey;
+ public static ContentKeyWords: io.branch.referral.Defines.Jsonkey;
+ public static ContentExpiryTime: io.branch.referral.Defines.Jsonkey;
+ public static Params: io.branch.referral.Defines.Jsonkey;
+ public static SharedLink: io.branch.referral.Defines.Jsonkey;
+ public static ShareError: io.branch.referral.Defines.Jsonkey;
+ public static SharedChannel: io.branch.referral.Defines.Jsonkey;
+ public static URLSource: io.branch.referral.Defines.Jsonkey;
+ public static External_Intent_URI: io.branch.referral.Defines.Jsonkey;
+ public static External_Intent_Extra: io.branch.referral.Defines.Jsonkey;
+ public static Last_Round_Trip_Time: io.branch.referral.Defines.Jsonkey;
+ public static Branch_Round_Trip_Time: io.branch.referral.Defines.Jsonkey;
+ public static Branch_Instrumentation: io.branch.referral.Defines.Jsonkey;
+ public static Queue_Wait_Time: io.branch.referral.Defines.Jsonkey;
+ public static InstantDeepLinkSession: io.branch.referral.Defines.Jsonkey;
+ public static Path: io.branch.referral.Defines.Jsonkey;
+ public static ViewList: io.branch.referral.Defines.Jsonkey;
+ public static ContentActionView: io.branch.referral.Defines.Jsonkey;
+ public static ContentPath: io.branch.referral.Defines.Jsonkey;
+ public static ContentNavPath: io.branch.referral.Defines.Jsonkey;
+ public static ReferralLink: io.branch.referral.Defines.Jsonkey;
+ public static ContentData: io.branch.referral.Defines.Jsonkey;
+ public static ContentEvents: io.branch.referral.Defines.Jsonkey;
+ public static ContentAnalyticsMode: io.branch.referral.Defines.Jsonkey;
+ public static Environment: io.branch.referral.Defines.Jsonkey;
+ public static InstantApp: io.branch.referral.Defines.Jsonkey;
+ public static NativeApp: io.branch.referral.Defines.Jsonkey;
+ public static CustomerEventAlias: io.branch.referral.Defines.Jsonkey;
+ public static TransactionID: io.branch.referral.Defines.Jsonkey;
+ public static Currency: io.branch.referral.Defines.Jsonkey;
+ public static Revenue: io.branch.referral.Defines.Jsonkey;
+ public static Shipping: io.branch.referral.Defines.Jsonkey;
+ public static Tax: io.branch.referral.Defines.Jsonkey;
+ public static Coupon: io.branch.referral.Defines.Jsonkey;
+ public static Affiliation: io.branch.referral.Defines.Jsonkey;
+ public static Description: io.branch.referral.Defines.Jsonkey;
+ public static SearchQuery: io.branch.referral.Defines.Jsonkey;
+ public static AdType: io.branch.referral.Defines.Jsonkey;
+ public static CPUType: io.branch.referral.Defines.Jsonkey;
+ public static DeviceBuildId: io.branch.referral.Defines.Jsonkey;
+ public static Locale: io.branch.referral.Defines.Jsonkey;
+ public static ConnectionType: io.branch.referral.Defines.Jsonkey;
+ public static DeviceCarrier: io.branch.referral.Defines.Jsonkey;
+ public static PluginName: io.branch.referral.Defines.Jsonkey;
+ public static PluginVersion: io.branch.referral.Defines.Jsonkey;
+ public static OSVersionAndroid: io.branch.referral.Defines.Jsonkey;
+ public static Name: io.branch.referral.Defines.Jsonkey;
+ public static CustomData: io.branch.referral.Defines.Jsonkey;
+ public static EventData: io.branch.referral.Defines.Jsonkey;
+ public static ContentItems: io.branch.referral.Defines.Jsonkey;
+ public static ContentSchema: io.branch.referral.Defines.Jsonkey;
+ public static Price: io.branch.referral.Defines.Jsonkey;
+ public static PriceCurrency: io.branch.referral.Defines.Jsonkey;
+ public static Quantity: io.branch.referral.Defines.Jsonkey;
+ public static SKU: io.branch.referral.Defines.Jsonkey;
+ public static ProductName: io.branch.referral.Defines.Jsonkey;
+ public static ProductBrand: io.branch.referral.Defines.Jsonkey;
+ public static ProductCategory: io.branch.referral.Defines.Jsonkey;
+ public static ProductVariant: io.branch.referral.Defines.Jsonkey;
+ public static Rating: io.branch.referral.Defines.Jsonkey;
+ public static RatingAverage: io.branch.referral.Defines.Jsonkey;
+ public static RatingCount: io.branch.referral.Defines.Jsonkey;
+ public static RatingMax: io.branch.referral.Defines.Jsonkey;
+ public static AddressStreet: io.branch.referral.Defines.Jsonkey;
+ public static AddressCity: io.branch.referral.Defines.Jsonkey;
+ public static AddressRegion: io.branch.referral.Defines.Jsonkey;
+ public static AddressCountry: io.branch.referral.Defines.Jsonkey;
+ public static AddressPostalCode: io.branch.referral.Defines.Jsonkey;
+ public static Latitude: io.branch.referral.Defines.Jsonkey;
+ public static Longitude: io.branch.referral.Defines.Jsonkey;
+ public static ImageCaptions: io.branch.referral.Defines.Jsonkey;
+ public static Condition: io.branch.referral.Defines.Jsonkey;
+ public static CreationTimestamp: io.branch.referral.Defines.Jsonkey;
+ public static TrackingDisabled: io.branch.referral.Defines.Jsonkey;
+ public static DisableAdNetworkCallouts: io.branch.referral.Defines.Jsonkey;
+ public static PartnerData: io.branch.referral.Defines.Jsonkey;
+ public static Instant: io.branch.referral.Defines.Jsonkey;
+ public static QRCodeTag: io.branch.referral.Defines.Jsonkey;
+ public static CodeColor: io.branch.referral.Defines.Jsonkey;
+ public static BackgroundColor: io.branch.referral.Defines.Jsonkey;
+ public static Width: io.branch.referral.Defines.Jsonkey;
+ public static Margin: io.branch.referral.Defines.Jsonkey;
+ public static ImageFormat: io.branch.referral.Defines.Jsonkey;
+ public static CenterLogo: io.branch.referral.Defines.Jsonkey;
+ public static QRCodeSettings: io.branch.referral.Defines.Jsonkey;
+ public static QRCodeData: io.branch.referral.Defines.Jsonkey;
+ public static QRCodeBranchKey: io.branch.referral.Defines.Jsonkey;
+ public static QRCodeResponseString: io.branch.referral.Defines.Jsonkey;
+ public static App_Store: io.branch.referral.Defines.Jsonkey;
+ public static Google_Play_Store: io.branch.referral.Defines.Jsonkey;
+ public static Huawei_App_Gallery: io.branch.referral.Defines.Jsonkey;
+ public static Samsung_Galaxy_Store: io.branch.referral.Defines.Jsonkey;
+ public static Xiaomi_Get_Apps: io.branch.referral.Defines.Jsonkey;
+ public static Meta_Install_Referrer: io.branch.referral.Defines.Jsonkey;
+ public static DMA_EEA: io.branch.referral.Defines.Jsonkey;
+ public static DMA_Ad_Personalization: io.branch.referral.Defines.Jsonkey;
+ public static DMA_Ad_User_Data: io.branch.referral.Defines.Jsonkey;
+ public static Is_Meta_Click_Through: io.branch.referral.Defines.Jsonkey;
+ public static OperationalMetrics: io.branch.referral.Defines.Jsonkey;
+ public static Consumer_Protection_Attribution_Level: io.branch.referral.Defines.Jsonkey;
+ public static Branch_Sdk_Request_Creation_Time_Stamp: io.branch.referral.Defines.Jsonkey;
+ public static Branch_Sdk_Request_Uuid: io.branch.referral.Defines.Jsonkey;
+ public static Invoke_Features: io.branch.referral.Defines.Jsonkey;
+ public static IN_APP_WEBVIEW: io.branch.referral.Defines.Jsonkey;
+ public static EXTERNAL_BROWSER: io.branch.referral.Defines.Jsonkey;
+ public static Enhanced_Web_Link_UX: io.branch.referral.Defines.Jsonkey;
+ public static Web_Link_Redirect_URL: io.branch.referral.Defines.Jsonkey;
+ public static Web_Link_Context: io.branch.referral.Defines.Jsonkey;
+ public static UX_Type: io.branch.referral.Defines.Jsonkey;
+ public static URL_Load_MS: io.branch.referral.Defines.Jsonkey;
+ public getKey(): string;
+ public static values(): androidNative.Array;
+ public toString(): string;
+ public static valueOf(name: string): io.branch.referral.Defines.Jsonkey;
+ }
+ export class LinkParam {
+ public static class: java.lang.Class;
+ public static Tags: io.branch.referral.Defines.LinkParam;
+ public static Alias: io.branch.referral.Defines.LinkParam;
+ public static Type: io.branch.referral.Defines.LinkParam;
+ public static Duration: io.branch.referral.Defines.LinkParam;
+ public static Channel: io.branch.referral.Defines.LinkParam;
+ public static Feature: io.branch.referral.Defines.LinkParam;
+ public static Stage: io.branch.referral.Defines.LinkParam;
+ public static Campaign: io.branch.referral.Defines.LinkParam;
+ public static Data: io.branch.referral.Defines.LinkParam;
+ public static URL: io.branch.referral.Defines.LinkParam;
+ public getKey(): string;
+ public static values(): androidNative.Array;
+ public toString(): string;
+ public static valueOf(name: string): io.branch.referral.Defines.LinkParam;
+ }
+ export class PreinstallKey {
+ public static class: java.lang.Class;
+ public static campaign: io.branch.referral.Defines.PreinstallKey;
+ public static partner: io.branch.referral.Defines.PreinstallKey;
+ public static values(): androidNative.Array;
+ public getKey(): string;
+ public toString(): string;
+ public static valueOf(name: string): io.branch.referral.Defines.PreinstallKey;
+ }
+ export class RequestPath {
+ public static class: java.lang.Class;
+ public static GetURL: io.branch.referral.Defines.RequestPath;
+ public static GetApp: io.branch.referral.Defines.RequestPath;
+ public static RegisterInstall: io.branch.referral.Defines.RequestPath;
+ public static RegisterOpen: io.branch.referral.Defines.RequestPath;
+ public static ContentEvent: io.branch.referral.Defines.RequestPath;
+ public static TrackStandardEvent: io.branch.referral.Defines.RequestPath;
+ public static TrackCustomEvent: io.branch.referral.Defines.RequestPath;
+ public static GetLATD: io.branch.referral.Defines.RequestPath;
+ public static QRCode: io.branch.referral.Defines.RequestPath;
+ public getPath(): string;
+ public static values(): androidNative.Array;
+ public toString(): string;
+ public static valueOf(name: string): io.branch.referral.Defines.RequestPath;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class DeviceInfo {
+ public static class: java.lang.Class;
+ public getHardwareID(): io.branch.referral.SystemObserver.UniqueId;
+ public getAppVersion(): string;
+ public getLastUpdateTime(): number;
+ public getPackageName(): string;
+ public getFirstInstallTime(): number;
+ public static isNullOrEmptyOrBlank(str: string): boolean;
+ public getOsName(): string;
+ public isPackageInstalled(): boolean;
+ }
+ export module DeviceInfo {
+ export class SystemObserverInstance extends io.branch.referral.SystemObserver {
+ public static class: java.lang.Class;
+ public constructor(param0: io.branch.referral.DeviceInfo);
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class InstantAppUtil {
+ public static class: java.lang.Class;
+ }
+ export module InstantAppUtil {
+ export class PackageManagerWrapper {
+ public static class: java.lang.Class;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class NativeShareLinkManager {
+ public static class: java.lang.Class;
+ public getLinkShareListenerCallback(): io.branch.referral.Branch.BranchNativeLinkShareListener;
+ public static getInstance(): io.branch.referral.NativeShareLinkManager;
+ }
+ export module NativeShareLinkManager {
+ export class NativeLinkShareListenerWrapper extends io.branch.referral.Branch.BranchNativeLinkShareListener {
+ public static class: java.lang.Class;
+ public onLinkShareResponse(sharedLink: string, error: io.branch.referral.BranchError): void;
+ public onChannelSelected(channelName: string): void;
+ public onLinkShareResponse(param0: string, param1: io.branch.referral.BranchError): void;
+ public onChannelSelected(param0: string): void;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class PrefHelper {
+ public static class: java.lang.Class;
+ public static NO_STRING_VALUE: string = 'bnc_no_value';
+ public static fbAppId_: string;
+ public setConsumerProtectionAttributionLevel(preference: io.branch.referral.Defines.BranchAttributionLevel): void;
+ public getExternalIntentUri(): string;
+ public getWebLinkUxTypeUsed(): string;
+ public setReferrerGclid(this_: string): void;
+ public setSessionParams(params: string): void;
+ public getLong(key: string, defaultValue: number): number;
+ public setRandomlyGeneratedUuid(uuid: string): void;
+ public getRandomlyGeneratedUuid(): string;
+ public setExternalIntentUri(uri: string): void;
+ public getAdNetworkCalloutsDisabled(): boolean;
+ public setPushIdentifier(pushIdentifier: string): void;
+ public getInstallParams(): string;
+ public getInteger(key: string, defaultValue: number): number;
+ public setIsMetaClickThrough(isMetaClickThrough: boolean): void;
+ public getAnonID(): string;
+ public getAPIBaseUrl(): string;
+ public setAppStoreSource(store: string): void;
+ public setWebLinkLoadTime(l: number): void;
+ public setString(key: string, value: string): void;
+ public getIsMetaClickThrough(): boolean;
+ public getConnectTimeout(): number;
+ public setLATDAttributionWindow(attributionWindow: number): void;
+ public getLinkClickID(): string;
+ public setLong(key: string, value: number): void;
+ public setTimeout(timeout: number): void;
+ public getRandomizedDeviceToken(): string;
+ public getInstallReferrerParams(): string;
+ public setExternalIntentExtra(extras: string): void;
+ public setAdNetworkCalloutsDisabled(disabled: boolean): void;
+ public getUserURL(): string;
+ public getLinkClickIdentifier(): string;
+ public setAppStoreReferrer(referrer: string): void;
+ public setReferringUrlQueryParameters(referringUrlQueryParameters: org.json.JSONObject): void;
+ public setLinkClickID(link_click_id: string): void;
+ public getAppStoreReferrer(): string;
+ public getRequestMetadata(): org.json.JSONObject;
+ public getAppLink(): string;
+ public setNoConnectionRetryMax(retryInt: number): void;
+ public setBool(key: string, value: java.lang.Boolean): void;
+ public setWebLinkUxTypeUsed(key: string): void;
+ public setConnectTimeout(connectTimeout: number): void;
+ public setReferrerGclidValidForWindow(window: number): void;
+ public getNoConnectionRetryMax(): number;
+ public getGoogleSearchInstallIdentifier(): string;
+ public getRetryInterval(): number;
+ public hasPrefValue(key: string): boolean;
+ public getActionTotalCount(action: string): number;
+ public getSessionID(): string;
+ public setRandomizedBundleToken(randomized_bundle_token: string): void;
+ public getReferrerGclid(): string;
+ public setRetryInterval(retryInt: number): void;
+ public clearUserValues(): void;
+ public getReferrerGclidValidForWindow(): number;
+ public setRetryCount(retry: number): void;
+ public getFloat(key: string): number;
+ public getString(key: string): string;
+ public setGoogleSearchInstallIdentifier(identifier: string): void;
+ public setActionUniqueCount(action: string, count: number): void;
+ public getLATDAttributionWindow(): number;
+ public getInstallMetadata(): org.json.JSONObject;
+ public setAppLink(appLinkUrl: string): void;
+ public getAppStoreSource(): string;
+ public getRandomizedBundleToken(): string;
+ public getSessionParams(): string;
+ public setAnonID(uuid: string): void;
+ public getTimeout(): number;
+ public getReferringURLQueryParameters(): org.json.JSONObject;
+ public removePrefValue(key: string): void;
+ public isFullAppConversion(): boolean;
+ public loadPartnerParams(body: org.json.JSONObject): void;
+ public setIdentity(identity: string): void;
+ public setIsFullAppConversion(isFullAppConversion: boolean): void;
+ public setRandomizedDeviceToken(randomized_device_token: string): void;
+ public getInteger(key: string): number;
+ public setInitialReferrer(initialReferrer: string): void;
+ public setSessionID(session_id: string): void;
+ public static getInstance(context: globalAndroid.content.Context): io.branch.referral.PrefHelper;
+ public clearGclid(): void;
+ public setBranchKey(key: string): boolean;
+ public setInstallParams(params: string): void;
+ public getInitialReferrer(): string;
+ public clearSystemReadStatus(): void;
+ public setLinkClickIdentifier(identifier: string): void;
+ public setBranchKeySource(source: string): void;
+ public getConsumerProtectionAttributionLevel(): io.branch.referral.Defines.BranchAttributionLevel;
+ public setActionTotalCount(action: string, count: number): void;
+ public getLong(key: string): number;
+ public getRetryCount(): number;
+ public getAPIBaseUrl(useCustom: boolean): string;
+ public setRequestMetadata(key: string, value: string): void;
+ public getPushIdentifier(): string;
+ public getTaskTimeout(): number;
+ public getActionUniqueCount(action: string): number;
+ public getDelayedSessionInitUsed(): boolean;
+ public getBranchKey(): string;
+ public setUserURL(user_url: string): void;
+ public getBranchKeySource(): string;
+ public getWebLinkLoadTime(): number;
+ public getAppVersion(): string;
+ public getExternalIntentExtra(): string;
+ public setDelayedSessionInitUsed(used: boolean): void;
+ public getIdentity(): string;
+ public setInteger(key: string, value: number): void;
+ public setAppVersion(version: string): void;
+ public setFloat(key: string, value: number): void;
+ public getBool(key: string): boolean;
+ public setInstallReferrerParams(params: string): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export module QRCode {
+ export class BranchQRCode {
+ public static class: java.lang.Class;
+ public setCodeColor(hexCodeColor: string): io.branch.referral.QRCode.BranchQRCode;
+ public setBackgroundColor(backgroundColor: number): io.branch.referral.QRCode.BranchQRCode;
+ public setCenterLogo(centerLogo: string): io.branch.referral.QRCode.BranchQRCode;
+ public getQRCodeAsImage(activity: globalAndroid.app.Activity, branchUniversalObject: io.branch.indexing.BranchUniversalObject, linkProperties: io.branch.referral.util.LinkProperties, callback: io.branch.referral.QRCode.BranchQRCode.BranchQRCodeImageHandler): void;
+ public constructor();
+ public setBackgroundColor(hexBackgroundColor: string): io.branch.referral.QRCode.BranchQRCode;
+ public setImageFormat(imageFormat: io.branch.referral.QRCode.BranchQRCode.BranchImageFormat): io.branch.referral.QRCode.BranchQRCode;
+ public getQRCodeAsData(context: globalAndroid.content.Context, branchUniversalObject: io.branch.indexing.BranchUniversalObject, linkProperties: io.branch.referral.util.LinkProperties, callback: io.branch.referral.QRCode.BranchQRCode.BranchQRCodeDataHandler): void;
+ public setCodeColor(codeColor: number): io.branch.referral.QRCode.BranchQRCode;
+ public setMargin(margin: java.lang.Integer): io.branch.referral.QRCode.BranchQRCode;
+ public setWidth(width: java.lang.Integer): io.branch.referral.QRCode.BranchQRCode;
+ }
+ export module BranchQRCode {
+ export class BranchImageFormat {
+ public static class: java.lang.Class;
+ public static JPEG: io.branch.referral.QRCode.BranchQRCode.BranchImageFormat;
+ public static PNG: io.branch.referral.QRCode.BranchQRCode.BranchImageFormat;
+ public static values(): androidNative.Array;
+ public static valueOf(name: string): io.branch.referral.QRCode.BranchQRCode.BranchImageFormat;
+ }
+ export class BranchQRCodeDataHandler extends java.lang.Object {
+ public static class: java.lang.Class>;
+ /**
+ * Constructs a new instance of the io.branch.referral.QRCode.BranchQRCode$BranchQRCodeDataHandler interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onSuccess(param0: androidNative.Array): void; onFailure(param0: java.lang.Exception): void });
+ public constructor();
+ public onSuccess(param0: androidNative.Array): void;
+ public onFailure(param0: java.lang.Exception): void;
+ }
+ export class BranchQRCodeImageHandler extends java.lang.Object {
+ public static class: java.lang.Class>;
+ /**
+ * Constructs a new instance of the io.branch.referral.QRCode.BranchQRCode$BranchQRCodeImageHandler interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onSuccess(param0: globalAndroid.graphics.Bitmap): void; onFailure(param0: java.lang.Exception): void });
+ public constructor();
+ public onFailure(param0: java.lang.Exception): void;
+ public onSuccess(param0: globalAndroid.graphics.Bitmap): void;
+ }
+ export class BranchQRCodeRequestHandler extends java.lang.Object {
+ public static class: java.lang.Class>;
+ /**
+ * Constructs a new instance of the io.branch.referral.QRCode.BranchQRCode$BranchQRCodeRequestHandler interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onDataReceived(param0: io.branch.referral.ServerResponse): void; onFailure(param0: java.lang.Exception): void });
+ public constructor();
+ public onFailure(param0: java.lang.Exception): void;
+ public onDataReceived(param0: io.branch.referral.ServerResponse): void;
+ }
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export module QRCode {
+ export class ServerRequestCreateQRCode extends io.branch.referral.ServerRequest {
+ public static class: java.lang.Class;
+ public clearCallbacks(): void;
+ public onRequestSucceeded(response: io.branch.referral.ServerResponse, branch: io.branch.referral.Branch): void;
+ public constructor(context: globalAndroid.content.Context, requestPath: io.branch.referral.Defines.RequestPath);
+ public prepareExecuteWithoutTracking(): boolean;
+ public constructor(requestPath: io.branch.referral.Defines.RequestPath, post: org.json.JSONObject, context: globalAndroid.content.Context);
+ public handleFailure(statusCode: number, causeMsg: string): void;
+ public onRequestQueued(): void;
+ public isGetRequest(): boolean;
+ public constructor(requestPath: io.branch.referral.Defines.RequestPath, post: org.json.JSONObject, context: globalAndroid.content.Context, callback: io.branch.referral.QRCode.BranchQRCode.BranchQRCodeRequestHandler);
+ public handleErrors(context: globalAndroid.content.Context): boolean;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ReferringUrlUtility {
+ public static class: java.lang.Class;
+ public serializeToJson$Branch_SDK_release(it: java.util.Map): org.json.JSONObject;
+ public deserializeFromJson$Branch_SDK_release(e: org.json.JSONObject): java.util.Map;
+ public parseReferringURL(paramName: string): void;
+ public getURLQueryParamsForRequest(keys: io.branch.referral.ServerRequest): org.json.JSONObject;
+ public constructor(prefHelper: io.branch.referral.PrefHelper);
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export abstract class ServerRequest {
+ public static class: java.lang.Class;
+ public creation_ts: number;
+ public uuid: string;
+ public prefHelper_: io.branch.referral.PrefHelper;
+ public constructError_: boolean;
+ public currentRetryCount: number;
+ public constructor(requestPath: io.branch.referral.Defines.RequestPath, post: org.json.JSONObject, context: globalAndroid.content.Context);
+ public shouldAddDMAParams(): boolean;
+ public getRequestUrl(): string;
+ public removeProcessWaitLock(lock: io.branch.referral.ServerRequest.PROCESS_WAIT_LOCK): void;
+ public onRequestQueued(): void;
+ public addProcessWaitLock(lock: io.branch.referral.ServerRequest.PROCESS_WAIT_LOCK): void;
+ public constructor(context: globalAndroid.content.Context, requestPath: io.branch.referral.Defines.RequestPath);
+ public shouldUpdateLimitFacebookTracking(): boolean;
+ public isWaitingOnProcessToFinish(): boolean;
+ public getQueueWaitTime(): number;
+ public prepareExecuteWithoutTracking(): boolean;
+ public handleFailure(param0: number, param1: string): void;
+ public shouldRetryOnFail(): boolean;
+ public getRequestPath(): string;
+ public setPost(this_: org.json.JSONObject): void;
+ public static fromJSON(e: org.json.JSONObject, e: globalAndroid.content.Context): io.branch.referral.ServerRequest;
+ public getGetParams(): org.json.JSONObject;
+ public addGetParam(this_: string, paramKey: string): void;
+ public handleErrors(param0: globalAndroid.content.Context): boolean;
+ public getPostWithInstrumentationValues(originalParams: java.util.concurrent.ConcurrentHashMap): org.json.JSONObject;
+ public toJSON(): org.json.JSONObject;
+ public printWaitLocks(): string;
+ public getBranchRemoteAPIVersion(): io.branch.referral.ServerRequest.BRANCH_API_VERSION;
+ public doesAppHasInternetPermission(context: globalAndroid.content.Context): boolean;
+ public onPreExecute(): void;
+ public isGetRequest(): boolean;
+ public isGAdsParamsRequired(): boolean;
+ public clearCallbacks(): void;
+ public updateEnvironment(environment: globalAndroid.content.Context, e: org.json.JSONObject): void;
+ public onRequestSucceeded(param0: io.branch.referral.ServerResponse, param1: io.branch.referral.Branch): void;
+ public getPost(): org.json.JSONObject;
+ }
+ export module ServerRequest {
+ export class BRANCH_API_VERSION {
+ public static class: java.lang.Class;
+ public static V1: io.branch.referral.ServerRequest.BRANCH_API_VERSION;
+ public static V1_LATD: io.branch.referral.ServerRequest.BRANCH_API_VERSION;
+ public static V2: io.branch.referral.ServerRequest.BRANCH_API_VERSION;
+ public static valueOf(name: string): io.branch.referral.ServerRequest.BRANCH_API_VERSION;
+ public static values(): androidNative.Array;
+ }
+ export class PROCESS_WAIT_LOCK {
+ public static class: java.lang.Class;
+ public static SDK_INIT_WAIT_LOCK: io.branch.referral.ServerRequest.PROCESS_WAIT_LOCK;
+ public static GAID_FETCH_WAIT_LOCK: io.branch.referral.ServerRequest.PROCESS_WAIT_LOCK;
+ public static INTENT_PENDING_WAIT_LOCK: io.branch.referral.ServerRequest.PROCESS_WAIT_LOCK;
+ public static USER_SET_WAIT_LOCK: io.branch.referral.ServerRequest.PROCESS_WAIT_LOCK;
+ public static INSTALL_REFERRER_FETCH_WAIT_LOCK: io.branch.referral.ServerRequest.PROCESS_WAIT_LOCK;
+ public static USER_AGENT_STRING_LOCK: io.branch.referral.ServerRequest.PROCESS_WAIT_LOCK;
+ public static valueOf(name: string): io.branch.referral.ServerRequest.PROCESS_WAIT_LOCK;
+ public static values(): androidNative.Array;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ServerRequestCreateUrl extends io.branch.referral.ServerRequest {
+ public static class: java.lang.Class;
+ public constructor(requestPath: io.branch.referral.Defines.RequestPath, post: org.json.JSONObject, context: globalAndroid.content.Context);
+ public onRequestSucceeded(ex: io.branch.referral.ServerResponse, this_: io.branch.referral.Branch): void;
+ public getLongUrl(): string;
+ public handleDuplicateURLError(): void;
+ public handleFailure(this_: number, statusCode: string): void;
+ public onUrlAvailable(url: string): void;
+ public handleErrors(context: globalAndroid.content.Context): boolean;
+ public getLinkPost(): io.branch.referral.BranchLinkData;
+ public constructor(context: globalAndroid.content.Context, requestPath: io.branch.referral.Defines.RequestPath);
+ public constructor(this_: globalAndroid.content.Context, context: string, alias: number, type: number, duration: java.util.Collection, tags: string, channel: string, feature: string, stage: string, campaign: org.json.JSONObject, params: io.branch.referral.Branch.BranchLinkCreateListener, callback: boolean, async: boolean);
+ public prepareExecuteWithoutTracking(): boolean;
+ public isAsync(): boolean;
+ public isGetRequest(): boolean;
+ public clearCallbacks(): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ServerRequestGetLATD extends io.branch.referral.ServerRequest {
+ public static class: java.lang.Class;
+ public static defaultAttributionWindow: number = -1;
+ public getAttributionWindow(): number;
+ public handleFailure(statusCode: number, causeMsg: string): void;
+ public onRequestSucceeded(response: io.branch.referral.ServerResponse, branch: io.branch.referral.Branch): void;
+ public isGetRequest(): boolean;
+ public handleErrors(context: globalAndroid.content.Context): boolean;
+ public clearCallbacks(): void;
+ public shouldUpdateLimitFacebookTracking(): boolean;
+ public getBranchRemoteAPIVersion(): io.branch.referral.ServerRequest.BRANCH_API_VERSION;
+ }
+ export module ServerRequestGetLATD {
+ export class BranchLastAttributedTouchDataListener {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.ServerRequestGetLATD$BranchLastAttributedTouchDataListener interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onDataFetched(param0: org.json.JSONObject, param1: io.branch.referral.BranchError): void });
+ public constructor();
+ public onDataFetched(param0: org.json.JSONObject, param1: io.branch.referral.BranchError): void;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export abstract class ServerRequestInitSession extends io.branch.referral.ServerRequest {
+ public static class: java.lang.Class;
+ public shouldAddDMAParams(): boolean;
+ public prepareExecuteWithoutTracking(): boolean;
+ public setPost(post: org.json.JSONObject): void;
+ public onPreExecute(): void;
+ public getRequestActionName(): string;
+ public onRequestSucceeded(response: io.branch.referral.ServerResponse, branch: io.branch.referral.Branch): void;
+ public shouldUpdateLimitFacebookTracking(): boolean;
+ public toJSON(): org.json.JSONObject;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ServerRequestLogEvent extends io.branch.referral.ServerRequest {
+ public static class: java.lang.Class;
+ public constructor(requestPath: io.branch.referral.Defines.RequestPath, post: org.json.JSONObject, context: globalAndroid.content.Context);
+ public shouldAddDMAParams(): boolean;
+ public handleFailure(statusCode: number, causeMsg: string): void;
+ public onRequestSucceeded(response: io.branch.referral.ServerResponse, branch: io.branch.referral.Branch): void;
+ public handleErrors(context: globalAndroid.content.Context): boolean;
+ public constructor(context: globalAndroid.content.Context, requestPath: io.branch.referral.Defines.RequestPath);
+ public shouldUpdateLimitFacebookTracking(): boolean;
+ public getBranchRemoteAPIVersion(): io.branch.referral.ServerRequest.BRANCH_API_VERSION;
+ public setPost(post: org.json.JSONObject): void;
+ public constructor(buo: globalAndroid.content.Context, contentItemsArray: io.branch.referral.Defines.RequestPath, e: string, this_: java.util.HashMap, context: org.json.JSONObject, requestPath: org.json.JSONObject, eventName: java.util.List);
+ public shouldRetryOnFail(): boolean;
+ public isGetRequest(): boolean;
+ public clearCallbacks(): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ServerRequestQueue {
+ public static class: java.lang.Class;
+ public postInitClear(): void;
+ public addExtraInstrumentationData(key: string, value: string): void;
+ public printQueue(): void;
+ public static getInstance(c: globalAndroid.content.Context): io.branch.referral.ServerRequestQueue;
+ public getSize(): number;
+ public removeAt(this_: number): io.branch.referral.ServerRequest;
+ public handleNewRequest(this_: io.branch.referral.ServerRequest): void;
+ public canClearInitData(): boolean;
+ public remove(this_: io.branch.referral.ServerRequest): boolean;
+ public addExtraInstrumentationData(instrumentationData: java.util.HashMap): void;
+ }
+ export module ServerRequestQueue {
+ export class BranchPostTask extends io.branch.referral.BranchAsyncTask {
+ public static class: java.lang.Class;
+ public doInBackground(this_: androidNative.Array): io.branch.referral.ServerResponse;
+ public constructor();
+ public onPreExecute(): void;
+ public onPostExecute(serverResponse: io.branch.referral.ServerResponse): void;
+ public constructor(request: io.branch.referral.ServerRequestQueue, latch: io.branch.referral.ServerRequest, param2: java.util.concurrent.CountDownLatch);
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ServerRequestRegisterInstall extends io.branch.referral.ServerRequestInitSession {
+ public static class: java.lang.Class;
+ public onPreExecute(): void;
+ public getRequestActionName(): string;
+ public shouldRetryOnFail(): boolean;
+ public isGetRequest(): boolean;
+ public handleErrors(context: globalAndroid.content.Context): boolean;
+ public clearCallbacks(): void;
+ public handleFailure(obj: number, this_: string): void;
+ public onRequestSucceeded(dataObj: io.branch.referral.ServerResponse, invokeFeaturesJson: io.branch.referral.Branch): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ServerRequestRegisterOpen extends io.branch.referral.ServerRequestInitSession {
+ public static class: java.lang.Class;
+ public onPreExecute(): void;
+ public getRequestActionName(): string;
+ public onRequestSucceeded(params: io.branch.referral.ServerResponse, ex: io.branch.referral.Branch): void;
+ public shouldRetryOnFail(): boolean;
+ public isGetRequest(): boolean;
+ public handleErrors(context: globalAndroid.content.Context): boolean;
+ public clearCallbacks(): void;
+ public handleFailure(obj: number, this_: string): void;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ServerResponse {
+ public static class: java.lang.Class;
+ public constructor(tag: string, statusCode: number, requestId: string, message: string);
+ public getObject(): org.json.JSONObject;
+ public getStatusCode(): number;
+ public getTag(): string;
+ public getFailReason(): string;
+ public getMessage(): string;
+ public setPost(post: any): void;
+ public getArray(): org.json.JSONArray;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class ShareLinkManager {
+ public static class: java.lang.Class;
+ }
+ export module ShareLinkManager {
+ export class ChooserArrayAdapter {
+ public static class: java.lang.Class;
+ public selectedPos: number;
+ public getItem(position: number): any;
+ public getCount(): number;
+ public isEnabled(position: number): boolean;
+ public getView(this_: number, position: globalAndroid.view.View, convertView: globalAndroid.view.ViewGroup): globalAndroid.view.View;
+ public getItemId(position: number): number;
+ }
+ export class CopyLinkItem {
+ public static class: java.lang.Class;
+ public loadIcon(pm: globalAndroid.content.pm.PackageManager): globalAndroid.graphics.drawable.Drawable;
+ public loadLabel(pm: globalAndroid.content.pm.PackageManager): string;
+ }
+ export class MoreShareItem {
+ public static class: java.lang.Class;
+ public loadIcon(pm: globalAndroid.content.pm.PackageManager): globalAndroid.graphics.drawable.Drawable;
+ public loadLabel(pm: globalAndroid.content.pm.PackageManager): string;
+ }
+ export class ShareItemView {
+ public static class: java.lang.Class;
+ public constructor(context: io.branch.referral.ShareLinkManager, param1: globalAndroid.content.Context);
+ public setLabel(appName: string, appIcon: globalAndroid.graphics.drawable.Drawable, isEnabled: boolean): void;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class SharingHelper {
+ public static class: java.lang.Class;
+ public constructor();
+ }
+ export module SharingHelper {
+ export class SHARE_WITH {
+ public static class: java.lang.Class;
+ public static FACEBOOK: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static FACEBOOK_MESSENGER: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static TWITTER: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static MESSAGE: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static EMAIL: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static FLICKR: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static GOOGLE_DOC: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static WHATS_APP: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static PINTEREST: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static HANGOUT: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static INSTAGRAM: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static WECHAT: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static SNAPCHAT: io.branch.referral.SharingHelper.SHARE_WITH;
+ public static GMAIL: io.branch.referral.SharingHelper.SHARE_WITH;
+ public toString(): string;
+ public static valueOf(name: string): io.branch.referral.SharingHelper.SHARE_WITH;
+ public getAppName(): string;
+ public static values(): androidNative.Array;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export abstract class SystemObserver {
+ public static class: java.lang.Class;
+ public fetchAdId(context: globalAndroid.content.Context, callback: io.branch.referral.SystemObserver.AdsParamsFetchEvents): void;
+ public fetchInstallReferrer(this_: globalAndroid.content.Context, context_: io.branch.referral.SystemObserver.InstallReferrerFetchEvents): void;
+ }
+ export module SystemObserver {
+ export class AdsParamsFetchEvents {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.SystemObserver$AdsParamsFetchEvents interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onAdsParamsFetchFinished(): void });
+ public constructor();
+ public onAdsParamsFetchFinished(): void;
+ }
+ export class InstallReferrerFetchEvents {
+ public static class: java.lang.Class;
+ /**
+ * Constructs a new instance of the io.branch.referral.SystemObserver$InstallReferrerFetchEvents interface with the provided implementation. An empty constructor exists calling super() when extending the interface class.
+ */
+ public constructor(implementation: { onInstallReferrersFinished(): void });
+ public constructor();
+ public onInstallReferrersFinished(): void;
+ }
+ export class UniqueId {
+ public static class: java.lang.Class;
+ public equals(other: any): boolean;
+ public hashCode(): number;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class TrackingController {
+ public static class: java.lang.Class;
+ public static isTrackingDisabled(context: globalAndroid.content.Context): boolean;
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export class UniversalResourceAnalyser {
+ public static class: java.lang.Class;
+ public static getInstance(context: globalAndroid.content.Context): io.branch.referral.UniversalResourceAnalyser;
+ }
+ export module UniversalResourceAnalyser {
+ export class UrlSkipListUpdateTask extends io.branch.referral.BranchAsyncTask {
+ public static class: java.lang.Class;
+ public onPostExecute(updatedURLFormatsObj: org.json.JSONObject): void;
+ public doInBackground(update_url_path: androidNative.Array): org.json.JSONObject;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export module network {
+ export abstract class BranchRemoteInterface {
+ public static class: java.lang.Class;
+ public static RETRY_NUMBER: string = 'retryNumber';
+ public make_restful_get(response: string, brttVal: org.json.JSONObject, branchError: string, brttVal: string): io.branch.referral.ServerResponse;
+ public constructor();
+ public doRestfulPost(param0: string, param1: org.json.JSONObject): io.branch.referral.network.BranchRemoteInterface.BranchResponse;
+ public doRestfulGet(param0: string): io.branch.referral.network.BranchRemoteInterface.BranchResponse;
+ public make_restful_post(response: org.json.JSONObject, brttVal: string, branchError: string, brttVal: string): io.branch.referral.ServerResponse;
+ }
+ export module BranchRemoteInterface {
+ export class BranchRemoteException {
+ public static class: java.lang.Class;
+ public constructor(errorCode: number, errorMessage: string);
+ public constructor(errorCode: number);
+ }
+ export class BranchResponse {
+ public static class: java.lang.Class;
+ public constructor(responseData: string, responseCode: number);
+ }
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export module network {
+ export class BranchRemoteInterfaceUrlConnection extends io.branch.referral.network.BranchRemoteInterface {
+ public static class: java.lang.Class;
+ public constructor();
+ public constructor(branch: io.branch.referral.Branch);
+ public doRestfulGet(url: string): io.branch.referral.network.BranchRemoteInterface.BranchResponse;
+ public doRestfulPost(url: string, payload: org.json.JSONObject): io.branch.referral.network.BranchRemoteInterface.BranchResponse;
+ }
+ }
+ }
+ }
+}
+
+declare module io {
+ export module branch {
+ export module referral {
+ export module util {
+ export class AdType {
+ public static class: java.lang.Class;
+ public static BANNER: io.branch.referral.util.AdType;
+ public static INTERSTITIAL: io.branch.referral.util.AdType;
+ public static REWARDED_VIDEO: io.branch.referral.util.AdType;
+ public static NATIVE: io.branch.referral.util.AdType;
+ public static valueOf(name: string): io.branch.referral.util.AdType;
+ public getName(): string;
+ public static values(): androidNative.Array