webtonative 1.0.75-beta.6 → 1.0.76

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 (264) hide show
  1. package/ATTConsent/index.js +1 -54
  2. package/AdMob/index.js +1 -102
  3. package/AppReview/index.js +1 -22
  4. package/AppsFlyer/index.js +4 -43
  5. package/BackgroundLocation/index.js +4 -65
  6. package/Beacon/index.js +1 -30
  7. package/Biometric/index.js +1 -125
  8. package/Bluetooth/index.js +1 -67
  9. package/BottomNavigation/index.js +4 -41
  10. package/Clipboard/index.js +4 -45
  11. package/Facebook/events.js +4 -44
  12. package/Facebook/index.js +1 -29
  13. package/Firebase/Analytics/index.js +4 -110
  14. package/Firebase/Messaging/index.js +4 -64
  15. package/Firebase/index.js +1 -31
  16. package/FirebaseAnalytics/index.js +1 -29
  17. package/Haptics/index.js +1 -21
  18. package/InAppPurchase/index.js +1 -81
  19. package/InAppUpdate/index.js +1 -39
  20. package/MediaPlayer/index.js +7 -56
  21. package/NativeContacts/index.js +6 -51
  22. package/NativeDatastore/index.js +1 -0
  23. package/Notification/index.js +5 -42
  24. package/OneSignal/index.js +1 -265
  25. package/Printing/index.js +1 -20
  26. package/README.md +2 -31
  27. package/Screen/index.js +4 -35
  28. package/Siri/index.js +1 -26
  29. package/SocialLogin/apple.js +1 -32
  30. package/SocialLogin/facebook.js +3 -55
  31. package/SocialLogin/google.js +4 -56
  32. package/SocialLogin/index.js +1 -23
  33. package/Stripe/index.js +1 -49
  34. package/VoiceSearch/index.js +1 -34
  35. package/barcode/barcode-scan.js +1 -40
  36. package/barcode/formats.js +1 -23
  37. package/barcode/index.js +1 -13
  38. package/barcode/types.js +1 -22
  39. package/index.js +2 -535
  40. package/package.json +3 -134
  41. package/utills.js +1 -111
  42. package/webtonative.min.js +1 -1
  43. package/ATTConsent/index.d.ts +0 -17
  44. package/ATTConsent/index.d.ts.map +0 -1
  45. package/ATTConsent/index.js.map +0 -1
  46. package/ATTConsent/types.d.ts +0 -15
  47. package/ATTConsent/types.d.ts.map +0 -1
  48. package/ATTConsent/types.js +0 -3
  49. package/ATTConsent/types.js.map +0 -1
  50. package/AdMob/index.d.ts +0 -31
  51. package/AdMob/index.d.ts.map +0 -1
  52. package/AdMob/index.js.map +0 -1
  53. package/AdMob/types.d.ts +0 -25
  54. package/AdMob/types.d.ts.map +0 -1
  55. package/AdMob/types.js +0 -4
  56. package/AdMob/types.js.map +0 -1
  57. package/AppReview/index.d.ts +0 -7
  58. package/AppReview/index.d.ts.map +0 -1
  59. package/AppReview/index.js.map +0 -1
  60. package/AppReview/types.d.ts +0 -8
  61. package/AppReview/types.d.ts.map +0 -1
  62. package/AppReview/types.js +0 -4
  63. package/AppReview/types.js.map +0 -1
  64. package/AppsFlyer/index.d.ts +0 -15
  65. package/AppsFlyer/index.d.ts.map +0 -1
  66. package/AppsFlyer/index.js.map +0 -1
  67. package/AppsFlyer/types.d.ts +0 -10
  68. package/AppsFlyer/types.d.ts.map +0 -1
  69. package/AppsFlyer/types.js +0 -3
  70. package/AppsFlyer/types.js.map +0 -1
  71. package/BackgroundLocation/index.d.ts +0 -12
  72. package/BackgroundLocation/index.d.ts.map +0 -1
  73. package/BackgroundLocation/index.js.map +0 -1
  74. package/BackgroundLocation/types.d.ts +0 -32
  75. package/BackgroundLocation/types.d.ts.map +0 -1
  76. package/BackgroundLocation/types.js +0 -3
  77. package/BackgroundLocation/types.js.map +0 -1
  78. package/Beacon/index.d.ts +0 -7
  79. package/Beacon/index.d.ts.map +0 -1
  80. package/Beacon/index.js.map +0 -1
  81. package/Beacon/types.d.ts +0 -19
  82. package/Beacon/types.d.ts.map +0 -1
  83. package/Beacon/types.js +0 -3
  84. package/Beacon/types.js.map +0 -1
  85. package/Biometric/index.d.ts +0 -27
  86. package/Biometric/index.d.ts.map +0 -1
  87. package/Biometric/index.js.map +0 -1
  88. package/Biometric/types.d.ts +0 -24
  89. package/Biometric/types.d.ts.map +0 -1
  90. package/Biometric/types.js +0 -3
  91. package/Biometric/types.js.map +0 -1
  92. package/Bluetooth/index.d.ts +0 -17
  93. package/Bluetooth/index.d.ts.map +0 -1
  94. package/Bluetooth/index.js.map +0 -1
  95. package/Bluetooth/types.d.ts +0 -34
  96. package/Bluetooth/types.d.ts.map +0 -1
  97. package/Bluetooth/types.js +0 -3
  98. package/Bluetooth/types.js.map +0 -1
  99. package/BottomNavigation/index.d.ts +0 -11
  100. package/BottomNavigation/index.d.ts.map +0 -1
  101. package/BottomNavigation/index.js.map +0 -1
  102. package/BottomNavigation/types.d.ts +0 -9
  103. package/BottomNavigation/types.d.ts.map +0 -1
  104. package/BottomNavigation/types.js +0 -3
  105. package/BottomNavigation/types.js.map +0 -1
  106. package/Clipboard/index.d.ts +0 -12
  107. package/Clipboard/index.d.ts.map +0 -1
  108. package/Clipboard/index.js.map +0 -1
  109. package/Clipboard/types.d.ts +0 -20
  110. package/Clipboard/types.d.ts.map +0 -1
  111. package/Clipboard/types.js +0 -4
  112. package/Clipboard/types.js.map +0 -1
  113. package/Facebook/events.d.ts +0 -13
  114. package/Facebook/events.d.ts.map +0 -1
  115. package/Facebook/events.js.map +0 -1
  116. package/Facebook/index.d.ts +0 -3
  117. package/Facebook/index.d.ts.map +0 -1
  118. package/Facebook/index.js.map +0 -1
  119. package/Facebook/types.d.ts +0 -22
  120. package/Facebook/types.d.ts.map +0 -1
  121. package/Facebook/types.js +0 -3
  122. package/Facebook/types.js.map +0 -1
  123. package/Firebase/Analytics/index.d.ts +0 -32
  124. package/Firebase/Analytics/index.d.ts.map +0 -1
  125. package/Firebase/Analytics/index.js.map +0 -1
  126. package/Firebase/Messaging/index.d.ts +0 -17
  127. package/Firebase/Messaging/index.d.ts.map +0 -1
  128. package/Firebase/Messaging/index.js.map +0 -1
  129. package/Firebase/index.d.ts +0 -4
  130. package/Firebase/index.d.ts.map +0 -1
  131. package/Firebase/index.js.map +0 -1
  132. package/Firebase/types.d.ts +0 -58
  133. package/Firebase/types.d.ts.map +0 -1
  134. package/Firebase/types.js +0 -4
  135. package/Firebase/types.js.map +0 -1
  136. package/FirebaseAnalytics/index.d.ts +0 -3
  137. package/FirebaseAnalytics/index.d.ts.map +0 -1
  138. package/FirebaseAnalytics/index.js.map +0 -1
  139. package/Haptics/index.d.ts +0 -7
  140. package/Haptics/index.d.ts.map +0 -1
  141. package/Haptics/index.js.map +0 -1
  142. package/Haptics/types.d.ts +0 -8
  143. package/Haptics/types.d.ts.map +0 -1
  144. package/Haptics/types.js +0 -3
  145. package/Haptics/types.js.map +0 -1
  146. package/InAppPurchase/index.d.ts +0 -23
  147. package/InAppPurchase/index.d.ts.map +0 -1
  148. package/InAppPurchase/index.js.map +0 -1
  149. package/InAppPurchase/types.d.ts +0 -34
  150. package/InAppPurchase/types.d.ts.map +0 -1
  151. package/InAppPurchase/types.js +0 -3
  152. package/InAppPurchase/types.js.map +0 -1
  153. package/InAppUpdate/index.d.ts +0 -12
  154. package/InAppUpdate/index.d.ts.map +0 -1
  155. package/InAppUpdate/index.js.map +0 -1
  156. package/InAppUpdate/types.d.ts +0 -15
  157. package/InAppUpdate/types.d.ts.map +0 -1
  158. package/InAppUpdate/types.js +0 -3
  159. package/InAppUpdate/types.js.map +0 -1
  160. package/MediaPlayer/index.d.ts +0 -17
  161. package/MediaPlayer/index.d.ts.map +0 -1
  162. package/MediaPlayer/index.js.map +0 -1
  163. package/MediaPlayer/types.d.ts +0 -14
  164. package/MediaPlayer/types.d.ts.map +0 -1
  165. package/MediaPlayer/types.js +0 -3
  166. package/MediaPlayer/types.js.map +0 -1
  167. package/NativeContacts/index.d.ts +0 -12
  168. package/NativeContacts/index.d.ts.map +0 -1
  169. package/NativeContacts/index.js.map +0 -1
  170. package/NativeContacts/types.d.ts +0 -14
  171. package/NativeContacts/types.d.ts.map +0 -1
  172. package/NativeContacts/types.js +0 -3
  173. package/NativeContacts/types.js.map +0 -1
  174. package/Notification/index.d.ts +0 -11
  175. package/Notification/index.d.ts.map +0 -1
  176. package/Notification/index.js.map +0 -1
  177. package/Notification/types.d.ts +0 -14
  178. package/Notification/types.d.ts.map +0 -1
  179. package/Notification/types.js +0 -3
  180. package/Notification/types.js.map +0 -1
  181. package/OneSignal/index.d.ts +0 -18
  182. package/OneSignal/index.d.ts.map +0 -1
  183. package/OneSignal/index.js.map +0 -1
  184. package/OneSignal/types.d.ts +0 -41
  185. package/OneSignal/types.d.ts.map +0 -1
  186. package/OneSignal/types.js +0 -4
  187. package/OneSignal/types.js.map +0 -1
  188. package/Printing/index.d.ts +0 -7
  189. package/Printing/index.d.ts.map +0 -1
  190. package/Printing/index.js.map +0 -1
  191. package/Printing/types.d.ts +0 -9
  192. package/Printing/types.d.ts.map +0 -1
  193. package/Printing/types.js +0 -3
  194. package/Printing/types.js.map +0 -1
  195. package/Screen/index.d.ts +0 -9
  196. package/Screen/index.d.ts.map +0 -1
  197. package/Screen/index.js.map +0 -1
  198. package/Screen/types.d.ts +0 -6
  199. package/Screen/types.d.ts.map +0 -1
  200. package/Screen/types.js +0 -4
  201. package/Screen/types.js.map +0 -1
  202. package/Siri/index.d.ts +0 -7
  203. package/Siri/index.d.ts.map +0 -1
  204. package/Siri/index.js.map +0 -1
  205. package/Siri/types.d.ts +0 -14
  206. package/Siri/types.d.ts.map +0 -1
  207. package/Siri/types.js +0 -3
  208. package/Siri/types.js.map +0 -1
  209. package/SocialLogin/apple.d.ts +0 -12
  210. package/SocialLogin/apple.d.ts.map +0 -1
  211. package/SocialLogin/apple.js.map +0 -1
  212. package/SocialLogin/facebook.d.ts +0 -22
  213. package/SocialLogin/facebook.d.ts.map +0 -1
  214. package/SocialLogin/facebook.js.map +0 -1
  215. package/SocialLogin/google.d.ts +0 -22
  216. package/SocialLogin/google.d.ts.map +0 -1
  217. package/SocialLogin/google.js.map +0 -1
  218. package/SocialLogin/index.d.ts +0 -17
  219. package/SocialLogin/index.d.ts.map +0 -1
  220. package/SocialLogin/index.js.map +0 -1
  221. package/SocialLogin/types.d.ts +0 -39
  222. package/SocialLogin/types.d.ts.map +0 -1
  223. package/SocialLogin/types.js +0 -3
  224. package/SocialLogin/types.js.map +0 -1
  225. package/Stripe/index.d.ts +0 -3
  226. package/Stripe/index.d.ts.map +0 -1
  227. package/Stripe/index.js.map +0 -1
  228. package/Stripe/types.d.ts +0 -32
  229. package/Stripe/types.d.ts.map +0 -1
  230. package/Stripe/types.js +0 -3
  231. package/Stripe/types.js.map +0 -1
  232. package/VoiceSearch/index.d.ts +0 -13
  233. package/VoiceSearch/index.d.ts.map +0 -1
  234. package/VoiceSearch/index.js.map +0 -1
  235. package/VoiceSearch/types.d.ts +0 -10
  236. package/VoiceSearch/types.d.ts.map +0 -1
  237. package/VoiceSearch/types.js +0 -3
  238. package/VoiceSearch/types.js.map +0 -1
  239. package/barcode/barcode-scan.d.ts +0 -16
  240. package/barcode/barcode-scan.d.ts.map +0 -1
  241. package/barcode/barcode-scan.js.map +0 -1
  242. package/barcode/barcode-types.d.ts +0 -18
  243. package/barcode/barcode-types.d.ts.map +0 -1
  244. package/barcode/barcode-types.js +0 -3
  245. package/barcode/barcode-types.js.map +0 -1
  246. package/barcode/formats.d.ts +0 -18
  247. package/barcode/formats.d.ts.map +0 -1
  248. package/barcode/formats.js.map +0 -1
  249. package/barcode/index.d.ts +0 -5
  250. package/barcode/index.d.ts.map +0 -1
  251. package/barcode/index.js.map +0 -1
  252. package/barcode/types.d.ts +0 -17
  253. package/barcode/types.d.ts.map +0 -1
  254. package/barcode/types.js.map +0 -1
  255. package/index.d.ts +0 -156
  256. package/index.d.ts.map +0 -1
  257. package/index.js.map +0 -1
  258. package/types/index.d.ts +0 -50
  259. package/types/index.d.ts.map +0 -1
  260. package/types/index.js +0 -4
  261. package/types/index.js.map +0 -1
  262. package/utills.d.ts +0 -12
  263. package/utills.d.ts.map +0 -1
  264. package/utills.js.map +0 -1
@@ -1,44 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sendPurchase = exports.send = void 0;
4
- var utills_1 = require("../utills");
5
- /**
6
- * Sends a Facebook event
7
- * @param options - Options for the Facebook event
8
- */
9
- var send = function (options) {
10
- if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
11
- var event_1 = options.event, valueToSum = options.valueToSum, parameters = options.parameters;
12
- utills_1.platform === "ANDROID_APP" && utills_1.webToNative.addFbEvents(event_1, parameters);
13
- if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
14
- utills_1.webToNativeIos.postMessage({
15
- action: "sendFBEvent",
16
- eventName: event_1,
17
- valueToSum: valueToSum,
18
- parameters: parameters,
19
- });
20
- }
21
- }
22
- };
23
- exports.send = send;
24
- /**
25
- * Sends a Facebook purchase event
26
- * @param options - Options for the Facebook purchase event
27
- * @example wtn.facebook.events.sendPurchase({amount: 10.99, currency: "USD", parameters: {item_name: "Product"}});
28
- */
29
- var sendPurchase = function (options) {
30
- if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
31
- var amount = options.amount, currency = options.currency, parameters = options.parameters;
32
- utills_1.platform === "ANDROID_APP" && utills_1.webToNative.addFbPurchaseEvent(amount, currency, parameters);
33
- if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
34
- utills_1.webToNativeIos.postMessage({
35
- action: "sendFBPurchaseEvent",
36
- currency: currency,
37
- amount: amount,
38
- parameters: parameters,
39
- });
40
- }
41
- }
42
- };
43
- exports.sendPurchase = sendPurchase;
44
- //# sourceMappingURL=events.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sendPurchase=exports.send=void 0;var _utills=require("../utills"),send=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.event,c=a.valueToSum,d=a.parameters;"ANDROID_APP"===_utills.platform&&_utills.webToNative.addFbEvents(b,d),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"sendFBEvent",eventName:b,valueToSum:c,parameters:d})}};exports.send=send;/**
2
+ *
3
+ * @example wtn.appsflyer.setCustomerUserId("ADD_TO_CART",{name:"Cadburry",quantity:1});
4
+ */var sendPurchase=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.amount,c=a.currency,d=a.parameters;"ANDROID_APP"===_utills.platform&&_utills.webToNative.addFbPurchaseEvent(b,c,d),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"sendFBPurchaseEvent",currency:c,amount:b,parameters:d})}};exports.sendPurchase=sendPurchase;
package/Facebook/index.js CHANGED
@@ -1,29 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.events = void 0;
27
- var events = __importStar(require("./events"));
28
- exports.events = events;
29
- //# sourceMappingURL=index.js.map
1
+ "use strict";var events=_interopRequireWildcard(require("./events"));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=events;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,110 +1,4 @@
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;
110
- //# sourceMappingURL=index.js.map
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,64 +1,4 @@
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;
64
- //# sourceMappingURL=index.js.map
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;
package/Firebase/index.js CHANGED
@@ -1,31 +1 @@
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;
31
- //# sourceMappingURL=index.js.map
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,29 +1 @@
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;
29
- //# sourceMappingURL=index.js.map
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}
package/Haptics/index.js CHANGED
@@ -1,21 +1 @@
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;
21
- //# sourceMappingURL=index.js.map
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,81 +1 @@
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;
81
- //# sourceMappingURL=index.js.map
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,39 +1 @@
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;
39
- //# sourceMappingURL=index.js.map
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,56 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stopMedia = exports.pauseMedia = exports.playMedia = void 0;
4
- var utills_1 = require("../utills");
5
- /**
6
- * Plays media content
7
- * @param options - Options for playing media
8
- */
9
- var playMedia = function (options) {
10
- if (options === void 0) { options = {}; }
11
- var url = options.url, _a = options.imageUrl, imageUrl = _a === void 0 ? "https://images.freeimages.com/images/large-previews/3b2/prague-conference-center-1056491.jpg" : _a;
12
- if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
13
- utills_1.platform === "ANDROID_APP" && utills_1.webToNative.playMedia(JSON.stringify({ url: url, imageUrl: imageUrl }));
14
- if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
15
- utills_1.webToNativeIos.postMessage({
16
- "action": "playMedia",
17
- url: url,
18
- image: imageUrl
19
- });
20
- }
21
- }
22
- };
23
- exports.playMedia = playMedia;
24
- /**
25
- * Pauses currently playing media
26
- * @param options - Options for pausing media
27
- */
28
- var pauseMedia = function (options) {
29
- if (options === void 0) { options = {}; }
30
- if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
31
- utills_1.platform === "ANDROID_APP" && utills_1.webToNative.pausePlaying();
32
- if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
33
- utills_1.webToNativeIos.postMessage({
34
- "action": "pauseMedia"
35
- });
36
- }
37
- }
38
- };
39
- exports.pauseMedia = pauseMedia;
40
- /**
41
- * Stops currently playing media
42
- * @param options - Options for stopping media
43
- */
44
- var stopMedia = function (options) {
45
- if (options === void 0) { options = {}; }
46
- if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
47
- utills_1.platform === "ANDROID_APP" && utills_1.webToNative.stopPlaying();
48
- if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
49
- utills_1.webToNativeIos.postMessage({
50
- "action": "stopMedia"
51
- });
52
- }
53
- }
54
- };
55
- exports.stopMedia = stopMedia;
56
- //# sourceMappingURL=index.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.stopMedia=exports.playMedia=exports.pauseMedia=void 0;var _utills=require("../utills"),playMedia=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.url,c=a.imageUrl,d=void 0===c?"https://images.freeimages.com/images/large-previews/3b2/prague-conference-center-1056491.jpg":c;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&("ANDROID_APP"===_utills.platform&&_utills.webToNative.playMedia(JSON.stringify({url:b,imageUrl:d})),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"playMedia",url:b,image:d}))};exports.playMedia=playMedia;/**
2
+ *
3
+ *
4
+ */var pauseMedia=function(){0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&("ANDROID_APP"===_utills.platform&&_utills.webToNative.pausePlaying(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"pauseMedia"}))};/**
5
+ *
6
+ *
7
+ */exports.pauseMedia=pauseMedia;var stopMedia=function(){0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&("ANDROID_APP"===_utills.platform&&_utills.webToNative.stopPlaying(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"stopMedia"}))};exports.stopMedia=stopMedia;
@@ -1,51 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAll = exports.getPermissionStatus = void 0;
4
- var utills_1 = require("../utills");
5
- /**
6
- * Gets the permission status for contacts access
7
- * @param options - Options for getting permission status
8
- */
9
- var getPermissionStatus = function (options) {
10
- if (options === void 0) { options = {}; }
11
- var callback = options.callback;
12
- if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
13
- (0, utills_1.registerCb)(function (response) {
14
- var type = response.type;
15
- if (type === "contactPermissionStatus") {
16
- callback && callback(response);
17
- }
18
- });
19
- utills_1.platform === "ANDROID_APP" && utills_1.webToNative.getPermissionStatus();
20
- if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
21
- utills_1.webToNativeIos.postMessage({
22
- action: "askUserForContactPermission",
23
- });
24
- }
25
- }
26
- };
27
- exports.getPermissionStatus = getPermissionStatus;
28
- /**
29
- * Gets all contacts from the device
30
- * @param options - Options for getting all contacts
31
- */
32
- var getAll = function (options) {
33
- if (options === void 0) { options = {}; }
34
- var callback = options.callback;
35
- if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
36
- (0, utills_1.registerCb)(function (response) {
37
- var type = response.type;
38
- if (type === "contactDetails") {
39
- callback && callback(response);
40
- }
41
- });
42
- utills_1.platform === "ANDROID_APP" && utills_1.webToNative.getAll();
43
- if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
44
- utills_1.webToNativeIos.postMessage({
45
- action: "getUserContactDetails",
46
- });
47
- }
48
- }
49
- };
50
- exports.getAll = getAll;
51
- //# sourceMappingURL=index.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPermissionStatus=exports.getAll=void 0;var _utills=require("../utills"),getPermissionStatus=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){//console.log(response);
2
+ var c=a.type;"contactPermissionStatus"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.getPermissionStatus(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"askUserForContactPermission"}))};exports.getPermissionStatus=getPermissionStatus;/**
3
+ *
4
+ *
5
+ */var getAll=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;//console.log(response);
6
+ "contactDetails"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.getAll(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"getUserContactDetails"}))};exports.getAll=getAll;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setCloudData=exports.setAppData=exports.getCloudData=exports.getAppData=exports.deleteCloudData=exports.deleteAppData=void 0;var _utills=require("../utills"),setAppData=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback,c=a.keyName,d=a.value;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"setAppData"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setAppData(JSON.stringify({keyName:c,value:d})),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setAppData",keyName:c,value:d}))};exports.setAppData=setAppData;var getAppData=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback,c=a.keyName;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"getAppData"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.getAppData(c),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"getAppData",keyName:c}))};exports.getAppData=getAppData;var deleteAppData=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback,c=a.keyName;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"deleteAppData"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.deleteAppData(c),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"deleteAppData",keyName:c}))};exports.deleteAppData=deleteAppData;var setCloudData=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback,c=a.keyName,d=a.value;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"setCloudData"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setCloudData(JSON.stringify({keyName:c,value:d})),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setCloudData",keyName:c,value:d}))};exports.setCloudData=setCloudData;var getCloudData=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback,c=a.keyName;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"getCloudData"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.getCloudData(c),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"getCloudData",keyName:c}))};exports.getCloudData=getCloudData;var deleteCloudData=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback,c=a.keyName;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"deleteCloudData"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.deleteCloudData(c),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"deleteCloudData",keyName:c}))};exports.deleteCloudData=deleteCloudData;