webtonative 1.0.74 → 1.0.75-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 (376) hide show
  1. package/.editorconfig +10 -0
  2. package/.prettierrc.json +7 -0
  3. package/README.md +31 -2
  4. package/build/ATTConsent/index.d.ts +17 -0
  5. package/build/ATTConsent/index.d.ts.map +1 -0
  6. package/build/ATTConsent/index.js +54 -0
  7. package/build/ATTConsent/index.js.map +1 -0
  8. package/build/ATTConsent/types.d.ts +15 -0
  9. package/build/ATTConsent/types.d.ts.map +1 -0
  10. package/build/ATTConsent/types.js +3 -0
  11. package/build/ATTConsent/types.js.map +1 -0
  12. package/build/AdMob/index.d.ts +31 -0
  13. package/build/AdMob/index.d.ts.map +1 -0
  14. package/build/AdMob/index.js +102 -0
  15. package/build/AdMob/index.js.map +1 -0
  16. package/build/AdMob/types.d.ts +25 -0
  17. package/build/AdMob/types.d.ts.map +1 -0
  18. package/build/AdMob/types.js +4 -0
  19. package/build/AdMob/types.js.map +1 -0
  20. package/build/AppReview/index.d.ts +7 -0
  21. package/build/AppReview/index.d.ts.map +1 -0
  22. package/build/AppReview/index.js +22 -0
  23. package/build/AppReview/index.js.map +1 -0
  24. package/build/AppReview/types.d.ts +8 -0
  25. package/build/AppReview/types.d.ts.map +1 -0
  26. package/build/AppReview/types.js +4 -0
  27. package/build/AppReview/types.js.map +1 -0
  28. package/build/AppsFlyer/index.d.ts +15 -0
  29. package/build/AppsFlyer/index.d.ts.map +1 -0
  30. package/build/AppsFlyer/index.js +43 -0
  31. package/build/AppsFlyer/index.js.map +1 -0
  32. package/build/AppsFlyer/types.d.ts +10 -0
  33. package/build/AppsFlyer/types.d.ts.map +1 -0
  34. package/build/AppsFlyer/types.js +3 -0
  35. package/build/AppsFlyer/types.js.map +1 -0
  36. package/build/BackgroundLocation/index.d.ts +12 -0
  37. package/build/BackgroundLocation/index.d.ts.map +1 -0
  38. package/build/BackgroundLocation/index.js +65 -0
  39. package/build/BackgroundLocation/index.js.map +1 -0
  40. package/build/BackgroundLocation/types.d.ts +32 -0
  41. package/build/BackgroundLocation/types.d.ts.map +1 -0
  42. package/build/BackgroundLocation/types.js +3 -0
  43. package/build/BackgroundLocation/types.js.map +1 -0
  44. package/build/Beacon/index.d.ts +7 -0
  45. package/build/Beacon/index.d.ts.map +1 -0
  46. package/build/Beacon/index.js +30 -0
  47. package/build/Beacon/index.js.map +1 -0
  48. package/build/Beacon/types.d.ts +19 -0
  49. package/build/Beacon/types.d.ts.map +1 -0
  50. package/build/Beacon/types.js +3 -0
  51. package/build/Beacon/types.js.map +1 -0
  52. package/build/Biometric/index.d.ts +27 -0
  53. package/build/Biometric/index.d.ts.map +1 -0
  54. package/build/Biometric/index.js +125 -0
  55. package/build/Biometric/index.js.map +1 -0
  56. package/build/Biometric/types.d.ts +24 -0
  57. package/build/Biometric/types.d.ts.map +1 -0
  58. package/build/Biometric/types.js +3 -0
  59. package/build/Biometric/types.js.map +1 -0
  60. package/build/Bluetooth/index.d.ts +17 -0
  61. package/build/Bluetooth/index.d.ts.map +1 -0
  62. package/build/Bluetooth/index.js +67 -0
  63. package/build/Bluetooth/index.js.map +1 -0
  64. package/build/Bluetooth/types.d.ts +34 -0
  65. package/build/Bluetooth/types.d.ts.map +1 -0
  66. package/build/Bluetooth/types.js +3 -0
  67. package/build/Bluetooth/types.js.map +1 -0
  68. package/build/BottomNavigation/index.d.ts +11 -0
  69. package/build/BottomNavigation/index.d.ts.map +1 -0
  70. package/build/BottomNavigation/index.js +41 -0
  71. package/build/BottomNavigation/index.js.map +1 -0
  72. package/build/BottomNavigation/types.d.ts +9 -0
  73. package/build/BottomNavigation/types.d.ts.map +1 -0
  74. package/build/BottomNavigation/types.js +3 -0
  75. package/build/BottomNavigation/types.js.map +1 -0
  76. package/build/Clipboard/index.d.ts +12 -0
  77. package/build/Clipboard/index.d.ts.map +1 -0
  78. package/build/Clipboard/index.js +45 -0
  79. package/build/Clipboard/index.js.map +1 -0
  80. package/build/Clipboard/types.d.ts +20 -0
  81. package/build/Clipboard/types.d.ts.map +1 -0
  82. package/build/Clipboard/types.js +4 -0
  83. package/build/Clipboard/types.js.map +1 -0
  84. package/build/Facebook/events.d.ts +13 -0
  85. package/build/Facebook/events.d.ts.map +1 -0
  86. package/build/Facebook/events.js +44 -0
  87. package/build/Facebook/events.js.map +1 -0
  88. package/build/Facebook/index.d.ts +3 -0
  89. package/build/Facebook/index.d.ts.map +1 -0
  90. package/build/Facebook/index.js +29 -0
  91. package/build/Facebook/index.js.map +1 -0
  92. package/build/Facebook/types.d.ts +22 -0
  93. package/build/Facebook/types.d.ts.map +1 -0
  94. package/build/Facebook/types.js +3 -0
  95. package/build/Facebook/types.js.map +1 -0
  96. package/build/Firebase/Analytics/index.d.ts +32 -0
  97. package/build/Firebase/Analytics/index.d.ts.map +1 -0
  98. package/build/Firebase/Analytics/index.js +110 -0
  99. package/build/Firebase/Analytics/index.js.map +1 -0
  100. package/build/Firebase/Messaging/index.d.ts +17 -0
  101. package/build/Firebase/Messaging/index.d.ts.map +1 -0
  102. package/build/Firebase/Messaging/index.js +64 -0
  103. package/build/Firebase/Messaging/index.js.map +1 -0
  104. package/build/Firebase/index.d.ts +4 -0
  105. package/build/Firebase/index.d.ts.map +1 -0
  106. package/build/Firebase/index.js +31 -0
  107. package/build/Firebase/index.js.map +1 -0
  108. package/build/Firebase/types.d.ts +58 -0
  109. package/build/Firebase/types.d.ts.map +1 -0
  110. package/build/Firebase/types.js +4 -0
  111. package/build/Firebase/types.js.map +1 -0
  112. package/build/FirebaseAnalytics/index.d.ts +3 -0
  113. package/build/FirebaseAnalytics/index.d.ts.map +1 -0
  114. package/build/FirebaseAnalytics/index.js +29 -0
  115. package/build/FirebaseAnalytics/index.js.map +1 -0
  116. package/build/Haptics/index.d.ts +7 -0
  117. package/build/Haptics/index.d.ts.map +1 -0
  118. package/build/Haptics/index.js +21 -0
  119. package/build/Haptics/index.js.map +1 -0
  120. package/build/Haptics/types.d.ts +8 -0
  121. package/build/Haptics/types.d.ts.map +1 -0
  122. package/build/Haptics/types.js +3 -0
  123. package/build/Haptics/types.js.map +1 -0
  124. package/build/InAppPurchase/index.d.ts +23 -0
  125. package/build/InAppPurchase/index.d.ts.map +1 -0
  126. package/build/InAppPurchase/index.js +81 -0
  127. package/build/InAppPurchase/index.js.map +1 -0
  128. package/build/InAppPurchase/types.d.ts +30 -0
  129. package/build/InAppPurchase/types.d.ts.map +1 -0
  130. package/build/InAppPurchase/types.js +3 -0
  131. package/build/InAppPurchase/types.js.map +1 -0
  132. package/build/InAppUpdate/index.d.ts +12 -0
  133. package/build/InAppUpdate/index.d.ts.map +1 -0
  134. package/build/InAppUpdate/index.js +39 -0
  135. package/build/InAppUpdate/index.js.map +1 -0
  136. package/build/InAppUpdate/types.d.ts +15 -0
  137. package/build/InAppUpdate/types.d.ts.map +1 -0
  138. package/build/InAppUpdate/types.js +3 -0
  139. package/build/InAppUpdate/types.js.map +1 -0
  140. package/build/MediaPlayer/index.d.ts +17 -0
  141. package/build/MediaPlayer/index.d.ts.map +1 -0
  142. package/build/MediaPlayer/index.js +56 -0
  143. package/build/MediaPlayer/index.js.map +1 -0
  144. package/build/MediaPlayer/types.d.ts +14 -0
  145. package/build/MediaPlayer/types.d.ts.map +1 -0
  146. package/build/MediaPlayer/types.js +3 -0
  147. package/build/MediaPlayer/types.js.map +1 -0
  148. package/build/NativeContacts/index.d.ts +12 -0
  149. package/build/NativeContacts/index.d.ts.map +1 -0
  150. package/build/NativeContacts/index.js +51 -0
  151. package/build/NativeContacts/index.js.map +1 -0
  152. package/build/NativeContacts/types.d.ts +14 -0
  153. package/build/NativeContacts/types.d.ts.map +1 -0
  154. package/build/NativeContacts/types.js +3 -0
  155. package/build/NativeContacts/types.js.map +1 -0
  156. package/build/Notification/index.d.ts +11 -0
  157. package/build/Notification/index.d.ts.map +1 -0
  158. package/build/Notification/index.js +42 -0
  159. package/build/Notification/index.js.map +1 -0
  160. package/build/Notification/types.d.ts +14 -0
  161. package/build/Notification/types.d.ts.map +1 -0
  162. package/build/Notification/types.js +3 -0
  163. package/build/Notification/types.js.map +1 -0
  164. package/build/OneSignal/index.d.ts +4 -0
  165. package/build/OneSignal/index.d.ts.map +1 -0
  166. package/build/OneSignal/index.js +59 -0
  167. package/build/OneSignal/index.js.map +1 -0
  168. package/build/OneSignal/types.d.ts +11 -0
  169. package/build/OneSignal/types.d.ts.map +1 -0
  170. package/build/OneSignal/types.js +4 -0
  171. package/build/OneSignal/types.js.map +1 -0
  172. package/build/Printing/index.d.ts +7 -0
  173. package/build/Printing/index.d.ts.map +1 -0
  174. package/build/Printing/index.js +20 -0
  175. package/build/Printing/index.js.map +1 -0
  176. package/build/Printing/types.d.ts +9 -0
  177. package/build/Printing/types.d.ts.map +1 -0
  178. package/build/Printing/types.js +3 -0
  179. package/build/Printing/types.js.map +1 -0
  180. package/build/README.md +33 -0
  181. package/build/Screen/index.d.ts +9 -0
  182. package/build/Screen/index.d.ts.map +1 -0
  183. package/build/Screen/index.js +35 -0
  184. package/build/Screen/index.js.map +1 -0
  185. package/build/Screen/types.d.ts +6 -0
  186. package/build/Screen/types.d.ts.map +1 -0
  187. package/build/Screen/types.js +4 -0
  188. package/build/Screen/types.js.map +1 -0
  189. package/build/Siri/index.d.ts +7 -0
  190. package/build/Siri/index.d.ts.map +1 -0
  191. package/build/Siri/index.js +26 -0
  192. package/build/Siri/index.js.map +1 -0
  193. package/build/Siri/types.d.ts +14 -0
  194. package/build/Siri/types.d.ts.map +1 -0
  195. package/build/Siri/types.js +3 -0
  196. package/build/Siri/types.js.map +1 -0
  197. package/build/SocialLogin/apple.d.ts +12 -0
  198. package/build/SocialLogin/apple.d.ts.map +1 -0
  199. package/build/SocialLogin/apple.js +32 -0
  200. package/build/SocialLogin/apple.js.map +1 -0
  201. package/build/SocialLogin/facebook.d.ts +22 -0
  202. package/build/SocialLogin/facebook.d.ts.map +1 -0
  203. package/build/SocialLogin/facebook.js +61 -0
  204. package/build/SocialLogin/facebook.js.map +1 -0
  205. package/build/SocialLogin/google.d.ts +22 -0
  206. package/build/SocialLogin/google.d.ts.map +1 -0
  207. package/build/SocialLogin/google.js +61 -0
  208. package/build/SocialLogin/google.js.map +1 -0
  209. package/build/SocialLogin/index.d.ts +17 -0
  210. package/build/SocialLogin/index.d.ts.map +1 -0
  211. package/build/SocialLogin/index.js +23 -0
  212. package/build/SocialLogin/index.js.map +1 -0
  213. package/build/SocialLogin/types.d.ts +39 -0
  214. package/build/SocialLogin/types.d.ts.map +1 -0
  215. package/build/SocialLogin/types.js +3 -0
  216. package/build/SocialLogin/types.js.map +1 -0
  217. package/build/Stripe/index.d.ts +3 -0
  218. package/build/Stripe/index.d.ts.map +1 -0
  219. package/build/Stripe/index.js +49 -0
  220. package/build/Stripe/index.js.map +1 -0
  221. package/build/Stripe/types.d.ts +32 -0
  222. package/build/Stripe/types.d.ts.map +1 -0
  223. package/build/Stripe/types.js +3 -0
  224. package/build/Stripe/types.js.map +1 -0
  225. package/build/VoiceSearch/index.d.ts +13 -0
  226. package/build/VoiceSearch/index.d.ts.map +1 -0
  227. package/build/VoiceSearch/index.js +34 -0
  228. package/build/VoiceSearch/index.js.map +1 -0
  229. package/build/VoiceSearch/types.d.ts +10 -0
  230. package/build/VoiceSearch/types.d.ts.map +1 -0
  231. package/build/VoiceSearch/types.js +3 -0
  232. package/build/VoiceSearch/types.js.map +1 -0
  233. package/build/barcode/barcode-scan.d.ts +16 -0
  234. package/build/barcode/barcode-scan.d.ts.map +1 -0
  235. package/build/barcode/barcode-scan.js +40 -0
  236. package/build/barcode/barcode-scan.js.map +1 -0
  237. package/build/barcode/barcode-types.d.ts +18 -0
  238. package/build/barcode/barcode-types.d.ts.map +1 -0
  239. package/build/barcode/barcode-types.js +3 -0
  240. package/build/barcode/barcode-types.js.map +1 -0
  241. package/build/barcode/formats.d.ts +18 -0
  242. package/build/barcode/formats.d.ts.map +1 -0
  243. package/build/barcode/formats.js +23 -0
  244. package/build/barcode/formats.js.map +1 -0
  245. package/build/barcode/index.d.ts +5 -0
  246. package/build/barcode/index.d.ts.map +1 -0
  247. package/build/barcode/index.js +13 -0
  248. package/build/barcode/index.js.map +1 -0
  249. package/build/barcode/types.d.ts +17 -0
  250. package/build/barcode/types.d.ts.map +1 -0
  251. package/build/barcode/types.js +22 -0
  252. package/build/barcode/types.js.map +1 -0
  253. package/build/index.d.ts +15 -0
  254. package/build/index.d.ts.map +1 -0
  255. package/build/index.js +110 -0
  256. package/build/index.js.map +1 -0
  257. package/build/package.json +155 -0
  258. package/build/types/index.d.ts +49 -0
  259. package/build/types/index.d.ts.map +1 -0
  260. package/build/types/index.js +4 -0
  261. package/build/types/index.js.map +1 -0
  262. package/build/utills.d.ts +12 -0
  263. package/build/utills.d.ts.map +1 -0
  264. package/build/utills.js +111 -0
  265. package/build/utills.js.map +1 -0
  266. package/build/webtonative.min.js +1 -0
  267. package/buildScript.ts +35 -0
  268. package/client.ts +106 -0
  269. package/index.d.ts +65 -0
  270. package/package.json +36 -31
  271. package/src/ATTConsent/index.ts +51 -0
  272. package/src/ATTConsent/types.ts +17 -0
  273. package/src/AdMob/index.ts +113 -0
  274. package/src/AdMob/types.ts +37 -0
  275. package/src/AppReview/index.ts +19 -0
  276. package/src/AppReview/types.ts +12 -0
  277. package/src/AppsFlyer/index.ts +46 -0
  278. package/src/AppsFlyer/types.ts +10 -0
  279. package/src/BackgroundLocation/index.ts +78 -0
  280. package/src/BackgroundLocation/types.ts +34 -0
  281. package/src/Beacon/index.ts +28 -0
  282. package/src/Beacon/types.ts +22 -0
  283. package/src/Biometric/index.ts +126 -0
  284. package/src/Biometric/types.ts +27 -0
  285. package/src/Bluetooth/index.ts +71 -0
  286. package/src/Bluetooth/types.ts +40 -0
  287. package/src/BottomNavigation/index.ts +39 -0
  288. package/src/BottomNavigation/types.ts +9 -0
  289. package/src/Clipboard/index.ts +48 -0
  290. package/src/Clipboard/types.ts +30 -0
  291. package/src/Facebook/events.ts +45 -0
  292. package/src/Facebook/index.ts +3 -0
  293. package/src/Facebook/types.ts +24 -0
  294. package/src/Firebase/Analytics/index.ts +127 -0
  295. package/src/Firebase/Messaging/index.ts +73 -0
  296. package/src/Firebase/index.ts +4 -0
  297. package/src/Firebase/types.ts +74 -0
  298. package/src/FirebaseAnalytics/index.ts +3 -0
  299. package/src/Haptics/index.ts +17 -0
  300. package/src/Haptics/types.ts +8 -0
  301. package/src/InAppPurchase/index.ts +92 -0
  302. package/src/InAppPurchase/types.ts +35 -0
  303. package/src/InAppUpdate/index.ts +40 -0
  304. package/src/InAppUpdate/types.ts +17 -0
  305. package/src/MediaPlayer/index.ts +56 -0
  306. package/src/MediaPlayer/types.ts +15 -0
  307. package/src/NativeContacts/index.ts +50 -0
  308. package/src/NativeContacts/types.ts +16 -0
  309. package/src/Notification/index.ts +41 -0
  310. package/src/Notification/types.ts +16 -0
  311. package/src/OneSignal/index.ts +54 -0
  312. package/src/OneSignal/types.ts +15 -0
  313. package/src/Printing/index.ts +17 -0
  314. package/src/Printing/types.ts +9 -0
  315. package/src/Screen/index.ts +34 -0
  316. package/src/Screen/types.ts +8 -0
  317. package/src/Siri/index.ts +23 -0
  318. package/src/Siri/types.ts +14 -0
  319. package/src/SocialLogin/apple.ts +31 -0
  320. package/src/SocialLogin/facebook.ts +64 -0
  321. package/src/SocialLogin/google.ts +64 -0
  322. package/src/SocialLogin/index.ts +20 -0
  323. package/src/SocialLogin/types.ts +52 -0
  324. package/src/Stripe/index.ts +54 -0
  325. package/src/Stripe/types.ts +37 -0
  326. package/src/VoiceSearch/index.ts +37 -0
  327. package/src/VoiceSearch/types.ts +12 -0
  328. package/src/barcode/barcode-scan.ts +59 -0
  329. package/src/barcode/barcode-types.ts +22 -0
  330. package/src/barcode/formats.ts +19 -0
  331. package/src/barcode/index.ts +5 -0
  332. package/src/barcode/types.ts +18 -0
  333. package/src/index.ts +105 -0
  334. package/src/types/index.ts +71 -0
  335. package/src/utills.ts +110 -0
  336. package/tsconfig.json +27 -0
  337. package/webpack.config.js +57 -0
  338. package/ATTConsent/index.js +0 -1
  339. package/AdMob/index.js +0 -1
  340. package/AppReview/index.js +0 -1
  341. package/AppsFlyer/index.js +0 -4
  342. package/BackgroundLocation/index.js +0 -4
  343. package/Beacon/index.js +0 -1
  344. package/Biometric/index.js +0 -1
  345. package/Bluetooth/index.js +0 -1
  346. package/BottomNavigation/index.js +0 -4
  347. package/Clipboard/index.js +0 -4
  348. package/Facebook/events.js +0 -4
  349. package/Facebook/index.js +0 -1
  350. package/Firebase/Analytics/index.js +0 -4
  351. package/Firebase/Messaging/index.js +0 -4
  352. package/Firebase/index.js +0 -1
  353. package/FirebaseAnalytics/index.js +0 -1
  354. package/Haptics/index.js +0 -1
  355. package/InAppPurchase/index.js +0 -1
  356. package/InAppUpdate/index.js +0 -1
  357. package/MediaPlayer/index.js +0 -7
  358. package/NativeContacts/index.js +0 -6
  359. package/Notification/index.js +0 -5
  360. package/OneSignal/index.js +0 -1
  361. package/Printing/index.js +0 -1
  362. package/Screen/index.js +0 -4
  363. package/Siri/index.js +0 -1
  364. package/SocialLogin/apple.js +0 -1
  365. package/SocialLogin/facebook.js +0 -9
  366. package/SocialLogin/google.js +0 -9
  367. package/SocialLogin/index.js +0 -1
  368. package/Stripe/index.js +0 -1
  369. package/VoiceSearch/index.js +0 -1
  370. package/barcode/barcode-scan.js +0 -1
  371. package/barcode/formats.js +0 -1
  372. package/barcode/index.js +0 -1
  373. package/barcode/types.js +0 -1
  374. package/index.js +0 -4
  375. package/utills.js +0 -1
  376. package/webtonative.min.js +0 -1
package/package.json CHANGED
@@ -1,32 +1,37 @@
1
1
  {
2
- "name": "webtonative",
3
- "version": "1.0.74",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "build": "rimraf build && babel src --presets @babel/preset-env,minify --out-dir build && node buildScript.js && npm run dist",
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "dist": "NODE_ENV=production webpack --config webpack.config.js"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/webtonative/webtonative.git"
14
- },
15
- "author": "",
16
- "license": "ISC",
17
- "bugs": {
18
- "url": "https://github.com/webtonative/webtonative/issues"
19
- },
20
- "homepage": "https://github.com/webtonative/webtonative#readme",
21
- "dependencies": {},
22
- "devDependencies": {
23
- "@babel/cli": "^7.14.5",
24
- "@babel/core": "^7.14.6",
25
- "@babel/preset-env": "^7.14.7",
26
- "babel-loader": "^8.2.2",
27
- "babel-preset-minify": "^0.5.1",
28
- "rimraf": "^3.0.2",
29
- "webpack": "^5.40.0",
30
- "webpack-cli": "^4.7.2"
31
- }
32
- }
2
+ "name": "webtonative",
3
+ "version": "1.0.75-beta.2",
4
+ "description": "",
5
+ "main": "build/index.js",
6
+ "types": "build/index.d.ts",
7
+ "scripts": {
8
+ "build": "rimraf build && tsc && ts-node buildScript.ts && npm run dist",
9
+ "test": "echo \"Error: no test specified\" && exit 1",
10
+ "dist": "NODE_ENV=production webpack --config webpack.config.js"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/webtonative/webtonative.git"
15
+ },
16
+ "author": "",
17
+ "license": "ISC",
18
+ "bugs": {
19
+ "url": "https://github.com/webtonative/webtonative/issues"
20
+ },
21
+ "homepage": "https://github.com/webtonative/webtonative#readme",
22
+ "dependencies": {},
23
+ "devDependencies": {
24
+ "@babel/cli": "^7.14.5",
25
+ "@babel/core": "^7.14.6",
26
+ "@babel/preset-env": "^7.14.7",
27
+ "@types/node": "^18.11.18",
28
+ "babel-loader": "^8.2.2",
29
+ "babel-preset-minify": "^0.5.1",
30
+ "rimraf": "^3.0.2",
31
+ "ts-loader": "^9.4.2",
32
+ "ts-node": "^10.9.1",
33
+ "typescript": "^4.9.4",
34
+ "webpack": "^5.40.0",
35
+ "webpack-cli": "^4.7.2"
36
+ }
37
+ }
@@ -0,0 +1,51 @@
1
+ import { platform, registerCb, webToNativeIos } from "../utills";
2
+ import { ATTConsentOptions, ATTConsentResponse, ATTConsentIosMessage } from "./types";
3
+
4
+ /**
5
+ * This function opens ATTConsent
6
+ * @param options - Options for ATT consent request
7
+ * @example wtn.ATTConsent.request({
8
+ * callback:(value)=>{
9
+ * console.log(value);
10
+ * }
11
+ * });
12
+ */
13
+ export const request = (options: ATTConsentOptions = {}): void => {
14
+ const { callback } = options;
15
+ if (["IOS_APP"].includes(platform)) {
16
+ registerCb((response: ATTConsentResponse) => {
17
+ const { type } = response;
18
+ if (type === "requestTrackingConsent") {
19
+ callback && callback(response);
20
+ }
21
+ });
22
+
23
+ if (platform === "IOS_APP" && webToNativeIos) {
24
+ webToNativeIos.postMessage({
25
+ action: "requestTrackingAuthorization",
26
+ } as ATTConsentIosMessage);
27
+ }
28
+ }
29
+ };
30
+
31
+ /**
32
+ * This function gets the current ATT consent status
33
+ * @param options - Options for ATT consent status
34
+ */
35
+ export const status = (options: ATTConsentOptions = {}): void => {
36
+ const { callback } = options;
37
+ if (["IOS_APP"].includes(platform)) {
38
+ registerCb((response: ATTConsentResponse) => {
39
+ const { type } = response;
40
+ if (type === "trackingConsentStatus") {
41
+ callback && callback(response);
42
+ }
43
+ });
44
+
45
+ if (platform === "IOS_APP" && webToNativeIos) {
46
+ webToNativeIos.postMessage({
47
+ action: "trackingConsentStatus",
48
+ } as ATTConsentIosMessage);
49
+ }
50
+ }
51
+ };
@@ -0,0 +1,17 @@
1
+ export interface ATTConsentResponse {
2
+ type: string;
3
+ status?: string;
4
+ [key: string]: any;
5
+ }
6
+
7
+ export interface ATTConsentCallback {
8
+ (response: ATTConsentResponse): void;
9
+ }
10
+
11
+ export interface ATTConsentOptions {
12
+ callback?: ATTConsentCallback;
13
+ }
14
+
15
+ export interface ATTConsentIosMessage {
16
+ action: string;
17
+ }
@@ -0,0 +1,113 @@
1
+ import {
2
+ webToNative,
3
+ isNativeApp,
4
+ registerForAbMobCb,
5
+ deRegisterForAbMobCb,
6
+ platform,
7
+ webToNativeIos,
8
+ } from "../utills";
9
+ import { Platform } from "../types";
10
+ import {
11
+ AdMobResponse,
12
+ AdMobCallback,
13
+ BannerAdOptions,
14
+ FullScreenAdOptions,
15
+ RewardsAdOptions,
16
+ AdMobIosMessage
17
+ } from "./types";
18
+
19
+ let adMobCb: AdMobCallback | null = null;
20
+
21
+ /**
22
+ * This function shows banner ad
23
+ * @param options - Banner ad options
24
+ * @example wtn.bannerAd({
25
+ * adId: "ca-app-pub-xxx"
26
+ * });
27
+ */
28
+ const bannerAd = (options: BannerAdOptions = {}): any => {
29
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
30
+ if (platform === "IOS_APP" && webToNativeIos) {
31
+ webToNativeIos.postMessage({
32
+ action: "showBannerAd",
33
+ adId: options.adId || "",
34
+ } as AdMobIosMessage);
35
+ }
36
+ platform === "ANDROID_APP" && webToNative.showBannerAd(JSON.stringify(options));
37
+ return this;
38
+ }
39
+ };
40
+
41
+ /**
42
+ * This function shows full screen ad
43
+ * @param options - Full screen ad options
44
+ * @example wtn.fullScreenAd({
45
+ * fullScreenAdCallback:(value)=>{
46
+ * console.log(value);
47
+ * }
48
+ * });
49
+ */
50
+ const fullScreenAd = (options: FullScreenAdOptions = {}): any => {
51
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
52
+ const { fullScreenAdCallback } = options;
53
+ registerForAbMobCb((response: AdMobResponse) => {
54
+ const { status } = response;
55
+ adMobCb && adMobCb(response);
56
+ if (status === "adDismissed") {
57
+ adMobCb = null;
58
+ }
59
+ if (["adDismissed", "adLoadError", "adError"].indexOf(status) > -1) {
60
+ deRegisterForAbMobCb();
61
+ }
62
+ });
63
+ if (platform === "IOS_APP" && webToNativeIos) {
64
+ webToNativeIos.postMessage({
65
+ action: "showFullScreenAd",
66
+ adId: options.adId || "",
67
+ } as AdMobIosMessage);
68
+ }
69
+ platform === "ANDROID_APP" && webToNative.showFullScreenAd(JSON.stringify(options));
70
+ if (typeof fullScreenAdCallback === "function") {
71
+ adMobCb = fullScreenAdCallback;
72
+ }
73
+ return this;
74
+ }
75
+ };
76
+
77
+ /**
78
+ * This function shows rewards ad
79
+ * @param options - Rewards ad options
80
+ * @example wtn.rewardsAd({
81
+ * rewardsAdCallback:(value)=>{
82
+ * console.log(value);
83
+ * }
84
+ * });
85
+ */
86
+ const rewardsAd = (options: RewardsAdOptions = {}): any => {
87
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
88
+ const { rewardsAdCallback } = options;
89
+ registerForAbMobCb((response: AdMobResponse) => {
90
+ const { status } = response;
91
+ adMobCb && adMobCb(response);
92
+ if (status === "adDismissed") {
93
+ adMobCb = null;
94
+ }
95
+ if (["adDismissed", "adLoadError", "adError"].indexOf(status) > -1) {
96
+ deRegisterForAbMobCb();
97
+ }
98
+ });
99
+ if (platform === "IOS_APP" && webToNativeIos) {
100
+ webToNativeIos.postMessage({
101
+ action: "showRewardAd",
102
+ adId: options.adId || "",
103
+ } as AdMobIosMessage);
104
+ }
105
+ platform === "ANDROID_APP" && webToNative.showRewardsAd(JSON.stringify(options));
106
+ if (typeof rewardsAdCallback === "function") {
107
+ adMobCb = rewardsAdCallback;
108
+ }
109
+ return this;
110
+ }
111
+ };
112
+
113
+ export { bannerAd, fullScreenAd, rewardsAd };
@@ -0,0 +1,37 @@
1
+ // Define types for AdMob module
2
+
3
+ // AdMob response interface
4
+ export interface AdMobResponse {
5
+ status: 'adDismissed' | 'adLoadError' | 'adError' | string;
6
+ [key: string]: any;
7
+ }
8
+
9
+ // AdMob callback function type
10
+ export type AdMobCallback = (response: AdMobResponse) => void;
11
+
12
+ // Banner ad options
13
+ export interface BannerAdOptions {
14
+ adId?: string;
15
+ [key: string]: any;
16
+ }
17
+
18
+ // Full screen ad options
19
+ export interface FullScreenAdOptions {
20
+ adId?: string;
21
+ fullScreenAdCallback?: AdMobCallback;
22
+ [key: string]: any;
23
+ }
24
+
25
+ // Rewards ad options
26
+ export interface RewardsAdOptions {
27
+ adId?: string;
28
+ rewardsAdCallback?: AdMobCallback;
29
+ [key: string]: any;
30
+ }
31
+
32
+ // iOS message structure
33
+ export interface AdMobIosMessage {
34
+ action: string;
35
+ adId?: string;
36
+ [key: string]: any;
37
+ }
@@ -0,0 +1,19 @@
1
+ import { platform, registerCb, webToNativeIos, webToNative } from "../utills";
2
+ import { AppReviewOptions, AppReviewIosMessage } from "./types";
3
+
4
+ /**
5
+ * Shows the app review/rating prompt
6
+ * @param options - Options for app review prompt
7
+ */
8
+ export const prompt = (options: AppReviewOptions = {}): void => {
9
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
10
+ if (platform === "IOS_APP" && webToNativeIos) {
11
+ webToNativeIos.postMessage({
12
+ action: "showAppRating",
13
+ } as AppReviewIosMessage);
14
+ }
15
+
16
+ platform === "ANDROID_APP" &&
17
+ webToNative.showInAppReview();
18
+ }
19
+ };
@@ -0,0 +1,12 @@
1
+ // Define types for AppReview module
2
+
3
+ // iOS message structure
4
+ export interface AppReviewIosMessage {
5
+ action: string;
6
+ [key: string]: any;
7
+ }
8
+
9
+ // Options for app review prompt
10
+ export interface AppReviewOptions {
11
+ [key: string]: any;
12
+ }
@@ -0,0 +1,46 @@
1
+ import {
2
+ platform,
3
+ webToNative,
4
+ webToNativeIos,
5
+ } from "../utills";
6
+ import { AppsFlyerEventValues, AppsFlyerIosMessage } from "./types";
7
+
8
+ /**
9
+ * Sets the AppsFlyer customer user ID
10
+ * @param userId - The user ID to set
11
+ * @example wtn.appsflyer.setCustomerUserId("1234");
12
+ */
13
+ export const setCustomerUserId = (userId: string): void => {
14
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
15
+ platform === "ANDROID_APP" &&
16
+ webToNative.setAppsFlyerUserId(userId);
17
+
18
+ if (platform === "IOS_APP" && webToNativeIos) {
19
+ webToNativeIos.postMessage({
20
+ action: "setAppsFlyerUserId",
21
+ userId
22
+ } as AppsFlyerIosMessage);
23
+ }
24
+ }
25
+ };
26
+
27
+ /**
28
+ * Logs an event to AppsFlyer
29
+ * @param eventName - The name of the event
30
+ * @param eventValues - The values associated with the event
31
+ * @example wtn.appsflyer.logEvent("ADD_TO_CART",{name:"Cadburry",quantity:1});
32
+ */
33
+ export const logEvent = (eventName: string, eventValues: AppsFlyerEventValues): void => {
34
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
35
+ platform === "ANDROID_APP" &&
36
+ webToNative.addEventToAppsFlyer(eventName, JSON.stringify(eventValues));
37
+
38
+ if (platform === "IOS_APP" && webToNativeIos) {
39
+ webToNativeIos.postMessage({
40
+ action: "addEventToAppsFlyer",
41
+ eventName,
42
+ eventValues
43
+ } as AppsFlyerIosMessage);
44
+ }
45
+ }
46
+ };
@@ -0,0 +1,10 @@
1
+ export interface AppsFlyerEventValues {
2
+ [key: string]: any;
3
+ }
4
+
5
+ export interface AppsFlyerIosMessage {
6
+ action: string;
7
+ userId?: string;
8
+ eventName?: string;
9
+ eventValues?: AppsFlyerEventValues;
10
+ }
@@ -0,0 +1,78 @@
1
+ import { platform, webToNative, webToNativeIos, registerCb, deRegisterCbByKey } from "../utills";
2
+ import { BackgroundLocationOptions, BackgroundLocationIosMessage, LocationUpdateResponse } from "./types";
3
+
4
+ /**
5
+ * Starts tracking background location
6
+ * @param options - Background location tracking options
7
+ */
8
+ export const start = (options: BackgroundLocationOptions = {}): void => {
9
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
10
+ const {
11
+ data,
12
+ callback,
13
+ backgroundIndicator = false,
14
+ pauseAutomatically = true,
15
+ distanceFilter = 0.0,
16
+ desiredAccuracy = "best",
17
+ activityType = "other",
18
+ apiUrl,
19
+ timeout,
20
+ } = options;
21
+
22
+ registerCb(
23
+ (response: LocationUpdateResponse) => {
24
+ const { type } = response;
25
+ if (type === "LOCATION_UPDATE") {
26
+ callback && callback(response);
27
+ }
28
+ },
29
+ {
30
+ key: "LOCATION_UPDATE",
31
+ ignoreDelete: true,
32
+ }
33
+ );
34
+
35
+ if (platform === "IOS_APP" && webToNativeIos) {
36
+ webToNativeIos.postMessage({
37
+ action: "startLocation",
38
+ data,
39
+ backgroundIndicator,
40
+ pauseAutomatically,
41
+ distanceFilter,
42
+ desiredAccuracy,
43
+ activityType,
44
+ apiUrl,
45
+ timeout,
46
+ } as BackgroundLocationIosMessage);
47
+ }
48
+
49
+ platform === "ANDROID_APP" &&
50
+ webToNative.startTrackingLocation(JSON.stringify({
51
+ action: "startLocation",
52
+ data,
53
+ interval: timeout,
54
+ callback,
55
+ apiUrl,
56
+ displacement: distanceFilter
57
+ }));
58
+ }
59
+ };
60
+
61
+ /**
62
+ * Stops tracking background location
63
+ * @param options - Options for stopping location tracking
64
+ */
65
+ export const stop = (options: Record<string, any> = {}): void => {
66
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
67
+ deRegisterCbByKey("LOCATION_UPDATE");
68
+
69
+ if (platform === "IOS_APP" && webToNativeIos) {
70
+ webToNativeIos.postMessage({
71
+ action: "stopLocation",
72
+ } as BackgroundLocationIosMessage);
73
+ }
74
+
75
+ platform === "ANDROID_APP" &&
76
+ webToNative.stopTrackingLocation();
77
+ }
78
+ };
@@ -0,0 +1,34 @@
1
+ export interface LocationUpdateResponse {
2
+ type: string;
3
+ latitude?: number;
4
+ longitude?: number;
5
+ [key: string]: any;
6
+ }
7
+
8
+ export interface LocationCallback {
9
+ (response: LocationUpdateResponse): void;
10
+ }
11
+
12
+ export interface BackgroundLocationOptions {
13
+ data?: any;
14
+ callback?: LocationCallback;
15
+ backgroundIndicator?: boolean;
16
+ pauseAutomatically?: boolean;
17
+ distanceFilter?: number;
18
+ desiredAccuracy?: 'best' | 'bestForNavigation' | 'nearestTenMeters' | 'hundredMeters' | 'kilometer' | 'threeKilometers';
19
+ activityType?: 'other' | 'automotiveNavigation' | 'fitness' | 'otherNavigation';
20
+ apiUrl?: string;
21
+ timeout?: number;
22
+ }
23
+
24
+ export interface BackgroundLocationIosMessage {
25
+ action: string;
26
+ data?: any;
27
+ backgroundIndicator?: boolean;
28
+ pauseAutomatically?: boolean;
29
+ distanceFilter?: number;
30
+ desiredAccuracy?: string;
31
+ activityType?: string;
32
+ apiUrl?: string;
33
+ timeout?: number;
34
+ }
@@ -0,0 +1,28 @@
1
+ import { platform, registerCb, webToNative, webToNativeIos } from "../utills";
2
+ import { BeaconOptions, BeaconResponse, BeaconIosMessage } from "./types";
3
+
4
+ /**
5
+ * Initializes beacon data
6
+ * @param options - Options for initializing beacon data
7
+ */
8
+ export const initBeaconData = (options: BeaconOptions = {}): void => {
9
+ const { callback, beaconData } = options;
10
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
11
+ registerCb((response: BeaconResponse) => {
12
+ const { type } = response;
13
+ if (type === "initBeaconData") {
14
+ callback && callback(response);
15
+ }
16
+ });
17
+
18
+ platform === "ANDROID_APP" &&
19
+ webToNative.initBeaconData(JSON.stringify(beaconData));
20
+
21
+ if (platform === "IOS_APP" && webToNativeIos) {
22
+ webToNativeIos.postMessage({
23
+ action: "initBeaconData",
24
+ data: beaconData
25
+ } as BeaconIosMessage);
26
+ }
27
+ }
28
+ };
@@ -0,0 +1,22 @@
1
+ export interface BeaconResponse {
2
+ type: string;
3
+ [key: string]: any;
4
+ }
5
+
6
+ export interface BeaconCallback {
7
+ (response: BeaconResponse): void;
8
+ }
9
+
10
+ export interface BeaconData {
11
+ [key: string]: any;
12
+ }
13
+
14
+ export interface BeaconOptions {
15
+ callback?: BeaconCallback;
16
+ beaconData?: BeaconData;
17
+ }
18
+
19
+ export interface BeaconIosMessage {
20
+ action: string;
21
+ data?: BeaconData;
22
+ }
@@ -0,0 +1,126 @@
1
+ import { platform, registerCb, webToNative, webToNativeIos } from "../utills";
2
+ import { BiometricOptions, BiometricResponse, BiometricIosMessage, BiometricAuthOptions } from "./types";
3
+
4
+ /**
5
+ * Checks the status of biometric authentication
6
+ * @param options - Options for checking biometric status
7
+ */
8
+ export const checkStatus = (options: BiometricOptions = {}): void => {
9
+ const { callback } = options;
10
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
11
+ registerCb((response: BiometricResponse) => {
12
+ const { type } = response;
13
+ if (type === "checkBiometricStatus") {
14
+ callback && callback(response);
15
+ }
16
+ });
17
+
18
+ platform === "ANDROID_APP" &&
19
+ webToNative.checkBiometricStatus();
20
+
21
+ if (platform === "IOS_APP" && webToNativeIos) {
22
+ webToNativeIos.postMessage({
23
+ action: "checkBiometricStatus",
24
+ } as BiometricIosMessage);
25
+ }
26
+ }
27
+ };
28
+
29
+ /**
30
+ * Saves a secret using biometric authentication
31
+ * @param options - Options for saving biometric secret
32
+ */
33
+ export const saveSecret = (options: BiometricOptions = {}): void => {
34
+ const { callback, secret } = options;
35
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
36
+ registerCb((response: BiometricResponse) => {
37
+ const { type } = response;
38
+ if (type === "saveBiometricSecret") {
39
+ callback && callback(response);
40
+ }
41
+ });
42
+
43
+ platform === "ANDROID_APP" &&
44
+ webToNative.saveSecret(secret);
45
+
46
+ if (platform === "IOS_APP" && webToNativeIos) {
47
+ webToNativeIos.postMessage({
48
+ action: "saveBiometricSecret",
49
+ secret
50
+ } as BiometricIosMessage);
51
+ }
52
+ }
53
+ };
54
+
55
+ /**
56
+ * Deletes a saved biometric secret
57
+ * @param options - Options for deleting biometric secret
58
+ */
59
+ export const deleteSecret = (options: BiometricOptions = {}): void => {
60
+ const { callback } = options;
61
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
62
+ registerCb((response: BiometricResponse) => {
63
+ const { type } = response;
64
+ if (type === "deleteBiometricSecret") {
65
+ callback && callback(response);
66
+ }
67
+ });
68
+
69
+ platform === "ANDROID_APP" &&
70
+ webToNative.deleteSecret();
71
+
72
+ if (platform === "IOS_APP" && webToNativeIos) {
73
+ webToNativeIos.postMessage({
74
+ action: "deleteBiometricSecret",
75
+ } as BiometricIosMessage);
76
+ }
77
+ }
78
+ };
79
+
80
+ /**
81
+ * Shows biometric authentication prompt
82
+ * @param options - Options for showing biometric prompt
83
+ */
84
+ export const show = (options: BiometricOptions = {}): void => {
85
+ const { callback, prompt } = options;
86
+ if (["ANDROID_APP", "IOS_APP"].includes(platform)) {
87
+ registerCb((response: BiometricResponse) => {
88
+ const { type } = response;
89
+ if (type === "showBiometric") {
90
+ callback && callback(response);
91
+ }
92
+ });
93
+
94
+ platform === "ANDROID_APP" &&
95
+ webToNative.callBiometric(prompt || "Authenticate to continue!");
96
+
97
+ if (platform === "IOS_APP" && webToNativeIos) {
98
+ webToNativeIos.postMessage({
99
+ action: "showBiometric",
100
+ prompt: prompt || '',
101
+ } as BiometricIosMessage);
102
+ }
103
+ }
104
+ };
105
+
106
+ /**
107
+ * Shows biometric authentication with dismiss on cancel (Android only)
108
+ * @param options - Options for biometric authentication with dismiss on cancel
109
+ */
110
+ export const biometricAuthWithDismissOnCancel = (options: BiometricOptions = {}): void => {
111
+ const { callback, prompt, isAuthenticationOptional = false } = options;
112
+ if (["ANDROID_APP"].includes(platform)) {
113
+ registerCb((response: BiometricResponse) => {
114
+ const { type } = response;
115
+ if (type === "biometricAuthWithDismissOnCancel") {
116
+ callback && callback(response);
117
+ }
118
+ });
119
+
120
+ platform === "ANDROID_APP" &&
121
+ webToNative.biometricAuthWithDismissOnCancel(JSON.stringify({
122
+ prompt: prompt || "Authenticate to continue!",
123
+ isAuthenticationOptional
124
+ } as BiometricAuthOptions));
125
+ }
126
+ };