@btsd/aitu-bridge 0.3.41 → 0.3.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/index.ts +19 -0
- package/src/version.ts +1 -1
package/src/index.ts
CHANGED
|
@@ -150,6 +150,7 @@ export interface AituBridge {
|
|
|
150
150
|
setCustomBackArrowVisible: (visible: boolean) => Promise<ResponseType>;
|
|
151
151
|
openPayment: (transactionId: string) => Promise<ResponseType>;
|
|
152
152
|
setCustomBackArrowOnClickHandler: (handler: BackArrowClickHandlerType) => void;
|
|
153
|
+
checkBiometry: () => Promise<ResponseType>;
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
const invokeMethod = 'invoke';
|
|
@@ -177,6 +178,7 @@ const getCustomBackArrowModeMethod = 'getCustomBackArrowMode';
|
|
|
177
178
|
const setCustomBackArrowVisibleMethod = 'setCustomBackArrowVisible';
|
|
178
179
|
const openPaymentMethod = 'openPayment'
|
|
179
180
|
const setCustomBackArrowOnClickHandlerMethod = 'setCustomBackArrowOnClickHandler';
|
|
181
|
+
const checkBiometryMethod = 'checkBiometry';
|
|
180
182
|
|
|
181
183
|
const android = typeof window !== 'undefined' && (window as any).AndroidBridge;
|
|
182
184
|
const ios = typeof window !== 'undefined' && (window as any).webkit && (window as any).webkit.messageHandlers;
|
|
@@ -621,6 +623,21 @@ const buildBridge = (): AituBridge => {
|
|
|
621
623
|
}
|
|
622
624
|
}
|
|
623
625
|
|
|
626
|
+
const checkBiometry = (reqId) => {
|
|
627
|
+
const isAndroid = android && android[checkBiometryMethod];
|
|
628
|
+
const isIos = ios && ios[checkBiometryMethod];
|
|
629
|
+
|
|
630
|
+
if (isAndroid) {
|
|
631
|
+
android[checkBiometryMethod](reqId);
|
|
632
|
+
} else if (isIos) {
|
|
633
|
+
ios[checkBiometryMethod].postMessage({ reqId });
|
|
634
|
+
} else if (web) {
|
|
635
|
+
web.execute(checkBiometryMethod, reqId);
|
|
636
|
+
} else if (typeof window !== 'undefined') {
|
|
637
|
+
console.log('--checkBiometry-isUnknown');
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
624
641
|
|
|
625
642
|
const invokePromise = promisifyInvoke(invoke, sub);
|
|
626
643
|
const storagePromise = promisifyStorage(storage, sub);
|
|
@@ -643,6 +660,7 @@ const buildBridge = (): AituBridge => {
|
|
|
643
660
|
const getCustomBackArrowModePromise = promisifyMethod(getCustomBackArrowMode, getCustomBackArrowModeMethod, sub);
|
|
644
661
|
const setCustomBackArrowVisiblePromise = promisifyMethod(setCustomBackArrowVisible, setCustomBackArrowVisibleMethod, sub);
|
|
645
662
|
const openPaymentPromise = promisifyMethod(openPayment, openPaymentMethod, sub);
|
|
663
|
+
const checkBiometryPromise = promisifyMethod(checkBiometry, checkBiometryMethod, sub);
|
|
646
664
|
|
|
647
665
|
return {
|
|
648
666
|
version: String(LIB_VERSION),
|
|
@@ -682,6 +700,7 @@ const buildBridge = (): AituBridge => {
|
|
|
682
700
|
setCustomBackArrowVisible: setCustomBackArrowVisiblePromise,
|
|
683
701
|
openPayment: openPaymentPromise,
|
|
684
702
|
setCustomBackArrowOnClickHandler,
|
|
703
|
+
checkBiometry: checkBiometryPromise,
|
|
685
704
|
}
|
|
686
705
|
}
|
|
687
706
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.3.
|
|
1
|
+
export const LIB_VERSION = "0.3.43";
|