webtonative 1.0.77 → 1.0.78-beta.2

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.
Files changed (144) hide show
  1. package/ATTConsent/index.d.ts +16 -0
  2. package/ATTConsent/index.js +53 -1
  3. package/ATTConsent/types.d.ts +14 -0
  4. package/ATTConsent/types.js +2 -0
  5. package/AdMob/index.d.ts +30 -0
  6. package/AdMob/index.js +101 -1
  7. package/AdMob/types.d.ts +24 -0
  8. package/AdMob/types.js +3 -0
  9. package/AppReview/index.d.ts +6 -0
  10. package/AppReview/index.js +21 -1
  11. package/AppReview/types.d.ts +7 -0
  12. package/AppReview/types.js +3 -0
  13. package/AppsFlyer/index.d.ts +14 -0
  14. package/AppsFlyer/index.js +42 -4
  15. package/AppsFlyer/types.d.ts +9 -0
  16. package/AppsFlyer/types.js +2 -0
  17. package/BackgroundLocation/index.d.ts +11 -0
  18. package/BackgroundLocation/index.js +64 -4
  19. package/BackgroundLocation/types.d.ts +31 -0
  20. package/BackgroundLocation/types.js +2 -0
  21. package/Beacon/index.d.ts +6 -0
  22. package/Beacon/index.js +29 -1
  23. package/Beacon/types.d.ts +18 -0
  24. package/Beacon/types.js +2 -0
  25. package/Biometric/index.d.ts +26 -0
  26. package/Biometric/index.js +124 -1
  27. package/Biometric/types.d.ts +23 -0
  28. package/Biometric/types.js +2 -0
  29. package/Bluetooth/index.d.ts +16 -0
  30. package/Bluetooth/index.js +66 -1
  31. package/Bluetooth/types.d.ts +33 -0
  32. package/Bluetooth/types.js +2 -0
  33. package/BottomNavigation/index.d.ts +10 -0
  34. package/BottomNavigation/index.js +40 -4
  35. package/BottomNavigation/types.d.ts +8 -0
  36. package/BottomNavigation/types.js +2 -0
  37. package/Clipboard/index.d.ts +11 -0
  38. package/Clipboard/index.js +44 -4
  39. package/Clipboard/types.d.ts +19 -0
  40. package/Clipboard/types.js +3 -0
  41. package/Facebook/events.d.ts +12 -0
  42. package/Facebook/events.js +43 -4
  43. package/Facebook/index.d.ts +2 -0
  44. package/Facebook/index.js +28 -1
  45. package/Facebook/types.d.ts +21 -0
  46. package/Facebook/types.js +2 -0
  47. package/Firebase/Analytics/index.d.ts +31 -0
  48. package/Firebase/Analytics/index.js +109 -4
  49. package/Firebase/Messaging/index.d.ts +16 -0
  50. package/Firebase/Messaging/index.js +63 -4
  51. package/Firebase/index.d.ts +3 -0
  52. package/Firebase/index.js +30 -1
  53. package/Firebase/types.d.ts +57 -0
  54. package/Firebase/types.js +3 -0
  55. package/FirebaseAnalytics/index.d.ts +2 -0
  56. package/FirebaseAnalytics/index.js +28 -1
  57. package/Haptics/index.d.ts +6 -0
  58. package/Haptics/index.js +20 -1
  59. package/Haptics/types.d.ts +7 -0
  60. package/Haptics/types.js +2 -0
  61. package/InAppPurchase/index.d.ts +22 -0
  62. package/InAppPurchase/index.js +80 -1
  63. package/InAppPurchase/types.d.ts +33 -0
  64. package/InAppPurchase/types.js +2 -0
  65. package/InAppUpdate/index.d.ts +11 -0
  66. package/InAppUpdate/index.js +38 -1
  67. package/InAppUpdate/types.d.ts +14 -0
  68. package/InAppUpdate/types.js +2 -0
  69. package/MediaPlayer/index.d.ts +16 -0
  70. package/MediaPlayer/index.js +55 -7
  71. package/MediaPlayer/types.d.ts +13 -0
  72. package/MediaPlayer/types.js +2 -0
  73. package/NativeContacts/index.d.ts +11 -0
  74. package/NativeContacts/index.js +50 -6
  75. package/NativeContacts/types.d.ts +13 -0
  76. package/NativeContacts/types.js +2 -0
  77. package/NativeDatastore/index.d.ts +7 -0
  78. package/NativeDatastore/index.js +134 -1
  79. package/NativeDatastore/type.d.ts +23 -0
  80. package/NativeDatastore/type.js +2 -0
  81. package/Notification/index.d.ts +8 -0
  82. package/Notification/index.js +39 -1
  83. package/Notification/types.d.ts +13 -0
  84. package/Notification/types.js +2 -0
  85. package/OneSignal/index.d.ts +17 -0
  86. package/OneSignal/index.js +264 -1
  87. package/OneSignal/types.d.ts +40 -0
  88. package/OneSignal/types.js +3 -0
  89. package/OrufyConnect/index.d.ts +22 -0
  90. package/OrufyConnect/index.js +199 -0
  91. package/Printing/index.d.ts +6 -0
  92. package/Printing/index.js +19 -1
  93. package/Printing/types.d.ts +8 -0
  94. package/Printing/types.js +2 -0
  95. package/README.md +31 -2
  96. package/RevenueCat/index.d.ts +7 -0
  97. package/RevenueCat/index.js +136 -0
  98. package/Screen/index.d.ts +8 -0
  99. package/Screen/index.js +34 -4
  100. package/Screen/types.d.ts +5 -0
  101. package/Screen/types.js +3 -0
  102. package/Siri/index.d.ts +6 -0
  103. package/Siri/index.js +25 -1
  104. package/Siri/types.d.ts +13 -0
  105. package/Siri/types.js +2 -0
  106. package/SocialLogin/apple/index.d.ts +11 -0
  107. package/SocialLogin/apple/index.js +31 -0
  108. package/SocialLogin/facebook/index.d.ts +21 -0
  109. package/SocialLogin/facebook/index.js +60 -0
  110. package/SocialLogin/google/index.d.ts +21 -0
  111. package/SocialLogin/google/index.js +60 -0
  112. package/SocialLogin/index.d.ts +16 -0
  113. package/SocialLogin/index.js +22 -1
  114. package/SocialLogin/types.d.ts +38 -0
  115. package/SocialLogin/types.js +2 -0
  116. package/Stripe/index.d.ts +2 -0
  117. package/Stripe/index.js +48 -1
  118. package/Stripe/types.d.ts +31 -0
  119. package/Stripe/types.js +2 -0
  120. package/VoiceSearch/index.d.ts +12 -0
  121. package/VoiceSearch/index.js +33 -1
  122. package/VoiceSearch/types.d.ts +9 -0
  123. package/VoiceSearch/types.js +2 -0
  124. package/barcode/barcode-scan.d.ts +15 -0
  125. package/barcode/barcode-scan.js +39 -1
  126. package/barcode/barcode-types.d.ts +17 -0
  127. package/barcode/barcode-types.js +2 -0
  128. package/barcode/formats.d.ts +17 -0
  129. package/barcode/formats.js +22 -1
  130. package/barcode/index.d.ts +4 -0
  131. package/barcode/index.js +12 -1
  132. package/barcode/types.d.ts +16 -0
  133. package/barcode/types.js +21 -1
  134. package/index.d.ts +155 -0
  135. package/index.js +540 -2
  136. package/package.json +158 -3
  137. package/types/index.d.ts +49 -0
  138. package/types/index.js +3 -0
  139. package/utills.d.ts +11 -0
  140. package/utills.js +110 -1
  141. package/webtonative.min.js +1 -1
  142. package/SocialLogin/apple.js +0 -1
  143. package/SocialLogin/facebook.js +0 -9
  144. 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;
@@ -1 +1,53 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.status=exports.request=void 0;var _utills=require("../utills"),request=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"requestTrackingConsent"===c&&b&&b(a)}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"requestTrackingAuthorization"}))};exports.request=request;var status=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"trackingConsentStatus"===c&&b&&b(a)}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"trackingConsentStatus"}))};exports.status=status;
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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rewardsAd=exports.fullScreenAd=exports.bannerAd=void 0;var _utills=require("../utills"),_this=void 0,adMobCb=null,bannerAd=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_utills.platform))return"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"showBannerAd",adId:a.adId||""}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.showBannerAd(JSON.stringify(a)),_this};exports.bannerAd=bannerAd;var fullScreenAd=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.fullScreenAdCallback;return(0,_utills.registerForAbMobCb)(function(a){var b=a.status;adMobCb&&adMobCb(a),"adDismissed"===b&&(adMobCb=null),-1<["adDismissed","adLoadError","adError"].indexOf(b)&&(0,_utills.deRegisterForAbMobCb)()}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"showFullScreenAd",adId:a.adId||""}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.showFullScreenAd(JSON.stringify(a)),"function"==typeof b&&(adMobCb=b),_this}};exports.fullScreenAd=fullScreenAd;var rewardsAd=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.rewardsAdCallback;return(0,_utills.registerForAbMobCb)(function(a){var b=a.status;adMobCb&&adMobCb(a),"adDismissed"===b&&(adMobCb=null),-1<["adDismissed","adLoadError","adError"].indexOf(b)&&(0,_utills.deRegisterForAbMobCb)()}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"showRewardAd",adId:a.adId||""}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.showRewardsAd(JSON.stringify(a)),"function"==typeof b&&(adMobCb=b),_this}};exports.rewardsAd=rewardsAd;
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;
@@ -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
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // Define types for AdMob module
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { AppReviewOptions } from "./types";
2
+ /**
3
+ * Shows the app review/rating prompt
4
+ * @param options - Options for app review prompt
5
+ */
6
+ export declare const prompt: (options?: AppReviewOptions) => void;
@@ -1 +1,21 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.prompt=void 0;var _utills=require("../utills"),prompt=function(){0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&("IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"showAppRating"}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.showInAppReview())};exports.prompt=prompt;
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,7 @@
1
+ export interface AppReviewIosMessage {
2
+ action: string;
3
+ [key: string]: any;
4
+ }
5
+ export interface AppReviewOptions {
6
+ [key: string]: any;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // Define types for AppReview module
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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;
@@ -1,4 +1,42 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setCustomerUserId=exports.logEvent=void 0;var _utills=require("../utills"),setCustomerUserId=function(a){["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&("ANDROID_APP"===_utills.platform&&_utills.webToNative.setAppsFlyerUserId(a),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setAppsFlyerUserId",userId:a}))};exports.setCustomerUserId=setCustomerUserId;/**
2
- *
3
- * @example wtn.appsflyer.setCustomerUserId("ADD_TO_CART",{name:"Cadburry",quantity:1});
4
- */var logEvent=function(a,b){["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&("ANDROID_APP"===_utills.platform&&_utills.webToNative.addEventToAppsFlyer(a,JSON.stringify(b)),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"addEventToAppsFlyer",eventName:a,eventValues:b}))};exports.logEvent=logEvent;
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,9 @@
1
+ export interface AppsFlyerEventValues {
2
+ [key: string]: any;
3
+ }
4
+ export interface AppsFlyerIosMessage {
5
+ action: string;
6
+ userId?: string;
7
+ eventName?: string;
8
+ eventValues?: AppsFlyerEventValues;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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";Object.defineProperty(exports,"__esModule",{value:!0}),exports.stop=exports.start=void 0;var _utills=require("../utills"),start=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.data,c=a.callback,d=a.backgroundIndicator,e=a.pauseAutomatically,f=a.distanceFilter,g=void 0===f?0:f,h=a.desiredAccuracy,i=void 0===h?"best":h,j=a.activityType,k=void 0===j?"other":j,l=a.apiUrl,m=a.timeout;(0,_utills.registerCb)(function(a){var b=a.type;"LOCATION_UPDATE"===b&&c&&c(a)},{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"startLocation",data:b,backgroundIndicator:void 0!==d&&d,pauseAutomatically:!(void 0!==e)||e,distanceFilter:g,desiredAccuracy:i,activityType:k,apiUrl:l,timeout:m}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.startTrackingLocation(JSON.stringify({action:"startLocation",data:b,interval:m,callback:c,apiUrl:l,displacement:g}))}};exports.start=start;/**
2
- *
3
- *
4
- */var stop=function(){0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.deRegisterCbByKey)("LOCATION_UPDATE"),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"stopLocation"}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.stopTrackingLocation())};exports.stop=stop;
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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { BeaconOptions } from "./types";
2
+ /**
3
+ * Initializes beacon data
4
+ * @param options - Options for initializing beacon data
5
+ */
6
+ export declare const initBeaconData: (options?: BeaconOptions) => void;
package/Beacon/index.js CHANGED
@@ -1 +1,29 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initBeaconData=void 0;var _utills=require("../utills"),initBeaconData=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback,c=a.beaconData;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"initBeaconData"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.initBeaconData(JSON.stringify(c)),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"initBeaconData",data:c}))};exports.initBeaconData=initBeaconData;
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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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;