webtonative 1.0.76 → 1.0.78-beta.1

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 (142) 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 -5
  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/Printing/index.d.ts +6 -0
  90. package/Printing/index.js +19 -1
  91. package/Printing/types.d.ts +8 -0
  92. package/Printing/types.js +2 -0
  93. package/README.md +31 -2
  94. package/RevenueCat/index.d.ts +7 -0
  95. package/RevenueCat/index.js +136 -0
  96. package/Screen/index.d.ts +8 -0
  97. package/Screen/index.js +34 -4
  98. package/Screen/types.d.ts +5 -0
  99. package/Screen/types.js +3 -0
  100. package/Siri/index.d.ts +6 -0
  101. package/Siri/index.js +25 -1
  102. package/Siri/types.d.ts +13 -0
  103. package/Siri/types.js +2 -0
  104. package/SocialLogin/apple/index.d.ts +11 -0
  105. package/SocialLogin/apple/index.js +31 -0
  106. package/SocialLogin/facebook/index.d.ts +21 -0
  107. package/SocialLogin/facebook/index.js +60 -0
  108. package/SocialLogin/google/index.d.ts +21 -0
  109. package/SocialLogin/google/index.js +60 -0
  110. package/SocialLogin/index.d.ts +16 -0
  111. package/SocialLogin/index.js +22 -1
  112. package/SocialLogin/types.d.ts +38 -0
  113. package/SocialLogin/types.js +2 -0
  114. package/Stripe/index.d.ts +2 -0
  115. package/Stripe/index.js +48 -1
  116. package/Stripe/types.d.ts +31 -0
  117. package/Stripe/types.js +2 -0
  118. package/VoiceSearch/index.d.ts +12 -0
  119. package/VoiceSearch/index.js +33 -1
  120. package/VoiceSearch/types.d.ts +9 -0
  121. package/VoiceSearch/types.js +2 -0
  122. package/barcode/barcode-scan.d.ts +15 -0
  123. package/barcode/barcode-scan.js +39 -1
  124. package/barcode/barcode-types.d.ts +17 -0
  125. package/barcode/barcode-types.js +2 -0
  126. package/barcode/formats.d.ts +17 -0
  127. package/barcode/formats.js +22 -1
  128. package/barcode/index.d.ts +4 -0
  129. package/barcode/index.js +12 -1
  130. package/barcode/types.d.ts +16 -0
  131. package/barcode/types.js +21 -1
  132. package/index.d.ts +155 -0
  133. package/index.js +540 -2
  134. package/package.json +154 -3
  135. package/types/index.d.ts +49 -0
  136. package/types/index.js +3 -0
  137. package/utills.d.ts +11 -0
  138. package/utills.js +110 -1
  139. package/webtonative.min.js +1 -1
  140. package/SocialLogin/apple.js +0 -1
  141. package/SocialLogin/facebook.js +0 -9
  142. package/SocialLogin/google.js +0 -9
@@ -1,4 +1,109 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setUserProperty=exports.setUserId=exports.setDefaultEventParameters=exports.setCollection=exports.logScreen=exports.logEvent=void 0;var _utills=require("../../utills"),setCollection=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.enabled;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseAnalyticsCollection",enabled:b}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setFirebaseAnalyticsCollection(b)}};exports.setCollection=setCollection;/**
2
- *
3
- * @example wtn.appsflyer.setCustomerUserId("ADD_TO_CART",{name:"Cadburry",quantity:1});
4
- */var setUserId=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.userId;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseUserId",userId:b}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setFirebaseUserId(b)}};exports.setUserId=setUserId;var setUserProperty=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.key,c=a.value;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseUserProp",key:b,value:c}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setFirebaseUserProp(b,c)}};exports.setUserProperty=setUserProperty;var setDefaultEventParameters=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.parameters;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseDefaultParam",parameters:b}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setFirebaseDefaultParam(b)}};exports.setDefaultEventParameters=setDefaultEventParameters;var logEvent=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.eventName,c=a.parameters;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"logFirebaseEvent",eventName:b,parameters:c}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.logFirebaseEvent(b,c)}};exports.logEvent=logEvent;var logScreen=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.screenName,c=a.screenClass;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"logFirebaseScreenView",screenName:b,screenClass:c}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.logFirebaseScreenView(b,c)}};exports.logScreen=logScreen;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logScreen = exports.logEvent = exports.setDefaultEventParameters = exports.setUserProperty = exports.setUserId = exports.setCollection = void 0;
4
+ var utills_1 = require("../../utills");
5
+ /**
6
+ * Sets Firebase Analytics collection enabled or disabled
7
+ * @param options - Options for setting analytics collection
8
+ */
9
+ var setCollection = function (options) {
10
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
11
+ var enabled = options.enabled;
12
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
13
+ utills_1.webToNativeIos.postMessage({
14
+ action: "setFirebaseAnalyticsCollection",
15
+ enabled: enabled,
16
+ });
17
+ }
18
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.setFirebaseAnalyticsCollection(enabled);
19
+ }
20
+ };
21
+ exports.setCollection = setCollection;
22
+ /**
23
+ * Sets Firebase user ID
24
+ * @param options - Options for setting user ID
25
+ */
26
+ var setUserId = function (options) {
27
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
28
+ var userId = options.userId;
29
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
30
+ utills_1.webToNativeIos.postMessage({
31
+ action: "setFirebaseUserId",
32
+ userId: userId,
33
+ });
34
+ }
35
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.setFirebaseUserId(userId);
36
+ }
37
+ };
38
+ exports.setUserId = setUserId;
39
+ /**
40
+ * Sets a Firebase user property
41
+ * @param options - Options for setting user property
42
+ */
43
+ var setUserProperty = function (options) {
44
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
45
+ var key = options.key, value = options.value;
46
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
47
+ utills_1.webToNativeIos.postMessage({
48
+ action: "setFirebaseUserProp",
49
+ key: key,
50
+ value: value,
51
+ });
52
+ }
53
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.setFirebaseUserProp(key, value);
54
+ }
55
+ };
56
+ exports.setUserProperty = setUserProperty;
57
+ /**
58
+ * Sets default event parameters for Firebase Analytics
59
+ * @param options - Options for setting default parameters
60
+ */
61
+ var setDefaultEventParameters = function (options) {
62
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
63
+ var parameters = options.parameters;
64
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
65
+ utills_1.webToNativeIos.postMessage({
66
+ action: "setFirebaseDefaultParam",
67
+ parameters: parameters,
68
+ });
69
+ }
70
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.setFirebaseDefaultParam(parameters);
71
+ }
72
+ };
73
+ exports.setDefaultEventParameters = setDefaultEventParameters;
74
+ /**
75
+ * Logs a Firebase Analytics event
76
+ * @param options - Options for logging an event
77
+ */
78
+ var logEvent = function (options) {
79
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
80
+ var eventName = options.eventName, parameters = options.parameters;
81
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
82
+ utills_1.webToNativeIos.postMessage({
83
+ action: "logFirebaseEvent",
84
+ eventName: eventName,
85
+ parameters: parameters,
86
+ });
87
+ }
88
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.logFirebaseEvent(eventName, parameters);
89
+ }
90
+ };
91
+ exports.logEvent = logEvent;
92
+ /**
93
+ * Logs a Firebase Analytics screen view
94
+ * @param options - Options for logging a screen view
95
+ */
96
+ var logScreen = function (options) {
97
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
98
+ var screenName = options.screenName, screenClass = options.screenClass;
99
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
100
+ utills_1.webToNativeIos.postMessage({
101
+ action: "logFirebaseScreenView",
102
+ screenName: screenName,
103
+ screenClass: screenClass,
104
+ });
105
+ }
106
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.logFirebaseScreenView(screenName, screenClass);
107
+ }
108
+ };
109
+ exports.logScreen = logScreen;
@@ -0,0 +1,16 @@
1
+ import { FirebaseTopicSubscriptionOptions, FirebaseTopicUnsubscriptionOptions, FirebaseFCMTokenOptions } from "../types";
2
+ /**
3
+ * Subscribes to a Firebase Cloud Messaging topic
4
+ * @param options - Options for topic subscription
5
+ */
6
+ export declare const subscribe: (options: FirebaseTopicSubscriptionOptions) => void;
7
+ /**
8
+ * Unsubscribes from a Firebase Cloud Messaging topic
9
+ * @param options - Options for topic unsubscription
10
+ */
11
+ export declare const unsubscribe: (options: FirebaseTopicUnsubscriptionOptions) => void;
12
+ /**
13
+ * Gets the Firebase Cloud Messaging token
14
+ * @param options - Options for getting FCM token
15
+ */
16
+ export declare const getFCMToken: (options: FirebaseFCMTokenOptions) => void;
@@ -1,4 +1,63 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.unsubscribe=exports.subscribe=exports.getFCMToken=void 0;var _utills=require("../../utills"),subscribe=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.toTopic;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"firebaseSubscribeToTopic",topic:b}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.subscribeToTopic(b)}};exports.subscribe=subscribe;/**
2
- *
3
- *
4
- */var unsubscribe=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.fromTopic;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"firebaseUnsubscribeFromTopic",topic:b}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.unsubscribeFromTopic(b)}};exports.unsubscribe=unsubscribe;var getFCMToken=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback;(0,_utills.registerCb)(function(a){var c=a.type;"getFCMToken"===c&&("ANDROID_APP"===_utills.platform&&(a.token=a.fcm_registration_token),b&&b(a))}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"getFCMToken"}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.getRegistrationToken()}};exports.getFCMToken=getFCMToken;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFCMToken = exports.unsubscribe = exports.subscribe = void 0;
4
+ var utills_1 = require("../../utills");
5
+ /**
6
+ * Subscribes to a Firebase Cloud Messaging topic
7
+ * @param options - Options for topic subscription
8
+ */
9
+ var subscribe = function (options) {
10
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
11
+ var toTopic = options.toTopic;
12
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
13
+ utills_1.webToNativeIos.postMessage({
14
+ action: "firebaseSubscribeToTopic",
15
+ topic: toTopic,
16
+ });
17
+ }
18
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.subscribeToTopic(toTopic);
19
+ }
20
+ };
21
+ exports.subscribe = subscribe;
22
+ /**
23
+ * Unsubscribes from a Firebase Cloud Messaging topic
24
+ * @param options - Options for topic unsubscription
25
+ */
26
+ var unsubscribe = function (options) {
27
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
28
+ var fromTopic = options.fromTopic;
29
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
30
+ utills_1.webToNativeIos.postMessage({
31
+ action: "firebaseUnsubscribeFromTopic",
32
+ topic: fromTopic,
33
+ });
34
+ }
35
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.unsubscribeFromTopic(fromTopic);
36
+ }
37
+ };
38
+ exports.unsubscribe = unsubscribe;
39
+ /**
40
+ * Gets the Firebase Cloud Messaging token
41
+ * @param options - Options for getting FCM token
42
+ */
43
+ var getFCMToken = function (options) {
44
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
45
+ var callback_1 = options.callback;
46
+ (0, utills_1.registerCb)(function (response) {
47
+ var type = response.type;
48
+ if (type === "getFCMToken") {
49
+ if (utills_1.platform === "ANDROID_APP") {
50
+ response.token = response.fcm_registration_token;
51
+ }
52
+ callback_1 && callback_1(response);
53
+ }
54
+ });
55
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
56
+ utills_1.webToNativeIos.postMessage({
57
+ action: "getFCMToken",
58
+ });
59
+ }
60
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.getRegistrationToken();
61
+ }
62
+ };
63
+ exports.getFCMToken = getFCMToken;
@@ -0,0 +1,3 @@
1
+ import * as Analytics from "./Analytics";
2
+ import * as Messaging from "./Messaging";
3
+ export { Analytics, Messaging };
package/Firebase/index.js CHANGED
@@ -1 +1,30 @@
1
- "use strict";var Analytics=_interopRequireWildcard(require("./Analytics"));var Messaging=_interopRequireWildcard(require("./Messaging"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Messaging=exports.Analytics=void 0;exports.Analytics=Analytics;exports.Messaging=Messaging;function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d["default"]=a,c&&c.set(a,d),d}
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.Messaging = exports.Analytics = void 0;
27
+ var Analytics = __importStar(require("./Analytics"));
28
+ exports.Analytics = Analytics;
29
+ var Messaging = __importStar(require("./Messaging"));
30
+ exports.Messaging = Messaging;
@@ -0,0 +1,57 @@
1
+ export interface FirebaseAnalyticsCollectionOptions {
2
+ enabled: boolean;
3
+ }
4
+ export interface FirebaseUserIdOptions {
5
+ userId: string;
6
+ }
7
+ export interface FirebaseUserPropertyOptions {
8
+ key: string;
9
+ value: string;
10
+ }
11
+ export interface FirebaseEventParameters {
12
+ [key: string]: any;
13
+ }
14
+ export interface FirebaseDefaultParametersOptions {
15
+ parameters: FirebaseEventParameters;
16
+ }
17
+ export interface FirebaseEventOptions {
18
+ eventName: string;
19
+ parameters?: FirebaseEventParameters;
20
+ }
21
+ export interface FirebaseScreenOptions {
22
+ screenName: string;
23
+ screenClass?: string;
24
+ }
25
+ export interface FirebaseAnalyticsIosMessage {
26
+ action: string;
27
+ enabled?: boolean;
28
+ userId?: string;
29
+ key?: string;
30
+ value?: string;
31
+ parameters?: FirebaseEventParameters;
32
+ eventName?: string;
33
+ screenName?: string;
34
+ screenClass?: string;
35
+ }
36
+ export interface FirebaseTopicSubscriptionOptions {
37
+ toTopic: string;
38
+ }
39
+ export interface FirebaseTopicUnsubscriptionOptions {
40
+ fromTopic: string;
41
+ }
42
+ export interface FirebaseFCMTokenResponse {
43
+ type: string;
44
+ token?: string;
45
+ fcm_registration_token?: string;
46
+ [key: string]: any;
47
+ }
48
+ export interface FirebaseFCMTokenCallback {
49
+ (response: FirebaseFCMTokenResponse): void;
50
+ }
51
+ export interface FirebaseFCMTokenOptions {
52
+ callback?: FirebaseFCMTokenCallback;
53
+ }
54
+ export interface FirebaseMessagingIosMessage {
55
+ action: string;
56
+ topic?: string;
57
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // Common Firebase types
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import * as FirebaseAnalyticsEvents from "../Firebase/Analytics";
2
+ export { FirebaseAnalyticsEvents as events };
@@ -1 +1,28 @@
1
- "use strict";var FirebaseAnalyticsEvents=_interopRequireWildcard(require("../Firebase/Analytics"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.events=void 0;exports.events=FirebaseAnalyticsEvents;function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d["default"]=a,c&&c.set(a,d),d}
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 FirebaseAnalyticsEvents = __importStar(require("../Firebase/Analytics"));
28
+ exports.events = FirebaseAnalyticsEvents;
@@ -0,0 +1,6 @@
1
+ import { HapticsOptions } from "./types";
2
+ /**
3
+ * Triggers a haptic feedback effect
4
+ * @param options - Options for the haptic effect
5
+ */
6
+ export declare const trigger: (options?: HapticsOptions) => void;
package/Haptics/index.js CHANGED
@@ -1 +1,20 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.trigger=void 0;var _utills=require("../utills"),trigger=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"haptikEffect",effect:a.effect})};exports.trigger=trigger;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.trigger = void 0;
4
+ var utills_1 = require("../utills");
5
+ /**
6
+ * Triggers a haptic feedback effect
7
+ * @param options - Options for the haptic effect
8
+ */
9
+ var trigger = 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: "haptikEffect",
15
+ effect: options.effect,
16
+ });
17
+ }
18
+ }
19
+ };
20
+ exports.trigger = trigger;
@@ -0,0 +1,7 @@
1
+ export interface HapticsOptions {
2
+ effect?: string;
3
+ }
4
+ export interface HapticsIosMessage {
5
+ action: string;
6
+ effect?: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { InAppPurchaseOptions, GetAllPurchasesOptions, GetReceiptDataOptions } from "./types";
2
+ /**
3
+ * This function handles native in app purchase
4
+ * @param options - Options for in-app purchase
5
+ * @example wtn.inAppPurchase({
6
+ * productId : 'productId'
7
+ * callback:(data)=>{
8
+ * console.log(data);
9
+ * }
10
+ * });
11
+ */
12
+ export declare const inAppPurchase: (options: InAppPurchaseOptions) => void;
13
+ /**
14
+ * Gets all purchases (Android only)
15
+ * @param options - Options for getting all purchases
16
+ */
17
+ export declare const getAllPurchases: (options: GetAllPurchasesOptions) => void;
18
+ /**
19
+ * Gets receipt data (iOS only)
20
+ * @param options - Options for getting receipt data
21
+ */
22
+ export declare const getReceiptData: (options: GetReceiptDataOptions) => void;
@@ -1 +1,80 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.inAppPurchase=exports.getReceiptData=exports.getAllPurchases=void 0;var _utills=require("../utills"),inAppPurchase=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.productId,d=a.productType,e=a.isConsumable;(0,_utills.registerCb)(function(a){var c=a.type;"inAppPurchase"===c&&b&&b(a)}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"inAppPurchase",productId:c}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:c,productType:d,isConsumable:void 0!==e&&e}))}};exports.inAppPurchase=inAppPurchase;var getAllPurchases=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.callback;(0,_utills.registerCb)(function(a){var c=a.type;"purchaseList"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.getAllPurchases({action:"purchaseList"})}};exports.getAllPurchases=getAllPurchases;var getReceiptData=function(a){if(["IOS_APP"].includes(_utills.platform)){var b=a.callback;(0,_utills.registerCb)(function(a){var c=a.type;"getReceiptData"===c&&b&&b(a)}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"getReceiptData"})}};exports.getReceiptData=getReceiptData;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getReceiptData = exports.getAllPurchases = exports.inAppPurchase = void 0;
4
+ var utills_1 = require("../utills");
5
+ /**
6
+ * This function handles native in app purchase
7
+ * @param options - Options for in-app purchase
8
+ * @example wtn.inAppPurchase({
9
+ * productId : 'productId'
10
+ * callback:(data)=>{
11
+ * console.log(data);
12
+ * }
13
+ * });
14
+ */
15
+ var inAppPurchase = function (options) {
16
+ if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
17
+ var callback_1 = options.callback, productId = options.productId, productType = options.productType, _a = options.isConsumable, isConsumable = _a === void 0 ? false : _a;
18
+ (0, utills_1.registerCb)(function (response) {
19
+ var type = response.type;
20
+ if (type === "inAppPurchase") {
21
+ callback_1 && callback_1(response);
22
+ }
23
+ });
24
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
25
+ utills_1.webToNativeIos.postMessage({
26
+ action: "inAppPurchase",
27
+ productId: productId,
28
+ });
29
+ }
30
+ utills_1.platform === "ANDROID_APP" &&
31
+ utills_1.webToNative.inAppPurchase(JSON.stringify({
32
+ action: "inAppPurchase",
33
+ productId: productId,
34
+ productType: productType,
35
+ isConsumable: isConsumable
36
+ }));
37
+ }
38
+ };
39
+ exports.inAppPurchase = inAppPurchase;
40
+ /**
41
+ * Gets all purchases (Android only)
42
+ * @param options - Options for getting all purchases
43
+ */
44
+ var getAllPurchases = function (options) {
45
+ if (["ANDROID_APP"].includes(utills_1.platform)) {
46
+ var callback_2 = options.callback;
47
+ (0, utills_1.registerCb)(function (response) {
48
+ var type = response.type;
49
+ if (type === "purchaseList") {
50
+ callback_2 && callback_2(response);
51
+ }
52
+ });
53
+ utills_1.platform === "ANDROID_APP" &&
54
+ utills_1.webToNative.getAllPurchases({
55
+ action: "purchaseList"
56
+ });
57
+ }
58
+ };
59
+ exports.getAllPurchases = getAllPurchases;
60
+ /**
61
+ * Gets receipt data (iOS only)
62
+ * @param options - Options for getting receipt data
63
+ */
64
+ var getReceiptData = function (options) {
65
+ if (["IOS_APP"].includes(utills_1.platform)) {
66
+ var callback_3 = options.callback;
67
+ (0, utills_1.registerCb)(function (response) {
68
+ var type = response.type;
69
+ if (type === "getReceiptData") {
70
+ callback_3 && callback_3(response);
71
+ }
72
+ });
73
+ if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
74
+ utills_1.webToNativeIos.postMessage({
75
+ action: "getReceiptData"
76
+ });
77
+ }
78
+ }
79
+ };
80
+ exports.getReceiptData = getReceiptData;
@@ -0,0 +1,33 @@
1
+ export interface InAppPurchaseResponse {
2
+ type: string;
3
+ isSuccess?: boolean;
4
+ transactionId?: string;
5
+ status?: string;
6
+ receiptData?: any;
7
+ [key: string]: any;
8
+ }
9
+ export interface InAppPurchaseCallback {
10
+ (response: InAppPurchaseResponse): void;
11
+ }
12
+ export interface InAppPurchaseOptions {
13
+ productId: string;
14
+ callback?: InAppPurchaseCallback;
15
+ productType?: string;
16
+ isConsumable?: boolean;
17
+ }
18
+ export interface GetAllPurchasesOptions {
19
+ callback?: InAppPurchaseCallback;
20
+ }
21
+ export interface GetReceiptDataOptions {
22
+ callback?: InAppPurchaseCallback;
23
+ }
24
+ export interface InAppPurchaseIosMessage {
25
+ action: string;
26
+ productId?: string;
27
+ }
28
+ export interface InAppPurchaseAndroidParams {
29
+ action: string;
30
+ productId?: string;
31
+ productType?: string;
32
+ isConsumable?: boolean;
33
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { CheckUpdateOptions, UpdateApplicationOptions } from "./types";
2
+ /**
3
+ * Checks if an app update is available (Android only)
4
+ * @param options - Options for checking app update
5
+ */
6
+ export declare const checkIfAppUpdateAvailable: (options: CheckUpdateOptions) => void;
7
+ /**
8
+ * Updates the application (Android only)
9
+ * @param options - Options for updating the application
10
+ */
11
+ export declare const updateApplication: (options: UpdateApplicationOptions) => void;
@@ -1 +1,38 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.updateApplication=exports.checkIfAppUpdateAvailable=void 0;var _utills=require("../utills"),checkIfAppUpdateAvailable=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.callback;(0,_utills.registerCb)(function(a){var c=a.type;"checkIfAppUpdateAvailable"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.checkIfAppUpdateAvailable()}};exports.checkIfAppUpdateAvailable=checkIfAppUpdateAvailable;var updateApplication=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.updateType,c=void 0===b?"immediate":b,d=a.callback;(0,_utills.registerCb)(function(a){var b=a.type;"updateApplication"===b&&d&&d(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.updateApplication(c)}};exports.updateApplication=updateApplication;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateApplication = exports.checkIfAppUpdateAvailable = void 0;
4
+ var utills_1 = require("../utills");
5
+ /**
6
+ * Checks if an app update is available (Android only)
7
+ * @param options - Options for checking app update
8
+ */
9
+ var checkIfAppUpdateAvailable = function (options) {
10
+ if (["ANDROID_APP"].includes(utills_1.platform)) {
11
+ var callback_1 = options.callback;
12
+ (0, utills_1.registerCb)(function (response) {
13
+ var type = response.type;
14
+ if (type === "checkIfAppUpdateAvailable") {
15
+ callback_1 && callback_1(response);
16
+ }
17
+ });
18
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.checkIfAppUpdateAvailable();
19
+ }
20
+ };
21
+ exports.checkIfAppUpdateAvailable = checkIfAppUpdateAvailable;
22
+ /**
23
+ * Updates the application (Android only)
24
+ * @param options - Options for updating the application
25
+ */
26
+ var updateApplication = function (options) {
27
+ if (["ANDROID_APP"].includes(utills_1.platform)) {
28
+ var _a = options.updateType, updateType = _a === void 0 ? "immediate" : _a, callback_2 = options.callback;
29
+ (0, utills_1.registerCb)(function (response) {
30
+ var type = response.type;
31
+ if (type === "updateApplication") {
32
+ callback_2 && callback_2(response);
33
+ }
34
+ });
35
+ utills_1.platform === "ANDROID_APP" && utills_1.webToNative.updateApplication(updateType);
36
+ }
37
+ };
38
+ exports.updateApplication = updateApplication;
@@ -0,0 +1,14 @@
1
+ export interface InAppUpdateResponse {
2
+ type: string;
3
+ [key: string]: any;
4
+ }
5
+ export interface InAppUpdateCallback {
6
+ (response: InAppUpdateResponse): void;
7
+ }
8
+ export interface CheckUpdateOptions {
9
+ callback?: InAppUpdateCallback;
10
+ }
11
+ export interface UpdateApplicationOptions {
12
+ updateType?: 'immediate' | 'flexible';
13
+ callback?: InAppUpdateCallback;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ import { MediaPlayerOptions } from "./types";
2
+ /**
3
+ * Plays media content
4
+ * @param options - Options for playing media
5
+ */
6
+ export declare const playMedia: (options?: MediaPlayerOptions) => void;
7
+ /**
8
+ * Pauses currently playing media
9
+ * @param options - Options for pausing media
10
+ */
11
+ export declare const pauseMedia: (options?: MediaPlayerOptions) => void;
12
+ /**
13
+ * Stops currently playing media
14
+ * @param options - Options for stopping media
15
+ */
16
+ export declare const stopMedia: (options?: MediaPlayerOptions) => void;