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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ATTConsentOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* This function opens ATTConsent
|
|
4
|
+
* @param options - Options for ATT consent request
|
|
5
|
+
* @example wtn.ATTConsent.request({
|
|
6
|
+
* callback:(value)=>{
|
|
7
|
+
* console.log(value);
|
|
8
|
+
* }
|
|
9
|
+
* });
|
|
10
|
+
*/
|
|
11
|
+
export declare const request: (options?: ATTConsentOptions) => void;
|
|
12
|
+
/**
|
|
13
|
+
* This function gets the current ATT consent status
|
|
14
|
+
* @param options - Options for ATT consent status
|
|
15
|
+
*/
|
|
16
|
+
export declare const status: (options?: ATTConsentOptions) => void;
|
package/ATTConsent/index.js
CHANGED
|
@@ -1 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.status = exports.request = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* This function opens ATTConsent
|
|
7
|
+
* @param options - Options for ATT consent request
|
|
8
|
+
* @example wtn.ATTConsent.request({
|
|
9
|
+
* callback:(value)=>{
|
|
10
|
+
* console.log(value);
|
|
11
|
+
* }
|
|
12
|
+
* });
|
|
13
|
+
*/
|
|
14
|
+
var request = function (options) {
|
|
15
|
+
if (options === void 0) { options = {}; }
|
|
16
|
+
var callback = options.callback;
|
|
17
|
+
if (["IOS_APP"].includes(utills_1.platform)) {
|
|
18
|
+
(0, utills_1.registerCb)(function (response) {
|
|
19
|
+
var type = response.type;
|
|
20
|
+
if (type === "requestTrackingConsent") {
|
|
21
|
+
callback && callback(response);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
25
|
+
utills_1.webToNativeIos.postMessage({
|
|
26
|
+
action: "requestTrackingAuthorization",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.request = request;
|
|
32
|
+
/**
|
|
33
|
+
* This function gets the current ATT consent status
|
|
34
|
+
* @param options - Options for ATT consent status
|
|
35
|
+
*/
|
|
36
|
+
var status = function (options) {
|
|
37
|
+
if (options === void 0) { options = {}; }
|
|
38
|
+
var callback = options.callback;
|
|
39
|
+
if (["IOS_APP"].includes(utills_1.platform)) {
|
|
40
|
+
(0, utills_1.registerCb)(function (response) {
|
|
41
|
+
var type = response.type;
|
|
42
|
+
if (type === "trackingConsentStatus") {
|
|
43
|
+
callback && callback(response);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
47
|
+
utills_1.webToNativeIos.postMessage({
|
|
48
|
+
action: "trackingConsentStatus",
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.status = status;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ATTConsentResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
status?: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface ATTConsentCallback {
|
|
7
|
+
(response: ATTConsentResponse): void;
|
|
8
|
+
}
|
|
9
|
+
export interface ATTConsentOptions {
|
|
10
|
+
callback?: ATTConsentCallback;
|
|
11
|
+
}
|
|
12
|
+
export interface ATTConsentIosMessage {
|
|
13
|
+
action: string;
|
|
14
|
+
}
|
package/AdMob/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BannerAdOptions, FullScreenAdOptions, RewardsAdOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* This function shows banner ad
|
|
4
|
+
* @param options - Banner ad options
|
|
5
|
+
* @example wtn.bannerAd({
|
|
6
|
+
* adId: "ca-app-pub-xxx"
|
|
7
|
+
* });
|
|
8
|
+
*/
|
|
9
|
+
declare const bannerAd: (options?: BannerAdOptions) => any;
|
|
10
|
+
/**
|
|
11
|
+
* This function shows full screen ad
|
|
12
|
+
* @param options - Full screen ad options
|
|
13
|
+
* @example wtn.fullScreenAd({
|
|
14
|
+
* fullScreenAdCallback:(value)=>{
|
|
15
|
+
* console.log(value);
|
|
16
|
+
* }
|
|
17
|
+
* });
|
|
18
|
+
*/
|
|
19
|
+
declare const fullScreenAd: (options?: FullScreenAdOptions) => any;
|
|
20
|
+
/**
|
|
21
|
+
* This function shows rewards ad
|
|
22
|
+
* @param options - Rewards ad options
|
|
23
|
+
* @example wtn.rewardsAd({
|
|
24
|
+
* rewardsAdCallback:(value)=>{
|
|
25
|
+
* console.log(value);
|
|
26
|
+
* }
|
|
27
|
+
* });
|
|
28
|
+
*/
|
|
29
|
+
declare const rewardsAd: (options?: RewardsAdOptions) => any;
|
|
30
|
+
export { bannerAd, fullScreenAd, rewardsAd };
|
package/AdMob/index.js
CHANGED
|
@@ -1 +1,101 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var _this = this;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.rewardsAd = exports.fullScreenAd = exports.bannerAd = void 0;
|
|
5
|
+
var utills_1 = require("../utills");
|
|
6
|
+
var adMobCb = null;
|
|
7
|
+
/**
|
|
8
|
+
* This function shows banner ad
|
|
9
|
+
* @param options - Banner ad options
|
|
10
|
+
* @example wtn.bannerAd({
|
|
11
|
+
* adId: "ca-app-pub-xxx"
|
|
12
|
+
* });
|
|
13
|
+
*/
|
|
14
|
+
var bannerAd = function (options) {
|
|
15
|
+
if (options === void 0) { options = {}; }
|
|
16
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
17
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
18
|
+
utills_1.webToNativeIos.postMessage({
|
|
19
|
+
action: "showBannerAd",
|
|
20
|
+
adId: options.adId || "",
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.showBannerAd(JSON.stringify(options));
|
|
24
|
+
return _this;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.bannerAd = bannerAd;
|
|
28
|
+
/**
|
|
29
|
+
* This function shows full screen ad
|
|
30
|
+
* @param options - Full screen ad options
|
|
31
|
+
* @example wtn.fullScreenAd({
|
|
32
|
+
* fullScreenAdCallback:(value)=>{
|
|
33
|
+
* console.log(value);
|
|
34
|
+
* }
|
|
35
|
+
* });
|
|
36
|
+
*/
|
|
37
|
+
var fullScreenAd = function (options) {
|
|
38
|
+
if (options === void 0) { options = {}; }
|
|
39
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
40
|
+
var fullScreenAdCallback = options.fullScreenAdCallback;
|
|
41
|
+
(0, utills_1.registerForAbMobCb)(function (response) {
|
|
42
|
+
var status = response.status;
|
|
43
|
+
adMobCb && adMobCb(response);
|
|
44
|
+
if (status === "adDismissed") {
|
|
45
|
+
adMobCb = null;
|
|
46
|
+
}
|
|
47
|
+
if (["adDismissed", "adLoadError", "adError"].indexOf(status) > -1) {
|
|
48
|
+
(0, utills_1.deRegisterForAbMobCb)();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
52
|
+
utills_1.webToNativeIos.postMessage({
|
|
53
|
+
action: "showFullScreenAd",
|
|
54
|
+
adId: options.adId || "",
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.showFullScreenAd(JSON.stringify(options));
|
|
58
|
+
if (typeof fullScreenAdCallback === "function") {
|
|
59
|
+
adMobCb = fullScreenAdCallback;
|
|
60
|
+
}
|
|
61
|
+
return _this;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
exports.fullScreenAd = fullScreenAd;
|
|
65
|
+
/**
|
|
66
|
+
* This function shows rewards ad
|
|
67
|
+
* @param options - Rewards ad options
|
|
68
|
+
* @example wtn.rewardsAd({
|
|
69
|
+
* rewardsAdCallback:(value)=>{
|
|
70
|
+
* console.log(value);
|
|
71
|
+
* }
|
|
72
|
+
* });
|
|
73
|
+
*/
|
|
74
|
+
var rewardsAd = function (options) {
|
|
75
|
+
if (options === void 0) { options = {}; }
|
|
76
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
77
|
+
var rewardsAdCallback = options.rewardsAdCallback;
|
|
78
|
+
(0, utills_1.registerForAbMobCb)(function (response) {
|
|
79
|
+
var status = response.status;
|
|
80
|
+
adMobCb && adMobCb(response);
|
|
81
|
+
if (status === "adDismissed") {
|
|
82
|
+
adMobCb = null;
|
|
83
|
+
}
|
|
84
|
+
if (["adDismissed", "adLoadError", "adError"].indexOf(status) > -1) {
|
|
85
|
+
(0, utills_1.deRegisterForAbMobCb)();
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
89
|
+
utills_1.webToNativeIos.postMessage({
|
|
90
|
+
action: "showRewardAd",
|
|
91
|
+
adId: options.adId || "",
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.showRewardsAd(JSON.stringify(options));
|
|
95
|
+
if (typeof rewardsAdCallback === "function") {
|
|
96
|
+
adMobCb = rewardsAdCallback;
|
|
97
|
+
}
|
|
98
|
+
return _this;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
exports.rewardsAd = rewardsAd;
|
package/AdMob/types.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface AdMobResponse {
|
|
2
|
+
status: 'adDismissed' | 'adLoadError' | 'adError' | string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export type AdMobCallback = (response: AdMobResponse) => void;
|
|
6
|
+
export interface BannerAdOptions {
|
|
7
|
+
adId?: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export interface FullScreenAdOptions {
|
|
11
|
+
adId?: string;
|
|
12
|
+
fullScreenAdCallback?: AdMobCallback;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface RewardsAdOptions {
|
|
16
|
+
adId?: string;
|
|
17
|
+
rewardsAdCallback?: AdMobCallback;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
export interface AdMobIosMessage {
|
|
21
|
+
action: string;
|
|
22
|
+
adId?: string;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
package/AdMob/types.js
ADDED
package/AppReview/index.js
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prompt = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Shows the app review/rating prompt
|
|
7
|
+
* @param options - Options for app review prompt
|
|
8
|
+
*/
|
|
9
|
+
var prompt = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
12
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
13
|
+
utills_1.webToNativeIos.postMessage({
|
|
14
|
+
action: "showAppRating",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
18
|
+
utills_1.webToNative.showInAppReview();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.prompt = prompt;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AppsFlyerEventValues } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Sets the AppsFlyer customer user ID
|
|
4
|
+
* @param userId - The user ID to set
|
|
5
|
+
* @example wtn.appsflyer.setCustomerUserId("1234");
|
|
6
|
+
*/
|
|
7
|
+
export declare const setCustomerUserId: (userId: string) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Logs an event to AppsFlyer
|
|
10
|
+
* @param eventName - The name of the event
|
|
11
|
+
* @param eventValues - The values associated with the event
|
|
12
|
+
* @example wtn.appsflyer.logEvent("ADD_TO_CART",{name:"Cadburry",quantity:1});
|
|
13
|
+
*/
|
|
14
|
+
export declare const logEvent: (eventName: string, eventValues: AppsFlyerEventValues) => void;
|
package/AppsFlyer/index.js
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logEvent = exports.setCustomerUserId = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Sets the AppsFlyer customer user ID
|
|
7
|
+
* @param userId - The user ID to set
|
|
8
|
+
* @example wtn.appsflyer.setCustomerUserId("1234");
|
|
9
|
+
*/
|
|
10
|
+
var setCustomerUserId = function (userId) {
|
|
11
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
12
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
13
|
+
utills_1.webToNative.setAppsFlyerUserId(userId);
|
|
14
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
15
|
+
utills_1.webToNativeIos.postMessage({
|
|
16
|
+
action: "setAppsFlyerUserId",
|
|
17
|
+
userId: userId
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.setCustomerUserId = setCustomerUserId;
|
|
23
|
+
/**
|
|
24
|
+
* Logs an event to AppsFlyer
|
|
25
|
+
* @param eventName - The name of the event
|
|
26
|
+
* @param eventValues - The values associated with the event
|
|
27
|
+
* @example wtn.appsflyer.logEvent("ADD_TO_CART",{name:"Cadburry",quantity:1});
|
|
28
|
+
*/
|
|
29
|
+
var logEvent = function (eventName, eventValues) {
|
|
30
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
31
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
32
|
+
utills_1.webToNative.addEventToAppsFlyer(eventName, JSON.stringify(eventValues));
|
|
33
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
34
|
+
utills_1.webToNativeIos.postMessage({
|
|
35
|
+
action: "addEventToAppsFlyer",
|
|
36
|
+
eventName: eventName,
|
|
37
|
+
eventValues: eventValues
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.logEvent = logEvent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BackgroundLocationOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Starts tracking background location
|
|
4
|
+
* @param options - Background location tracking options
|
|
5
|
+
*/
|
|
6
|
+
export declare const start: (options?: BackgroundLocationOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Stops tracking background location
|
|
9
|
+
* @param options - Options for stopping location tracking
|
|
10
|
+
*/
|
|
11
|
+
export declare const stop: (options?: Record<string, any>) => void;
|
|
@@ -1,4 +1,64 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stop = exports.start = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Starts tracking background location
|
|
7
|
+
* @param options - Background location tracking options
|
|
8
|
+
*/
|
|
9
|
+
var start = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
12
|
+
var data = options.data, callback_1 = options.callback, _a = options.backgroundIndicator, backgroundIndicator = _a === void 0 ? false : _a, _b = options.pauseAutomatically, pauseAutomatically = _b === void 0 ? true : _b, _c = options.distanceFilter, distanceFilter = _c === void 0 ? 0.0 : _c, _d = options.desiredAccuracy, desiredAccuracy = _d === void 0 ? "best" : _d, _e = options.activityType, activityType = _e === void 0 ? "other" : _e, apiUrl = options.apiUrl, timeout = options.timeout;
|
|
13
|
+
(0, utills_1.registerCb)(function (response) {
|
|
14
|
+
var type = response.type;
|
|
15
|
+
if (type === "LOCATION_UPDATE") {
|
|
16
|
+
callback_1 && callback_1(response);
|
|
17
|
+
}
|
|
18
|
+
}, {
|
|
19
|
+
key: "LOCATION_UPDATE",
|
|
20
|
+
ignoreDelete: true,
|
|
21
|
+
});
|
|
22
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
23
|
+
utills_1.webToNativeIos.postMessage({
|
|
24
|
+
action: "startLocation",
|
|
25
|
+
data: data,
|
|
26
|
+
backgroundIndicator: backgroundIndicator,
|
|
27
|
+
pauseAutomatically: pauseAutomatically,
|
|
28
|
+
distanceFilter: distanceFilter,
|
|
29
|
+
desiredAccuracy: desiredAccuracy,
|
|
30
|
+
activityType: activityType,
|
|
31
|
+
apiUrl: apiUrl,
|
|
32
|
+
timeout: timeout,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
36
|
+
utills_1.webToNative.startTrackingLocation(JSON.stringify({
|
|
37
|
+
action: "startLocation",
|
|
38
|
+
data: data,
|
|
39
|
+
interval: timeout,
|
|
40
|
+
callback: callback_1,
|
|
41
|
+
apiUrl: apiUrl,
|
|
42
|
+
displacement: distanceFilter
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.start = start;
|
|
47
|
+
/**
|
|
48
|
+
* Stops tracking background location
|
|
49
|
+
* @param options - Options for stopping location tracking
|
|
50
|
+
*/
|
|
51
|
+
var stop = function (options) {
|
|
52
|
+
if (options === void 0) { options = {}; }
|
|
53
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
54
|
+
(0, utills_1.deRegisterCbByKey)("LOCATION_UPDATE");
|
|
55
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
56
|
+
utills_1.webToNativeIos.postMessage({
|
|
57
|
+
action: "stopLocation",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
61
|
+
utills_1.webToNative.stopTrackingLocation();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
exports.stop = stop;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface LocationUpdateResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
latitude?: number;
|
|
4
|
+
longitude?: number;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface LocationCallback {
|
|
8
|
+
(response: LocationUpdateResponse): void;
|
|
9
|
+
}
|
|
10
|
+
export interface BackgroundLocationOptions {
|
|
11
|
+
data?: any;
|
|
12
|
+
callback?: LocationCallback;
|
|
13
|
+
backgroundIndicator?: boolean;
|
|
14
|
+
pauseAutomatically?: boolean;
|
|
15
|
+
distanceFilter?: number;
|
|
16
|
+
desiredAccuracy?: 'best' | 'bestForNavigation' | 'nearestTenMeters' | 'hundredMeters' | 'kilometer' | 'threeKilometers';
|
|
17
|
+
activityType?: 'other' | 'automotiveNavigation' | 'fitness' | 'otherNavigation';
|
|
18
|
+
apiUrl?: string;
|
|
19
|
+
timeout?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface BackgroundLocationIosMessage {
|
|
22
|
+
action: string;
|
|
23
|
+
data?: any;
|
|
24
|
+
backgroundIndicator?: boolean;
|
|
25
|
+
pauseAutomatically?: boolean;
|
|
26
|
+
distanceFilter?: number;
|
|
27
|
+
desiredAccuracy?: string;
|
|
28
|
+
activityType?: string;
|
|
29
|
+
apiUrl?: string;
|
|
30
|
+
timeout?: number;
|
|
31
|
+
}
|
package/Beacon/index.js
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initBeaconData = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Initializes beacon data
|
|
7
|
+
* @param options - Options for initializing beacon data
|
|
8
|
+
*/
|
|
9
|
+
var initBeaconData = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
var callback = options.callback, beaconData = options.beaconData;
|
|
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 === "initBeaconData") {
|
|
16
|
+
callback && callback(response);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
20
|
+
utills_1.webToNative.initBeaconData(JSON.stringify(beaconData));
|
|
21
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
22
|
+
utills_1.webToNativeIos.postMessage({
|
|
23
|
+
action: "initBeaconData",
|
|
24
|
+
data: beaconData
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.initBeaconData = initBeaconData;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface BeaconResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface BeaconCallback {
|
|
6
|
+
(response: BeaconResponse): void;
|
|
7
|
+
}
|
|
8
|
+
export interface BeaconData {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export interface BeaconOptions {
|
|
12
|
+
callback?: BeaconCallback;
|
|
13
|
+
beaconData?: BeaconData;
|
|
14
|
+
}
|
|
15
|
+
export interface BeaconIosMessage {
|
|
16
|
+
action: string;
|
|
17
|
+
data?: BeaconData;
|
|
18
|
+
}
|
package/Beacon/types.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BiometricOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Checks the status of biometric authentication
|
|
4
|
+
* @param options - Options for checking biometric status
|
|
5
|
+
*/
|
|
6
|
+
export declare const checkStatus: (options?: BiometricOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Saves a secret using biometric authentication
|
|
9
|
+
* @param options - Options for saving biometric secret
|
|
10
|
+
*/
|
|
11
|
+
export declare const saveSecret: (options?: BiometricOptions) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Deletes a saved biometric secret
|
|
14
|
+
* @param options - Options for deleting biometric secret
|
|
15
|
+
*/
|
|
16
|
+
export declare const deleteSecret: (options?: BiometricOptions) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Shows biometric authentication prompt
|
|
19
|
+
* @param options - Options for showing biometric prompt
|
|
20
|
+
*/
|
|
21
|
+
export declare const show: (options?: BiometricOptions) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Shows biometric authentication with dismiss on cancel (Android only)
|
|
24
|
+
* @param options - Options for biometric authentication with dismiss on cancel
|
|
25
|
+
*/
|
|
26
|
+
export declare const biometricAuthWithDismissOnCancel: (options?: BiometricOptions) => void;
|