webtonative 1.0.76 → 1.0.78
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/ATTConsent/index.d.ts +16 -0
- package/ATTConsent/index.js +53 -1
- package/ATTConsent/types.d.ts +14 -0
- package/ATTConsent/types.js +2 -0
- package/AdMob/index.d.ts +30 -0
- package/AdMob/index.js +101 -1
- package/AdMob/types.d.ts +24 -0
- package/AdMob/types.js +3 -0
- package/AppReview/index.d.ts +6 -0
- package/AppReview/index.js +21 -1
- package/AppReview/types.d.ts +7 -0
- package/AppReview/types.js +3 -0
- package/AppsFlyer/index.d.ts +14 -0
- package/AppsFlyer/index.js +42 -4
- package/AppsFlyer/types.d.ts +9 -0
- package/AppsFlyer/types.js +2 -0
- package/BackgroundLocation/index.d.ts +11 -0
- package/BackgroundLocation/index.js +64 -4
- package/BackgroundLocation/types.d.ts +31 -0
- package/BackgroundLocation/types.js +2 -0
- package/Beacon/index.d.ts +6 -0
- package/Beacon/index.js +29 -1
- package/Beacon/types.d.ts +18 -0
- package/Beacon/types.js +2 -0
- package/Biometric/index.d.ts +26 -0
- package/Biometric/index.js +124 -1
- package/Biometric/types.d.ts +23 -0
- package/Biometric/types.js +2 -0
- package/Bluetooth/index.d.ts +16 -0
- package/Bluetooth/index.js +66 -1
- package/Bluetooth/types.d.ts +33 -0
- package/Bluetooth/types.js +2 -0
- package/BottomNavigation/index.d.ts +10 -0
- package/BottomNavigation/index.js +40 -4
- package/BottomNavigation/types.d.ts +8 -0
- package/BottomNavigation/types.js +2 -0
- package/Clipboard/index.d.ts +11 -0
- package/Clipboard/index.js +44 -4
- package/Clipboard/types.d.ts +19 -0
- package/Clipboard/types.js +3 -0
- package/Facebook/events.d.ts +12 -0
- package/Facebook/events.js +43 -4
- package/Facebook/index.d.ts +2 -0
- package/Facebook/index.js +28 -1
- package/Facebook/types.d.ts +21 -0
- package/Facebook/types.js +2 -0
- package/Firebase/Analytics/index.d.ts +31 -0
- package/Firebase/Analytics/index.js +109 -4
- package/Firebase/Messaging/index.d.ts +16 -0
- package/Firebase/Messaging/index.js +63 -4
- package/Firebase/index.d.ts +3 -0
- package/Firebase/index.js +30 -1
- package/Firebase/types.d.ts +57 -0
- package/Firebase/types.js +3 -0
- package/FirebaseAnalytics/index.d.ts +2 -0
- package/FirebaseAnalytics/index.js +28 -1
- package/Haptics/index.d.ts +6 -0
- package/Haptics/index.js +20 -1
- package/Haptics/types.d.ts +7 -0
- package/Haptics/types.js +2 -0
- package/InAppPurchase/index.d.ts +22 -0
- package/InAppPurchase/index.js +80 -1
- package/InAppPurchase/types.d.ts +33 -0
- package/InAppPurchase/types.js +2 -0
- package/InAppUpdate/index.d.ts +11 -0
- package/InAppUpdate/index.js +38 -1
- package/InAppUpdate/types.d.ts +14 -0
- package/InAppUpdate/types.js +2 -0
- package/MediaPlayer/index.d.ts +16 -0
- package/MediaPlayer/index.js +55 -7
- package/MediaPlayer/types.d.ts +13 -0
- package/MediaPlayer/types.js +2 -0
- package/NativeContacts/index.d.ts +11 -0
- package/NativeContacts/index.js +50 -6
- package/NativeContacts/types.d.ts +13 -0
- package/NativeContacts/types.js +2 -0
- package/NativeDatastore/index.d.ts +7 -0
- package/NativeDatastore/index.js +134 -1
- package/NativeDatastore/type.d.ts +23 -0
- package/NativeDatastore/type.js +2 -0
- package/Notification/index.d.ts +10 -0
- package/Notification/index.js +41 -5
- package/Notification/types.d.ts +13 -0
- package/Notification/types.js +2 -0
- package/OneSignal/index.d.ts +17 -0
- package/OneSignal/index.js +264 -1
- package/OneSignal/types.d.ts +40 -0
- package/OneSignal/types.js +3 -0
- package/Printing/index.d.ts +6 -0
- package/Printing/index.js +19 -1
- package/Printing/types.d.ts +8 -0
- package/Printing/types.js +2 -0
- package/README.md +31 -2
- package/Screen/index.d.ts +8 -0
- package/Screen/index.js +34 -4
- package/Screen/types.d.ts +5 -0
- package/Screen/types.js +3 -0
- package/Siri/index.d.ts +6 -0
- package/Siri/index.js +25 -1
- package/Siri/types.d.ts +13 -0
- package/Siri/types.js +2 -0
- package/SocialLogin/apple/index.d.ts +11 -0
- package/SocialLogin/apple/index.js +31 -0
- package/SocialLogin/facebook/index.d.ts +21 -0
- package/SocialLogin/facebook/index.js +60 -0
- package/SocialLogin/google/index.d.ts +21 -0
- package/SocialLogin/google/index.js +60 -0
- package/SocialLogin/index.d.ts +16 -0
- package/SocialLogin/index.js +22 -1
- package/SocialLogin/types.d.ts +38 -0
- package/SocialLogin/types.js +2 -0
- package/Stripe/index.d.ts +2 -0
- package/Stripe/index.js +48 -1
- package/Stripe/types.d.ts +31 -0
- package/Stripe/types.js +2 -0
- package/VoiceSearch/index.d.ts +12 -0
- package/VoiceSearch/index.js +33 -1
- package/VoiceSearch/types.d.ts +9 -0
- package/VoiceSearch/types.js +2 -0
- package/barcode/barcode-scan.d.ts +15 -0
- package/barcode/barcode-scan.js +39 -1
- package/barcode/barcode-types.d.ts +17 -0
- package/barcode/barcode-types.js +2 -0
- package/barcode/formats.d.ts +17 -0
- package/barcode/formats.js +22 -1
- package/barcode/index.d.ts +4 -0
- package/barcode/index.js +12 -1
- package/barcode/types.d.ts +16 -0
- package/barcode/types.js +21 -1
- package/index.d.ts +155 -0
- package/index.js +540 -2
- package/package.json +150 -3
- package/types/index.d.ts +49 -0
- package/types/index.js +3 -0
- package/utills.d.ts +11 -0
- package/utills.js +110 -1
- package/webtonative.min.js +1 -1
- package/SocialLogin/apple.js +0 -1
- package/SocialLogin/facebook.js +0 -9
- package/SocialLogin/google.js +0 -9
package/Biometric/index.js
CHANGED
|
@@ -1 +1,124 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.biometricAuthWithDismissOnCancel = exports.show = exports.deleteSecret = exports.saveSecret = exports.checkStatus = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Checks the status of biometric authentication
|
|
7
|
+
* @param options - Options for checking biometric status
|
|
8
|
+
*/
|
|
9
|
+
var checkStatus = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
var callback = options.callback;
|
|
12
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
13
|
+
(0, utills_1.registerCb)(function (response) {
|
|
14
|
+
var type = response.type;
|
|
15
|
+
if (type === "checkBiometricStatus") {
|
|
16
|
+
callback && callback(response);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
20
|
+
utills_1.webToNative.checkBiometricStatus();
|
|
21
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
22
|
+
utills_1.webToNativeIos.postMessage({
|
|
23
|
+
action: "checkBiometricStatus",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.checkStatus = checkStatus;
|
|
29
|
+
/**
|
|
30
|
+
* Saves a secret using biometric authentication
|
|
31
|
+
* @param options - Options for saving biometric secret
|
|
32
|
+
*/
|
|
33
|
+
var saveSecret = function (options) {
|
|
34
|
+
if (options === void 0) { options = {}; }
|
|
35
|
+
var callback = options.callback, secret = options.secret;
|
|
36
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
37
|
+
(0, utills_1.registerCb)(function (response) {
|
|
38
|
+
var type = response.type;
|
|
39
|
+
if (type === "saveBiometricSecret") {
|
|
40
|
+
callback && callback(response);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
44
|
+
utills_1.webToNative.saveSecret(secret);
|
|
45
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
46
|
+
utills_1.webToNativeIos.postMessage({
|
|
47
|
+
action: "saveBiometricSecret",
|
|
48
|
+
secret: secret
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.saveSecret = saveSecret;
|
|
54
|
+
/**
|
|
55
|
+
* Deletes a saved biometric secret
|
|
56
|
+
* @param options - Options for deleting biometric secret
|
|
57
|
+
*/
|
|
58
|
+
var deleteSecret = function (options) {
|
|
59
|
+
if (options === void 0) { options = {}; }
|
|
60
|
+
var callback = options.callback;
|
|
61
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
62
|
+
(0, utills_1.registerCb)(function (response) {
|
|
63
|
+
var type = response.type;
|
|
64
|
+
if (type === "deleteBiometricSecret") {
|
|
65
|
+
callback && callback(response);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
69
|
+
utills_1.webToNative.deleteSecret();
|
|
70
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
71
|
+
utills_1.webToNativeIos.postMessage({
|
|
72
|
+
action: "deleteBiometricSecret",
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
exports.deleteSecret = deleteSecret;
|
|
78
|
+
/**
|
|
79
|
+
* Shows biometric authentication prompt
|
|
80
|
+
* @param options - Options for showing biometric prompt
|
|
81
|
+
*/
|
|
82
|
+
var show = function (options) {
|
|
83
|
+
if (options === void 0) { options = {}; }
|
|
84
|
+
var callback = options.callback, prompt = options.prompt;
|
|
85
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
86
|
+
(0, utills_1.registerCb)(function (response) {
|
|
87
|
+
var type = response.type;
|
|
88
|
+
if (type === "showBiometric") {
|
|
89
|
+
callback && callback(response);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
93
|
+
utills_1.webToNative.callBiometric(prompt || "Authenticate to continue!");
|
|
94
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
95
|
+
utills_1.webToNativeIos.postMessage({
|
|
96
|
+
action: "showBiometric",
|
|
97
|
+
prompt: prompt || '',
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
exports.show = show;
|
|
103
|
+
/**
|
|
104
|
+
* Shows biometric authentication with dismiss on cancel (Android only)
|
|
105
|
+
* @param options - Options for biometric authentication with dismiss on cancel
|
|
106
|
+
*/
|
|
107
|
+
var biometricAuthWithDismissOnCancel = function (options) {
|
|
108
|
+
if (options === void 0) { options = {}; }
|
|
109
|
+
var callback = options.callback, prompt = options.prompt, _a = options.isAuthenticationOptional, isAuthenticationOptional = _a === void 0 ? false : _a;
|
|
110
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
111
|
+
(0, utills_1.registerCb)(function (response) {
|
|
112
|
+
var type = response.type;
|
|
113
|
+
if (type === "biometricAuthWithDismissOnCancel") {
|
|
114
|
+
callback && callback(response);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
118
|
+
utills_1.webToNative.biometricAuthWithDismissOnCancel(JSON.stringify({
|
|
119
|
+
prompt: prompt || "Authenticate to continue!",
|
|
120
|
+
isAuthenticationOptional: isAuthenticationOptional
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
exports.biometricAuthWithDismissOnCancel = biometricAuthWithDismissOnCancel;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface BiometricResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
status?: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface BiometricCallback {
|
|
7
|
+
(response: BiometricResponse): void;
|
|
8
|
+
}
|
|
9
|
+
export interface BiometricOptions {
|
|
10
|
+
callback?: BiometricCallback;
|
|
11
|
+
secret?: string;
|
|
12
|
+
prompt?: string;
|
|
13
|
+
isAuthenticationOptional?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface BiometricIosMessage {
|
|
16
|
+
action: string;
|
|
17
|
+
secret?: string;
|
|
18
|
+
prompt?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface BiometricAuthOptions {
|
|
21
|
+
prompt?: string;
|
|
22
|
+
isAuthenticationOptional?: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BluetoothScanOptions, BluetoothPairOptions, BluetoothUnpairOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Starts scanning for Bluetooth devices (Android only)
|
|
4
|
+
* @param options - Options for Bluetooth scanning
|
|
5
|
+
*/
|
|
6
|
+
export declare const startBluetoothScan: (options?: BluetoothScanOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Pairs with a Bluetooth device (Android only)
|
|
9
|
+
* @param options - Options for pairing with a Bluetooth device
|
|
10
|
+
*/
|
|
11
|
+
export declare const pairDevice: (options?: BluetoothPairOptions) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Unpairs from a Bluetooth device (Android only)
|
|
14
|
+
* @param options - Options for unpairing from a Bluetooth device
|
|
15
|
+
*/
|
|
16
|
+
export declare const unpairDevice: (options?: BluetoothUnpairOptions) => void;
|
package/Bluetooth/index.js
CHANGED
|
@@ -1 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unpairDevice = exports.pairDevice = exports.startBluetoothScan = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Starts scanning for Bluetooth devices (Android only)
|
|
7
|
+
* @param options - Options for Bluetooth scanning
|
|
8
|
+
*/
|
|
9
|
+
var startBluetoothScan = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
var callback = options.callback;
|
|
12
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
13
|
+
(0, utills_1.registerCb)(function (response) {
|
|
14
|
+
var type = response.type;
|
|
15
|
+
if (type === "startBluetoothScan") {
|
|
16
|
+
callback && callback(response);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
20
|
+
utills_1.webToNative.startBluetoothScan();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.startBluetoothScan = startBluetoothScan;
|
|
24
|
+
/**
|
|
25
|
+
* Pairs with a Bluetooth device (Android only)
|
|
26
|
+
* @param options - Options for pairing with a Bluetooth device
|
|
27
|
+
*/
|
|
28
|
+
var pairDevice = function (options) {
|
|
29
|
+
if (options === void 0) { options = {}; }
|
|
30
|
+
var callback = options.callback, address = options.address, _a = options.timeout, timeout = _a === void 0 ? 10 : _a;
|
|
31
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
32
|
+
(0, utills_1.registerCb)(function (response) {
|
|
33
|
+
var type = response.type;
|
|
34
|
+
if (type === "pairWithDevice") {
|
|
35
|
+
callback && callback(response);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
39
|
+
utills_1.webToNative.pairWithDevice(JSON.stringify({
|
|
40
|
+
address: address,
|
|
41
|
+
timeout: timeout
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.pairDevice = pairDevice;
|
|
46
|
+
/**
|
|
47
|
+
* Unpairs from a Bluetooth device (Android only)
|
|
48
|
+
* @param options - Options for unpairing from a Bluetooth device
|
|
49
|
+
*/
|
|
50
|
+
var unpairDevice = function (options) {
|
|
51
|
+
if (options === void 0) { options = {}; }
|
|
52
|
+
var callback = options.callback, address = options.address;
|
|
53
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
54
|
+
(0, utills_1.registerCb)(function (response) {
|
|
55
|
+
var type = response.type;
|
|
56
|
+
if (type === "unpairDevice") {
|
|
57
|
+
callback && callback(response);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
61
|
+
utills_1.webToNative.unpairDevice(JSON.stringify({
|
|
62
|
+
address: address
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.unpairDevice = unpairDevice;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface BluetoothResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
status?: string;
|
|
4
|
+
devices?: BluetoothDevice[];
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface BluetoothDevice {
|
|
8
|
+
name?: string;
|
|
9
|
+
address?: string;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
export interface BluetoothCallback {
|
|
13
|
+
(response: BluetoothResponse): void;
|
|
14
|
+
}
|
|
15
|
+
export interface BluetoothScanOptions {
|
|
16
|
+
callback?: BluetoothCallback;
|
|
17
|
+
}
|
|
18
|
+
export interface BluetoothPairOptions {
|
|
19
|
+
callback?: BluetoothCallback;
|
|
20
|
+
address?: string;
|
|
21
|
+
timeout?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface BluetoothUnpairOptions {
|
|
24
|
+
callback?: BluetoothCallback;
|
|
25
|
+
address?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface BluetoothPairParams {
|
|
28
|
+
address?: string;
|
|
29
|
+
timeout?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface BluetoothUnpairParams {
|
|
32
|
+
address?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BottomNavigationShowOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Hides the bottom navigation
|
|
4
|
+
*/
|
|
5
|
+
export declare const hide: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Shows the bottom navigation
|
|
8
|
+
* @param options - Options for showing bottom navigation
|
|
9
|
+
*/
|
|
10
|
+
export declare const show: (options?: BottomNavigationShowOptions) => void;
|
|
@@ -1,4 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.show = exports.hide = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Hides the bottom navigation
|
|
7
|
+
*/
|
|
8
|
+
var hide = function () {
|
|
9
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
10
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
11
|
+
utills_1.webToNative.showHideStickyFooter(false);
|
|
12
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
13
|
+
utills_1.webToNativeIos.postMessage({
|
|
14
|
+
action: "showHideStickyFooter",
|
|
15
|
+
show: false,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.hide = hide;
|
|
21
|
+
/**
|
|
22
|
+
* Shows the bottom navigation
|
|
23
|
+
* @param options - Options for showing bottom navigation
|
|
24
|
+
*/
|
|
25
|
+
var show = function (options) {
|
|
26
|
+
if (options === void 0) { options = {}; }
|
|
27
|
+
var key = options.key;
|
|
28
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
29
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
30
|
+
utills_1.webToNative.showHideStickyFooter(true);
|
|
31
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
32
|
+
utills_1.webToNativeIos.postMessage({
|
|
33
|
+
action: "showHideStickyFooter",
|
|
34
|
+
show: true,
|
|
35
|
+
key: key,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.show = show;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GetClipboardOptions, SetClipboardOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Gets content from clipboard
|
|
4
|
+
* @param options - Options for getting clipboard content
|
|
5
|
+
*/
|
|
6
|
+
export declare const get: (options?: GetClipboardOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Sets content to clipboard
|
|
9
|
+
* @param options - Options for setting clipboard content
|
|
10
|
+
*/
|
|
11
|
+
export declare const set: (options?: SetClipboardOptions) => void;
|
package/Clipboard/index.js
CHANGED
|
@@ -1,4 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.set = exports.get = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Gets content from clipboard
|
|
7
|
+
* @param options - Options for getting clipboard content
|
|
8
|
+
*/
|
|
9
|
+
var get = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
var callback = options.callback;
|
|
12
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
13
|
+
(0, utills_1.registerCb)(function (response) {
|
|
14
|
+
var type = response.type;
|
|
15
|
+
if (type === "CLIPBOARD_CONTENT") {
|
|
16
|
+
callback && callback(response);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
20
|
+
utills_1.webToNativeIos.postMessage({
|
|
21
|
+
action: "getClipBoardData",
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.getText();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.get = get;
|
|
28
|
+
/**
|
|
29
|
+
* Sets content to clipboard
|
|
30
|
+
* @param options - Options for setting clipboard content
|
|
31
|
+
*/
|
|
32
|
+
var set = function (options) {
|
|
33
|
+
if (options === void 0) { options = {}; }
|
|
34
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
35
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
36
|
+
utills_1.webToNativeIos.postMessage({
|
|
37
|
+
action: "setClipBoardData",
|
|
38
|
+
text: options.data || "",
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.setText(options.data || "");
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.set = set;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ClipboardResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
content?: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export type ClipboardCallback = (response: ClipboardResponse) => void;
|
|
7
|
+
export interface GetClipboardOptions {
|
|
8
|
+
callback?: ClipboardCallback;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export interface SetClipboardOptions {
|
|
12
|
+
data?: string;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface ClipboardIosMessage {
|
|
16
|
+
action: string;
|
|
17
|
+
text?: string;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FacebookEventOptions, FacebookPurchaseOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Sends a Facebook event
|
|
4
|
+
* @param options - Options for the Facebook event
|
|
5
|
+
*/
|
|
6
|
+
export declare const send: (options: FacebookEventOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Sends a Facebook purchase event
|
|
9
|
+
* @param options - Options for the Facebook purchase event
|
|
10
|
+
* @example wtn.facebook.events.sendPurchase({amount: 10.99, currency: "USD", parameters: {item_name: "Product"}});
|
|
11
|
+
*/
|
|
12
|
+
export declare const sendPurchase: (options: FacebookPurchaseOptions) => void;
|
package/Facebook/events.js
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendPurchase = exports.send = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Sends a Facebook event
|
|
7
|
+
* @param options - Options for the Facebook event
|
|
8
|
+
*/
|
|
9
|
+
var send = function (options) {
|
|
10
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
11
|
+
var event_1 = options.event, valueToSum = options.valueToSum, parameters = options.parameters;
|
|
12
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.addFbEvents(event_1, parameters);
|
|
13
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
14
|
+
utills_1.webToNativeIos.postMessage({
|
|
15
|
+
action: "sendFBEvent",
|
|
16
|
+
eventName: event_1,
|
|
17
|
+
valueToSum: valueToSum,
|
|
18
|
+
parameters: parameters,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.send = send;
|
|
24
|
+
/**
|
|
25
|
+
* Sends a Facebook purchase event
|
|
26
|
+
* @param options - Options for the Facebook purchase event
|
|
27
|
+
* @example wtn.facebook.events.sendPurchase({amount: 10.99, currency: "USD", parameters: {item_name: "Product"}});
|
|
28
|
+
*/
|
|
29
|
+
var sendPurchase = function (options) {
|
|
30
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
31
|
+
var amount = options.amount, currency = options.currency, parameters = options.parameters;
|
|
32
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.addFbPurchaseEvent(amount, currency, parameters);
|
|
33
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
34
|
+
utills_1.webToNativeIos.postMessage({
|
|
35
|
+
action: "sendFBPurchaseEvent",
|
|
36
|
+
currency: currency,
|
|
37
|
+
amount: amount,
|
|
38
|
+
parameters: parameters,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.sendPurchase = sendPurchase;
|
package/Facebook/index.js
CHANGED
|
@@ -1 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.events = void 0;
|
|
27
|
+
var events = __importStar(require("./events"));
|
|
28
|
+
exports.events = events;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface FacebookEventParameters {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
export interface FacebookEventOptions {
|
|
5
|
+
event: string;
|
|
6
|
+
valueToSum?: number;
|
|
7
|
+
parameters?: FacebookEventParameters;
|
|
8
|
+
}
|
|
9
|
+
export interface FacebookPurchaseOptions {
|
|
10
|
+
amount: number;
|
|
11
|
+
currency: string;
|
|
12
|
+
parameters?: FacebookEventParameters;
|
|
13
|
+
}
|
|
14
|
+
export interface FacebookEventIosMessage {
|
|
15
|
+
action: string;
|
|
16
|
+
eventName?: string;
|
|
17
|
+
valueToSum?: number;
|
|
18
|
+
parameters?: FacebookEventParameters;
|
|
19
|
+
currency?: string;
|
|
20
|
+
amount?: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FirebaseAnalyticsCollectionOptions, FirebaseUserIdOptions, FirebaseUserPropertyOptions, FirebaseDefaultParametersOptions, FirebaseEventOptions, FirebaseScreenOptions } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Sets Firebase Analytics collection enabled or disabled
|
|
4
|
+
* @param options - Options for setting analytics collection
|
|
5
|
+
*/
|
|
6
|
+
export declare const setCollection: (options: FirebaseAnalyticsCollectionOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Sets Firebase user ID
|
|
9
|
+
* @param options - Options for setting user ID
|
|
10
|
+
*/
|
|
11
|
+
export declare const setUserId: (options: FirebaseUserIdOptions) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Sets a Firebase user property
|
|
14
|
+
* @param options - Options for setting user property
|
|
15
|
+
*/
|
|
16
|
+
export declare const setUserProperty: (options: FirebaseUserPropertyOptions) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Sets default event parameters for Firebase Analytics
|
|
19
|
+
* @param options - Options for setting default parameters
|
|
20
|
+
*/
|
|
21
|
+
export declare const setDefaultEventParameters: (options: FirebaseDefaultParametersOptions) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Logs a Firebase Analytics event
|
|
24
|
+
* @param options - Options for logging an event
|
|
25
|
+
*/
|
|
26
|
+
export declare const logEvent: (options: FirebaseEventOptions) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Logs a Firebase Analytics screen view
|
|
29
|
+
* @param options - Options for logging a screen view
|
|
30
|
+
*/
|
|
31
|
+
export declare const logScreen: (options: FirebaseScreenOptions) => void;
|