react-native-netmera 1.11.3 → 2.0.0-alpha02

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 (280) hide show
  1. package/README.md +109 -120
  2. package/RNNetmera.podspec +31 -14
  3. package/android/build.gradle +83 -19
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +0 -5
  6. package/android/src/main/AndroidManifestNew.xml +5 -0
  7. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmera.kt +24 -0
  8. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraCategoryObject.kt +54 -0
  9. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraConfiguration.kt +108 -0
  10. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraEvent.kt +24 -0
  11. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraModule.kt +694 -0
  12. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraPackage.kt +17 -0
  13. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraPushBroadcastReceiver.kt +81 -0
  14. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraPushHeadlessService.kt +32 -0
  15. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraUtil.kt +218 -0
  16. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraWebWidgetCallbacks.kt +25 -0
  17. package/ios/AnyCodable/AnyCodable.swift +151 -0
  18. package/ios/AnyCodable/AnyDecodable.swift +192 -0
  19. package/ios/AnyCodable/AnyEncodable.swift +295 -0
  20. package/ios/RNNetmera-Bridging-Header.h +3 -0
  21. package/ios/RNNetmera.h +9 -29
  22. package/ios/RNNetmera.mm +143 -0
  23. package/ios/RNNetmera.swift +759 -0
  24. package/ios/RNNetmeraCategoryObject.swift +61 -0
  25. package/ios/RNNetmeraEvent.swift +26 -0
  26. package/ios/RNNetmeraPushLifecycleDelegate.swift +47 -0
  27. package/ios/RNNetmeraRCTEventEmitter.mm +8 -0
  28. package/ios/RNNetmeraRCTEventEmitter.swift +134 -0
  29. package/ios/RNNetmeraUtils.swift +233 -0
  30. package/lib/module/Netmera.js +256 -0
  31. package/lib/module/Netmera.js.map +1 -0
  32. package/lib/module/events/NetmeraEvent.js +8 -0
  33. package/lib/module/events/NetmeraEvent.js.map +1 -0
  34. package/lib/module/events/NetmeraEventBannerOpen.js +13 -0
  35. package/lib/module/events/NetmeraEventBannerOpen.js.map +1 -0
  36. package/lib/module/events/NetmeraEventBatteryLevel.js +10 -0
  37. package/lib/module/events/NetmeraEventBatteryLevel.js.map +1 -0
  38. package/lib/module/events/NetmeraEventCategoryView.js +13 -0
  39. package/lib/module/events/NetmeraEventCategoryView.js.map +1 -0
  40. package/lib/module/events/NetmeraEventInAppPurchase.js +28 -0
  41. package/lib/module/events/NetmeraEventInAppPurchase.js.map +1 -0
  42. package/lib/module/events/NetmeraEventLogin.js +10 -0
  43. package/lib/module/events/NetmeraEventLogin.js.map +1 -0
  44. package/lib/module/events/NetmeraEventRegister.js +10 -0
  45. package/lib/module/events/NetmeraEventRegister.js.map +1 -0
  46. package/lib/module/events/NetmeraEventScreenView.js +22 -0
  47. package/lib/module/events/NetmeraEventScreenView.js.map +1 -0
  48. package/lib/module/events/NetmeraEventSearch.js +13 -0
  49. package/lib/module/events/NetmeraEventSearch.js.map +1 -0
  50. package/lib/module/events/NetmeraEventShare.js +13 -0
  51. package/lib/module/events/NetmeraEventShare.js.map +1 -0
  52. package/lib/module/events/commerce/NetmeraEventCartAddProduct.js +13 -0
  53. package/lib/module/events/commerce/NetmeraEventCartAddProduct.js.map +1 -0
  54. package/lib/module/events/commerce/NetmeraEventCartRemoveProduct.js +10 -0
  55. package/lib/module/events/commerce/NetmeraEventCartRemoveProduct.js.map +1 -0
  56. package/lib/module/events/commerce/NetmeraEventCartView.js +13 -0
  57. package/lib/module/events/commerce/NetmeraEventCartView.js.map +1 -0
  58. package/lib/module/events/commerce/NetmeraEventOrderCancel.js +19 -0
  59. package/lib/module/events/commerce/NetmeraEventOrderCancel.js.map +1 -0
  60. package/lib/module/events/commerce/NetmeraEventProductComment.js +7 -0
  61. package/lib/module/events/commerce/NetmeraEventProductComment.js.map +1 -0
  62. package/lib/module/events/commerce/NetmeraEventProductRate.js +10 -0
  63. package/lib/module/events/commerce/NetmeraEventProductRate.js.map +1 -0
  64. package/lib/module/events/commerce/NetmeraEventProductView.js +7 -0
  65. package/lib/module/events/commerce/NetmeraEventProductView.js.map +1 -0
  66. package/lib/module/events/commerce/NetmeraEventPurchase.js +34 -0
  67. package/lib/module/events/commerce/NetmeraEventPurchase.js.map +1 -0
  68. package/lib/module/events/commerce/NetmeraEventWishList.js +7 -0
  69. package/lib/module/events/commerce/NetmeraEventWishList.js.map +1 -0
  70. package/lib/module/events/commerce/NetmeraLineItem.js +9 -0
  71. package/lib/module/events/commerce/NetmeraLineItem.js.map +1 -0
  72. package/lib/module/events/commerce/NetmeraProduct.js +46 -0
  73. package/lib/module/events/commerce/NetmeraProduct.js.map +1 -0
  74. package/lib/module/events/media/NetmeraEventContent.js +42 -0
  75. package/lib/module/events/media/NetmeraEventContent.js.map +1 -0
  76. package/lib/module/events/media/NetmeraEventContentComment.js +7 -0
  77. package/lib/module/events/media/NetmeraEventContentComment.js.map +1 -0
  78. package/lib/module/events/media/NetmeraEventContentRate.js +10 -0
  79. package/lib/module/events/media/NetmeraEventContentRate.js.map +1 -0
  80. package/lib/module/events/media/NetmeraEventContentView.js +7 -0
  81. package/lib/module/events/media/NetmeraEventContentView.js.map +1 -0
  82. package/lib/module/index.js +43 -0
  83. package/lib/module/index.js.map +1 -0
  84. package/lib/module/models/NMCategoryPreference.js +8 -0
  85. package/lib/module/models/NMCategoryPreference.js.map +1 -0
  86. package/lib/module/models/NMInboxStatus.js +11 -0
  87. package/lib/module/models/NMInboxStatus.js.map +1 -0
  88. package/lib/module/models/NMInboxStatusCountFilter.js +12 -0
  89. package/lib/module/models/NMInboxStatusCountFilter.js.map +1 -0
  90. package/lib/module/models/NetmeraCategory.js +8 -0
  91. package/lib/module/models/NetmeraCategory.js.map +1 -0
  92. package/lib/module/models/NetmeraCategoryFilter.js +8 -0
  93. package/lib/module/models/NetmeraCategoryFilter.js.map +1 -0
  94. package/lib/module/models/NetmeraCouponObject.js +8 -0
  95. package/lib/module/models/NetmeraCouponObject.js.map +1 -0
  96. package/lib/module/models/NetmeraInbox.js +8 -0
  97. package/lib/module/models/NetmeraInbox.js.map +1 -0
  98. package/lib/module/models/NetmeraInboxFilter.js +8 -0
  99. package/lib/module/models/NetmeraInboxFilter.js.map +1 -0
  100. package/lib/module/models/NetmeraProfileAttribute.js +75 -0
  101. package/lib/module/models/NetmeraProfileAttribute.js.map +1 -0
  102. package/lib/module/models/NetmeraUser.js +89 -0
  103. package/lib/module/models/NetmeraUser.js.map +1 -0
  104. package/lib/module/models/NetmeraUserProfile.js +58 -0
  105. package/lib/module/models/NetmeraUserProfile.js.map +1 -0
  106. package/lib/module/models/NotificationPermissionStatus.js +10 -0
  107. package/lib/module/models/NotificationPermissionStatus.js.map +1 -0
  108. package/lib/module/package.json +1 -0
  109. package/lib/module/utils/DeviceUtils.js +10 -0
  110. package/lib/module/utils/DeviceUtils.js.map +1 -0
  111. package/lib/module/utils/Optional.js +32 -0
  112. package/lib/module/utils/Optional.js.map +1 -0
  113. package/lib/module/utils/RNNetmera.js +16 -0
  114. package/lib/module/utils/RNNetmera.js.map +1 -0
  115. package/lib/typescript/package.json +1 -0
  116. package/lib/typescript/src/Netmera.d.ts +70 -0
  117. package/lib/typescript/src/Netmera.d.ts.map +1 -0
  118. package/lib/typescript/src/events/NetmeraEvent.d.ts +5 -0
  119. package/lib/typescript/src/events/NetmeraEvent.d.ts.map +1 -0
  120. package/lib/typescript/src/events/NetmeraEventBannerOpen.d.ts +9 -0
  121. package/lib/typescript/src/events/NetmeraEventBannerOpen.d.ts.map +1 -0
  122. package/lib/typescript/src/events/NetmeraEventBatteryLevel.d.ts +7 -0
  123. package/lib/typescript/src/events/NetmeraEventBatteryLevel.d.ts.map +1 -0
  124. package/lib/typescript/src/events/NetmeraEventCategoryView.d.ts +9 -0
  125. package/lib/typescript/src/events/NetmeraEventCategoryView.d.ts.map +1 -0
  126. package/lib/typescript/src/events/NetmeraEventInAppPurchase.d.ts +19 -0
  127. package/lib/typescript/src/events/NetmeraEventInAppPurchase.d.ts.map +1 -0
  128. package/lib/typescript/src/events/NetmeraEventLogin.d.ts +7 -0
  129. package/lib/typescript/src/events/NetmeraEventLogin.d.ts.map +1 -0
  130. package/lib/typescript/src/events/NetmeraEventRegister.d.ts +7 -0
  131. package/lib/typescript/src/events/NetmeraEventRegister.d.ts.map +1 -0
  132. package/lib/typescript/src/events/NetmeraEventScreenView.d.ts +15 -0
  133. package/lib/typescript/src/events/NetmeraEventScreenView.d.ts.map +1 -0
  134. package/lib/typescript/src/events/NetmeraEventSearch.d.ts +9 -0
  135. package/lib/typescript/src/events/NetmeraEventSearch.d.ts.map +1 -0
  136. package/lib/typescript/src/events/NetmeraEventShare.d.ts +9 -0
  137. package/lib/typescript/src/events/NetmeraEventShare.d.ts.map +1 -0
  138. package/lib/typescript/src/events/commerce/NetmeraEventCartAddProduct.d.ts +9 -0
  139. package/lib/typescript/src/events/commerce/NetmeraEventCartAddProduct.d.ts.map +1 -0
  140. package/lib/typescript/src/events/commerce/NetmeraEventCartRemoveProduct.d.ts +7 -0
  141. package/lib/typescript/src/events/commerce/NetmeraEventCartRemoveProduct.d.ts.map +1 -0
  142. package/lib/typescript/src/events/commerce/NetmeraEventCartView.d.ts +9 -0
  143. package/lib/typescript/src/events/commerce/NetmeraEventCartView.d.ts.map +1 -0
  144. package/lib/typescript/src/events/commerce/NetmeraEventOrderCancel.d.ts +13 -0
  145. package/lib/typescript/src/events/commerce/NetmeraEventOrderCancel.d.ts.map +1 -0
  146. package/lib/typescript/src/events/commerce/NetmeraEventProductComment.d.ts +5 -0
  147. package/lib/typescript/src/events/commerce/NetmeraEventProductComment.d.ts.map +1 -0
  148. package/lib/typescript/src/events/commerce/NetmeraEventProductRate.d.ts +7 -0
  149. package/lib/typescript/src/events/commerce/NetmeraEventProductRate.d.ts.map +1 -0
  150. package/lib/typescript/src/events/commerce/NetmeraEventProductView.d.ts +5 -0
  151. package/lib/typescript/src/events/commerce/NetmeraEventProductView.d.ts.map +1 -0
  152. package/lib/typescript/src/events/commerce/NetmeraEventPurchase.d.ts +24 -0
  153. package/lib/typescript/src/events/commerce/NetmeraEventPurchase.d.ts.map +1 -0
  154. package/lib/typescript/src/events/commerce/NetmeraEventWishList.d.ts +5 -0
  155. package/lib/typescript/src/events/commerce/NetmeraEventWishList.d.ts.map +1 -0
  156. package/lib/typescript/src/events/commerce/NetmeraLineItem.d.ts +6 -0
  157. package/lib/typescript/src/events/commerce/NetmeraLineItem.d.ts.map +1 -0
  158. package/lib/typescript/src/events/commerce/NetmeraProduct.d.ts +23 -0
  159. package/lib/typescript/src/events/commerce/NetmeraProduct.d.ts.map +1 -0
  160. package/lib/typescript/src/events/media/NetmeraEventContent.d.ts +23 -0
  161. package/lib/typescript/src/events/media/NetmeraEventContent.d.ts.map +1 -0
  162. package/lib/typescript/src/events/media/NetmeraEventContentComment.d.ts +5 -0
  163. package/lib/typescript/src/events/media/NetmeraEventContentComment.d.ts.map +1 -0
  164. package/lib/typescript/src/events/media/NetmeraEventContentRate.d.ts +7 -0
  165. package/lib/typescript/src/events/media/NetmeraEventContentRate.d.ts.map +1 -0
  166. package/lib/typescript/src/events/media/NetmeraEventContentView.d.ts +5 -0
  167. package/lib/typescript/src/events/media/NetmeraEventContentView.d.ts.map +1 -0
  168. package/lib/typescript/src/index.d.ts +39 -0
  169. package/lib/typescript/src/index.d.ts.map +1 -0
  170. package/lib/typescript/src/models/NMCategoryPreference.d.ts +6 -0
  171. package/lib/typescript/src/models/NMCategoryPreference.d.ts.map +1 -0
  172. package/lib/typescript/src/models/NMInboxStatus.d.ts +8 -0
  173. package/lib/typescript/src/models/NMInboxStatus.d.ts.map +1 -0
  174. package/lib/typescript/src/models/NMInboxStatusCountFilter.d.ts +7 -0
  175. package/lib/typescript/src/models/NMInboxStatusCountFilter.d.ts.map +1 -0
  176. package/lib/typescript/src/models/NetmeraCategory.d.ts +10 -0
  177. package/lib/typescript/src/models/NetmeraCategory.d.ts.map +1 -0
  178. package/lib/typescript/src/models/NetmeraCategoryFilter.d.ts +6 -0
  179. package/lib/typescript/src/models/NetmeraCategoryFilter.d.ts.map +1 -0
  180. package/lib/typescript/src/models/NetmeraCouponObject.d.ts +8 -0
  181. package/lib/typescript/src/models/NetmeraCouponObject.d.ts.map +1 -0
  182. package/lib/typescript/src/models/NetmeraInbox.d.ts +22 -0
  183. package/lib/typescript/src/models/NetmeraInbox.d.ts.map +1 -0
  184. package/lib/typescript/src/models/NetmeraInboxFilter.d.ts +7 -0
  185. package/lib/typescript/src/models/NetmeraInboxFilter.d.ts.map +1 -0
  186. package/lib/typescript/src/models/NetmeraProfileAttribute.d.ts +33 -0
  187. package/lib/typescript/src/models/NetmeraProfileAttribute.d.ts.map +1 -0
  188. package/lib/typescript/src/models/NetmeraUser.d.ts +25 -0
  189. package/lib/typescript/src/models/NetmeraUser.d.ts.map +1 -0
  190. package/lib/typescript/src/models/NetmeraUserProfile.d.ts +21 -0
  191. package/lib/typescript/src/models/NetmeraUserProfile.d.ts.map +1 -0
  192. package/lib/typescript/src/models/NotificationPermissionStatus.d.ts +7 -0
  193. package/lib/typescript/src/models/NotificationPermissionStatus.d.ts.map +1 -0
  194. package/lib/typescript/src/utils/DeviceUtils.d.ts +3 -0
  195. package/lib/typescript/src/utils/DeviceUtils.d.ts.map +1 -0
  196. package/lib/typescript/src/utils/Optional.d.ts +15 -0
  197. package/lib/typescript/src/utils/Optional.d.ts.map +1 -0
  198. package/lib/typescript/src/utils/RNNetmera.d.ts +5 -0
  199. package/lib/typescript/src/utils/RNNetmera.d.ts.map +1 -0
  200. package/package.json +104 -17
  201. package/src/Netmera.ts +139 -88
  202. package/src/events/NetmeraEvent.ts +1 -1
  203. package/src/events/NetmeraEventBannerOpen.ts +4 -4
  204. package/src/events/NetmeraEventBatteryLevel.ts +3 -3
  205. package/src/events/NetmeraEventCategoryView.ts +4 -4
  206. package/src/events/NetmeraEventInAppPurchase.ts +10 -10
  207. package/src/events/NetmeraEventLogin.ts +3 -3
  208. package/src/events/NetmeraEventRegister.ts +3 -3
  209. package/src/events/NetmeraEventScreenView.ts +7 -7
  210. package/src/events/NetmeraEventSearch.ts +4 -4
  211. package/src/events/NetmeraEventShare.ts +4 -4
  212. package/src/events/commerce/NetmeraEventCartAddProduct.ts +4 -4
  213. package/src/events/commerce/NetmeraEventCartRemoveProduct.ts +3 -3
  214. package/src/events/commerce/NetmeraEventCartView.ts +4 -4
  215. package/src/events/commerce/NetmeraEventOrderCancel.ts +6 -6
  216. package/src/events/commerce/NetmeraEventProductComment.ts +2 -2
  217. package/src/events/commerce/NetmeraEventProductRate.ts +3 -3
  218. package/src/events/commerce/NetmeraEventProductView.ts +2 -2
  219. package/src/events/commerce/NetmeraEventPurchase.ts +13 -13
  220. package/src/events/commerce/NetmeraEventWishList.ts +2 -2
  221. package/src/events/commerce/NetmeraLineItem.ts +2 -2
  222. package/src/events/commerce/NetmeraProduct.ts +10 -10
  223. package/src/events/media/NetmeraEventContent.ts +8 -8
  224. package/src/events/media/NetmeraEventContentComment.ts +2 -2
  225. package/src/events/media/NetmeraEventContentRate.ts +3 -3
  226. package/src/events/media/NetmeraEventContentView.ts +2 -2
  227. package/src/index.ts +87 -0
  228. package/src/models/NMCategoryPreference.ts +1 -1
  229. package/src/models/NMInboxStatusCountFilter.ts +1 -1
  230. package/src/models/NetmeraCategory.ts +2 -2
  231. package/src/models/NetmeraCategoryFilter.ts +1 -1
  232. package/src/models/NetmeraCouponObject.ts +1 -1
  233. package/src/models/NetmeraInbox.ts +1 -1
  234. package/src/models/NetmeraInboxFilter.ts +1 -1
  235. package/src/models/NetmeraProfileAttribute.ts +81 -0
  236. package/src/models/NetmeraUser.ts +76 -74
  237. package/src/models/NetmeraUserProfile.ts +67 -0
  238. package/src/models/NotificationPermissionStatus.ts +4 -4
  239. package/src/utils/DeviceUtils.ts +3 -3
  240. package/src/utils/Optional.ts +31 -0
  241. package/src/utils/RNNetmera.ts +24 -0
  242. package/.eslintignore +0 -7
  243. package/.gitattributes +0 -1
  244. package/.github/workflows/code_quality_check.yaml +0 -38
  245. package/.prettierignore +0 -14
  246. package/.yarnrc.yml +0 -1
  247. package/android/.project +0 -17
  248. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  249. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  250. package/android/gradlew +0 -172
  251. package/android/gradlew.bat +0 -84
  252. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmera.java +0 -24
  253. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraCategoryObject.java +0 -56
  254. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraConfiguration.java +0 -154
  255. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraEvent.java +0 -36
  256. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraModule.java +0 -631
  257. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraPackage.java +0 -35
  258. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraPushBroadcastReceiver.java +0 -86
  259. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraPushHeadlessService.java +0 -32
  260. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraUser.java +0 -24
  261. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraUtil.java +0 -354
  262. package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraWebWidgetCallbacks.java +0 -27
  263. package/index.ts +0 -80
  264. package/ios/RNNetmera.m +0 -507
  265. package/ios/RNNetmera.xcodeproj/project.pbxproj +0 -316
  266. package/ios/RNNetmera.xcodeproj/xcshareddata/xcschemes/RNNetmera.xcscheme +0 -67
  267. package/ios/RNNetmera.xcworkspace/contents.xcworkspacedata +0 -9
  268. package/ios/RNNetmeraCategoryObject.h +0 -16
  269. package/ios/RNNetmeraCategoryObject.m +0 -59
  270. package/ios/RNNetmeraEvent.h +0 -17
  271. package/ios/RNNetmeraEvent.m +0 -27
  272. package/ios/RNNetmeraRCTEventEmitter.h +0 -23
  273. package/ios/RNNetmeraRCTEventEmitter.m +0 -142
  274. package/ios/RNNetmeraUser.h +0 -15
  275. package/ios/RNNetmeraUser.m +0 -19
  276. package/ios/RNNetmeraUtils.h +0 -27
  277. package/ios/RNNetmeraUtils.m +0 -128
  278. package/scripts/update-version.js +0 -38
  279. package/scripts/yarn_rebuild.sh +0 -31
  280. package/tsconfig.json +0 -3
@@ -1,631 +0,0 @@
1
- //
2
- // RNNetmeraModule.java
3
- //
4
- // Created by Initial Code
5
- // Copyright © 2019 Netmera. All rights reserved.
6
- //
7
-
8
- package com.netmera.reactnativesdk;
9
-
10
- import android.app.Activity;
11
- import android.os.Bundle;
12
- import android.util.Log;
13
-
14
- import androidx.annotation.NonNull;
15
- import androidx.annotation.Nullable;
16
-
17
- import com.facebook.react.bridge.Promise;
18
- import com.facebook.react.bridge.ReactApplicationContext;
19
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
20
- import com.facebook.react.bridge.ReactMethod;
21
- import com.facebook.react.bridge.ReadableMap;
22
- import com.facebook.react.modules.core.DeviceEventManagerModule;
23
- import com.netmera.Netmera;
24
- import com.netmera.NetmeraCategory;
25
- import com.netmera.NetmeraError;
26
- import com.netmera.NetmeraInbox;
27
- import com.netmera.NetmeraInboxCategory;
28
- import com.netmera.NetmeraInboxFilter;
29
- import com.netmera.NetmeraInteractiveAction;
30
- import com.netmera.NetmeraPushObject;
31
- import com.netmera.callbacks.NMCategoryPreferenceFetchCallback;
32
- import com.netmera.callbacks.NMCategoryPreferenceSetCallback;
33
- import com.netmera.callbacks.NMFetchCouponsResultListener;
34
- import com.netmera.callbacks.NMInboxCountResultListener;
35
- import com.netmera.callbacks.NMUpdateUserListener;
36
- import com.netmera.data.NMCategoryPreference;
37
- import com.netmera.data.NMCouponDetail;
38
- import com.netmera.data.NMInboxStatusCount;
39
- import com.netmera.data.NMInboxStatusCountFilter;
40
-
41
- import java.util.ArrayList;
42
- import java.util.Collections;
43
- import java.util.HashMap;
44
- import java.util.List;
45
- import java.util.Map;
46
-
47
- public class RNNetmeraModule extends ReactContextBaseJavaModule {
48
- private static final String USER_ID = "userId";
49
- private static final String EMAIL = "email";
50
- private static final String MSISDN = "msisdn";
51
- private static final String CODE = "code";
52
- private static final String CATEGORIES = "categories";
53
- private static final String CATEGORY_LIST = "categoryList";
54
- private static final String PAGE_SIZE = "pageSize";
55
- private static final String REVENUE = "revenue";
56
- private static final String INCLUDE_EXPIRED_OBJECTS = "includeExpiredObjects";
57
- private static final String STATUS = "status";
58
- private static final String ERROR_CODE_NULL_INBOX = "2017";
59
- private static final String ERROR_MESSAGE_NULL_INBOX = "Must call fetchInbox method first";
60
- private static final String ERROR_CODE_NOT_NEXT_PAGE = "2018";
61
- private static final String ERROR_MESSAGE_NOT_NEXT_PAGE = "Not next page";
62
- private static final String ERROR_CODE_UPDATE_STATUS = "2019";
63
- private static final String ERROR_MESSAGE_UPDATE_STATUS = "There was a problem updating status";
64
- private static final String ERROR_CODE_NULL_CATEGORY = "2020";
65
- private static final String ERROR_MESSAGE_NULL_CATEGORY = "Must call fetchCategory method first";
66
- private static final String ERROR_CODE_INVALID_PUSH_OBJECT = "2021";
67
- private static final String ERROR_MESSAGE_INVALID_PUSH_OBJECT = "Received NetmeraPushObject was not valid.";
68
- private static final String ERROR_CODE_NULL_INBOX_STATUS = "2022";
69
- private static final String ERROR_MESSAGE_NULL_INBOX_STATUS = "Inbox status can't be null.";
70
- private static final String ERROR_CODE_INBOX_STATUS = "2023";
71
- private static final String ERROR_MESSAGE_INBOX_STATUS = "Error occurred while fetching inbox count for status.";
72
- private static final String ERROR_CODE_CATEGORY_PREFERENCE = "2024";
73
- private static final String ERROR_MESSAGE_CATEGORY_PREFERENCE = "Error occurred while fetching user category preference list.";
74
- private static final String ERROR_CODE_SET_CATEGORY_PREFERENCE = "2025";
75
- private static final String ERROR_MESSAGE_SET_CATEGORY_PREFERENCE = "Error occurred while setting user category preference list.";
76
- private static final String ERROR_CODE_COUPON_FETCH = "2026";
77
- private static final String ERROR_MESSAGE_COUPON_FETCH = "Error occurred while fetching coupons.";
78
- private static final String ERROR_CODE_UPDATE_USER = "2027";
79
- private static final String ERROR_MESSAGE_UPDATE_USER = "Error occurred while updating user. Reason: ";
80
-
81
-
82
- public static ReactApplicationContext reactContext;
83
- private NetmeraInbox netmeraInbox;
84
- private NetmeraInboxCategory netmeraInboxCategory;
85
-
86
- public RNNetmeraModule(ReactApplicationContext reactContext) {
87
- super(reactContext);
88
- RNNetmeraModule.reactContext = reactContext;
89
- }
90
-
91
- @NonNull
92
- @Override
93
- public String getName() {
94
- return "RNNetmera";
95
- }
96
-
97
- @ReactMethod
98
- public void currentExternalId(final Promise promise) {
99
- promise.resolve(Netmera.getCurrentExternalId());
100
- }
101
-
102
- @ReactMethod
103
- public void setBaseUrl(final String baseUrl) {
104
- Netmera.setBaseUrl(baseUrl);
105
- }
106
-
107
- @ReactMethod
108
- public void skipAppConfigAndSetBaseUrl(final String baseUrl) {
109
- Netmera.skipAppConfigAndSetBaseUrl(baseUrl);
110
- }
111
-
112
- @ReactMethod(isBlockingSynchronousMethod = true)
113
- public Boolean areNotificationsEnabled() {
114
- return Netmera.areNotificationsEnabled();
115
- }
116
-
117
- @ReactMethod(isBlockingSynchronousMethod = true)
118
- public String checkNotificationPermission() {
119
- Activity activity = getCurrentActivity();
120
- if (activity != null) {
121
- return Netmera.checkNotificationPermission(activity).toString();
122
- } else {
123
- Log.e("NETMERA", "Cannot call checkNotificationPermission because current ReactActivity is null");
124
- return "null";
125
- }
126
- }
127
-
128
- @ReactMethod
129
- public void requestPushNotificationAuthorization() {
130
- Activity activity = getCurrentActivity();
131
- if (activity != null) {
132
- Netmera.requestNotificationPermissions(activity);
133
- } else {
134
- Log.e("NETMERA", "Cannot call requestNotificationPermissions because current ReactActivity is null");
135
- }
136
- }
137
-
138
- @ReactMethod
139
- public void requestPermissionsForLocation() {
140
- Netmera.requestPermissionsForLocation();
141
- }
142
-
143
- @ReactMethod
144
- public void setNetmeraMaxActiveRegions(int maxActiveRegions) {
145
- Netmera.setNetmeraMaxActiveRegions(maxActiveRegions);
146
- }
147
-
148
- @ReactMethod
149
- public void enablePopupPresentation() {
150
- Netmera.enablePopupPresentation();
151
- }
152
-
153
- @ReactMethod
154
- public void disablePopupPresentation() {
155
- Netmera.disablePopupPresentation();
156
- }
157
-
158
- @ReactMethod
159
- public void enablePush() {
160
- Netmera.enablePush();
161
- }
162
-
163
- @ReactMethod
164
- public void disablePush() {
165
- Netmera.disablePush();
166
- }
167
-
168
- @ReactMethod
169
- public void isPushEnabled(Promise promise) {
170
- promise.resolve(Netmera.isPushEnabled());
171
- }
172
-
173
- @ReactMethod
174
- public void turnOffSendingEventAndUserUpdate(final Boolean turnOff) {
175
- Netmera.turnOffSendingEventAndUserUpdate(turnOff);
176
- }
177
-
178
- @ReactMethod
179
- public void kill() {
180
- Netmera.kill();
181
- }
182
-
183
- @ReactMethod
184
- public void fetchCoupons(final int page, final int max, final Promise promise) {
185
- Netmera.fetchCoupons(page, max, new NMFetchCouponsResultListener() {
186
-
187
- @Override
188
- public void onSuccess(@Nullable List<NMCouponDetail> list) {
189
- promise.resolve(RNNetmeraUtil.mapCouponObjects(list));
190
- }
191
-
192
- @Override
193
- public void onFailure(@Nullable String s) {
194
- promise.reject(ERROR_CODE_COUPON_FETCH, ERROR_MESSAGE_COUPON_FETCH);
195
- }
196
- });
197
- }
198
-
199
- @ReactMethod
200
- public void fetchInbox(ReadableMap readableMap, final Promise promise) {
201
- NetmeraInboxFilter.Builder builder = new NetmeraInboxFilter.Builder();
202
-
203
- if (hasKey(readableMap, CATEGORIES)) {
204
- Object categories = readableMap.toHashMap().get(CATEGORIES);
205
- if (categories instanceof String) {
206
- builder.categories(Collections.singletonList((String) categories));
207
- } else if (categories instanceof List) {
208
- builder.categories((List<String>) categories);
209
- }
210
- }
211
-
212
- if (hasKey(readableMap, STATUS)) {
213
- builder.status(readableMap.getInt(STATUS));
214
- }
215
-
216
- if (hasKey(readableMap, PAGE_SIZE)) {
217
- builder.pageSize(readableMap.getInt(PAGE_SIZE));
218
- }
219
-
220
- if (hasKey(readableMap, INCLUDE_EXPIRED_OBJECTS)) {
221
- builder.includeExpiredObjects(readableMap.getBoolean(INCLUDE_EXPIRED_OBJECTS));
222
- }
223
-
224
- NetmeraInboxFilter filter = builder.build();
225
-
226
- Netmera.fetchInbox(filter, new NetmeraInbox.NetmeraInboxFetchCallback() {
227
- @Override
228
- public void onFetchInbox(NetmeraInbox inbox, NetmeraError netmeraError) {
229
- setInbox(inbox, netmeraError, promise);
230
- }
231
- });
232
- }
233
-
234
- @ReactMethod
235
- public void fetchNextPage(final Promise promise) {
236
- if (netmeraInbox == null) {
237
- promise.reject(ERROR_CODE_NULL_INBOX, ERROR_MESSAGE_NULL_INBOX);
238
- return;
239
- }
240
-
241
- if (netmeraInbox.hasNextPage()) {
242
- netmeraInbox.fetchNextPage(new NetmeraInbox.NetmeraInboxFetchCallback() {
243
- @Override
244
- public void onFetchInbox(NetmeraInbox netmeraInbox, NetmeraError error) {
245
- setInbox(netmeraInbox, error, promise);
246
- }
247
- });
248
- } else {
249
- promise.reject(ERROR_CODE_NOT_NEXT_PAGE, ERROR_MESSAGE_NOT_NEXT_PAGE);
250
- }
251
- }
252
-
253
- @ReactMethod
254
- public void countForStatus(final int status, final Promise promise) {
255
- if (netmeraInbox == null) {
256
- promise.reject(ERROR_CODE_NULL_INBOX, ERROR_MESSAGE_NULL_INBOX);
257
- return;
258
- }
259
-
260
- promise.resolve(netmeraInbox.countForStatus(status));
261
- }
262
-
263
- @ReactMethod
264
- public void inboxUpdateStatus(final int fromIndex, final int toIndex, final int status, final Promise promise) {
265
- if (netmeraInbox == null) {
266
- promise.reject(ERROR_CODE_NULL_INBOX, ERROR_MESSAGE_NULL_INBOX);
267
- return;
268
- }
269
-
270
- try {
271
- List<NetmeraPushObject> pushObjects = netmeraInbox.pushObjects().subList(fromIndex, toIndex);
272
- netmeraInbox.updateStatus(pushObjects, status, new NetmeraInbox.NetmeraInboxStatusCallback() {
273
- @Override
274
- public void onSetStatusInbox(NetmeraError netmeraError) {
275
- if (netmeraError == null) {
276
- promise.resolve(null);
277
- } else {
278
- promise.reject(ERROR_CODE_UPDATE_STATUS, ERROR_MESSAGE_UPDATE_STATUS);
279
- }
280
- }
281
- });
282
- } catch (IndexOutOfBoundsException e) {
283
- promise.reject("", e.getMessage());
284
- }
285
- }
286
-
287
- @ReactMethod
288
- public void fetchCategory(ReadableMap readableMap, final Promise promise) {
289
- Netmera.fetchCategory(RNNetmeraCategoryObject.getInboxObject(readableMap), new NetmeraInboxCategory.NetmeraInboxCategoryCallback() {
290
- @Override
291
- public void onFetchCategory(NetmeraInboxCategory netmeraInboxCategory, NetmeraError netmeraError) {
292
- setCategory(netmeraInboxCategory, netmeraError, promise);
293
- }
294
- });
295
- }
296
-
297
- @ReactMethod
298
- public void fetchNextCategoryPage(final Promise promise) {
299
- if (netmeraInboxCategory == null) {
300
- promise.reject(ERROR_CODE_NULL_CATEGORY, ERROR_MESSAGE_NULL_CATEGORY);
301
- return;
302
- }
303
-
304
- if (netmeraInboxCategory.hasNextPage()) {
305
- netmeraInboxCategory.fetchNextPage(new NetmeraInboxCategory.NetmeraInboxCategoryCallback() {
306
- @Override
307
- public void onFetchCategory(NetmeraInboxCategory netmeraInboxCategory, NetmeraError netmeraError) {
308
- setCategory(netmeraInboxCategory, netmeraError, promise);
309
- }
310
- });
311
- } else {
312
- promise.reject(ERROR_CODE_NOT_NEXT_PAGE, ERROR_MESSAGE_NOT_NEXT_PAGE);
313
- }
314
- }
315
-
316
- @ReactMethod
317
- public void sendEvent(ReadableMap readableMap) {
318
- Map eventMap = RNNetmeraUtil.toMap(readableMap);
319
- RNNetmeraEvent event = new RNNetmeraEvent();
320
-
321
- if (hasKey(eventMap, CODE)) {
322
- event.setCode(readableMap.getString(CODE));
323
- eventMap.remove(CODE);
324
- }
325
-
326
- if (hasKey(eventMap, REVENUE)) {
327
- event.setRevenue(readableMap.getDouble(REVENUE));
328
- eventMap.remove(REVENUE);
329
- }
330
-
331
- event.setEventParameters(eventMap);
332
- Netmera.sendEvent(event);
333
- }
334
-
335
- @ReactMethod
336
- public void updateUser(ReadableMap readableMap, final Promise promise) {
337
- Map userMap = RNNetmeraUtil.toMap(readableMap);
338
- userMap.values().removeAll(Collections.singleton(null));
339
- RNNetmeraUser netmeraUser = new RNNetmeraUser();
340
-
341
- if (hasKey(userMap, USER_ID)) {
342
- netmeraUser.setUserId(readableMap.getString(USER_ID));
343
- userMap.remove(USER_ID);
344
- }
345
-
346
- if (hasKey(userMap, EMAIL)) {
347
- netmeraUser.setEmail(readableMap.getString(EMAIL));
348
- userMap.remove(EMAIL);
349
- }
350
-
351
- if (hasKey(userMap, MSISDN)) {
352
- netmeraUser.setMsisdn(readableMap.getString(MSISDN));
353
- userMap.remove(MSISDN);
354
- }
355
-
356
- netmeraUser.setUserParameters(userMap);
357
- Netmera.updateUser(netmeraUser, new NMUpdateUserListener() {
358
- @Override
359
- public void onSuccess() {
360
- promise.resolve(null);
361
- }
362
-
363
- @Override
364
- public void onFailure(@Nullable String s) {
365
- promise.reject(ERROR_CODE_UPDATE_USER, ERROR_MESSAGE_UPDATE_USER + s);
366
- }
367
- });
368
- }
369
-
370
- @ReactMethod
371
- public void updateUserAsync(ReadableMap readableMap) {
372
- Map userMap = RNNetmeraUtil.toMap(readableMap);
373
- userMap.values().removeAll(Collections.singleton(null));
374
- RNNetmeraUser netmeraUser = new RNNetmeraUser();
375
-
376
- if (hasKey(userMap, USER_ID)) {
377
- netmeraUser.setUserId(readableMap.getString(USER_ID));
378
- userMap.remove(USER_ID);
379
- }
380
-
381
- if (hasKey(userMap, EMAIL)) {
382
- netmeraUser.setEmail(readableMap.getString(EMAIL));
383
- userMap.remove(EMAIL);
384
- }
385
-
386
- if (hasKey(userMap, MSISDN)) {
387
- netmeraUser.setMsisdn(readableMap.getString(MSISDN));
388
- userMap.remove(MSISDN);
389
- }
390
-
391
- netmeraUser.setUserParameters(userMap);
392
- Netmera.updateUser(netmeraUser);
393
- }
394
-
395
- @ReactMethod
396
- public void handlePushObject(String pushId) {
397
- if (netmeraInbox == null) {
398
- return;
399
- }
400
-
401
- for (NetmeraPushObject pushObject : netmeraInbox.pushObjects()) {
402
- if (pushObject.getPushId().equals(pushId)) {
403
- Netmera.handlePushObject(reactContext.getCurrentActivity(), pushObject);
404
- break;
405
- }
406
- }
407
- }
408
-
409
- @ReactMethod
410
- public void handleInteractiveAction(String interactiveActionId) {
411
- if (netmeraInbox == null) {
412
- return;
413
- }
414
-
415
- for (NetmeraPushObject pushObject : netmeraInbox.pushObjects()) {
416
- if (pushObject.getInteractiveActions() != null) {
417
- for (NetmeraInteractiveAction action : pushObject.getInteractiveActions()) {
418
- if (action.getId().equals(interactiveActionId)) {
419
- Netmera.handleInteractiveAction(reactContext, action);
420
- return;
421
- }
422
- }
423
- }
424
- }
425
- }
426
-
427
- @ReactMethod
428
- public void setApiKey(String apiKey) {
429
- Netmera.setApiKey(apiKey);
430
- }
431
-
432
-
433
- @ReactMethod
434
- public void handleLastMessage(String categoryName, final Promise promise) {
435
- if (netmeraInboxCategory == null) {
436
- promise.reject(ERROR_CODE_NULL_CATEGORY, ERROR_MESSAGE_NULL_CATEGORY);
437
- return;
438
- }
439
-
440
- if (categoryName == null || categoryName.isEmpty()) {
441
- promise.reject(ERROR_CODE_INVALID_PUSH_OBJECT, ERROR_MESSAGE_INVALID_PUSH_OBJECT);
442
- return;
443
- }
444
-
445
- for (NetmeraCategory category : netmeraInboxCategory.categories()) {
446
- if (categoryName.equals(category.getCategoryName())) {
447
- Netmera.handlePushObject(reactContext.getCurrentActivity(), category.getLastMessage());
448
- break;
449
- }
450
- }
451
- }
452
-
453
- @ReactMethod
454
- public void updateStatusByCategories(final int fromIndex, final int toIndex, final int status, final Promise promise) {
455
- if (netmeraInboxCategory == null) {
456
- promise.reject(ERROR_CODE_NULL_CATEGORY, ERROR_MESSAGE_NULL_CATEGORY);
457
- return;
458
- }
459
-
460
- try {
461
- List<String> categoryNames = new ArrayList<>();
462
-
463
- for (NetmeraCategory category : netmeraInboxCategory.categories().subList(fromIndex, toIndex)) {
464
- categoryNames.add(category.getCategoryName());
465
- }
466
-
467
- Netmera.updateStatusByCategories(status, categoryNames, new NetmeraInbox.NetmeraInboxStatusCallback() {
468
- @Override
469
- public void onSetStatusInbox(NetmeraError netmeraError) {
470
- if (netmeraError == null) {
471
- promise.resolve(null);
472
- } else {
473
- promise.reject(ERROR_CODE_UPDATE_STATUS, ERROR_MESSAGE_UPDATE_STATUS);
474
- }
475
- }
476
- });
477
- } catch (IndexOutOfBoundsException e) {
478
- promise.reject("", e.getMessage());
479
- }
480
- }
481
-
482
- @ReactMethod
483
- public void updateAll(int inboxStatus, final Promise promise) {
484
- Netmera.updateAll(inboxStatus, new NetmeraInbox.NetmeraInboxStatusCallback() {
485
- @Override
486
- public void onSetStatusInbox(NetmeraError netmeraError) {
487
- if (netmeraError != null) {
488
- promise.reject(ERROR_CODE_UPDATE_STATUS, ERROR_MESSAGE_UPDATE_STATUS);
489
- } else {
490
- promise.resolve(true);
491
- }
492
- }
493
- });
494
- }
495
-
496
- private void setInbox(NetmeraInbox inbox, NetmeraError netmeraError, Promise promise) {
497
- netmeraInbox = inbox;
498
- if (netmeraError != null) {
499
- promise.reject(ERROR_CODE_NULL_INBOX, ERROR_MESSAGE_NULL_INBOX);
500
- return;
501
- }
502
- promise.resolve(RNNetmeraUtil.mapPushObjects(inbox.pushObjects()));
503
- }
504
-
505
- private void setCategory(NetmeraInboxCategory nmInboxCategory, NetmeraError netmeraError, Promise promise) {
506
- if (netmeraError != null) {
507
- promise.reject(ERROR_CODE_NULL_INBOX, ERROR_MESSAGE_NULL_INBOX);
508
- return;
509
- }
510
- netmeraInboxCategory = nmInboxCategory;
511
- promise.resolve(RNNetmeraCategoryObject.mapCategoryObjects(netmeraInboxCategory.categories()));
512
- }
513
- @ReactMethod
514
- public void getInboxCountForStatus(ReadableMap readableMap, final Promise promise) {
515
- NMInboxStatusCountFilter.Builder builder = new NMInboxStatusCountFilter.Builder();
516
- if (hasKey(readableMap, CATEGORY_LIST)) {
517
-
518
- ArrayList<Double> categoryList = (ArrayList<Double>) readableMap.toHashMap().get(CATEGORY_LIST);
519
-
520
- if (categoryList != null) {
521
- Integer[] categoryArray = new Integer[categoryList.size()];
522
- for (int i = 0; i < categoryList.size(); i++) {
523
- categoryArray[i] = categoryList.get(i).intValue();
524
- }
525
-
526
- builder.setCategoryList(categoryArray);
527
- }
528
- }
529
-
530
- if (hasKey(readableMap, STATUS)) {
531
- builder.setInboxStatus(RNNetmeraUtil.getInboxStatus(readableMap.getInt(STATUS)));
532
- } else {
533
- promise.reject(ERROR_CODE_NULL_INBOX_STATUS, ERROR_MESSAGE_NULL_INBOX_STATUS);
534
- return;
535
- }
536
-
537
- if (hasKey(readableMap, INCLUDE_EXPIRED_OBJECTS)) {
538
- builder.setIncludeExpired(readableMap.getBoolean(INCLUDE_EXPIRED_OBJECTS));
539
- }
540
-
541
- NMInboxStatusCountFilter filter = builder.build();
542
-
543
- Netmera.getInboxCountForStatus(filter, new NMInboxCountResultListener() {
544
- @Override
545
- public void onSuccess(@NonNull NMInboxStatusCount nmInboxStatusCount) {
546
- promise.resolve(RNNetmeraUtil.parseInboxCountForStatusToMap(nmInboxStatusCount));
547
- }
548
-
549
- @Override
550
- public void onFailure(@Nullable String s) {
551
- promise.reject(ERROR_CODE_INBOX_STATUS, ERROR_MESSAGE_INBOX_STATUS);
552
- }
553
- });
554
- }
555
-
556
- @ReactMethod
557
- public void getUserCategoryPreferenceList(final Promise promise) {
558
- Netmera.getUserCategoryPreferenceList(new NMCategoryPreferenceFetchCallback() {
559
- @Override
560
- public void onSuccess(List<NMCategoryPreference> list) {
561
- promise.resolve(RNNetmeraUtil.parseUserCategoryPreferenceListToMap(list));
562
- }
563
-
564
- @Override
565
- public void onFailure(@Nullable String s) {
566
- promise.reject(ERROR_CODE_CATEGORY_PREFERENCE, ERROR_MESSAGE_CATEGORY_PREFERENCE);
567
- }
568
- });
569
- }
570
-
571
- @ReactMethod
572
- public void setUserCategoryPreference(int categoryId, boolean categoryEnabled, final Promise promise) {
573
- Netmera.setUserCategoryPreference(categoryId, categoryEnabled, new NMCategoryPreferenceSetCallback() {
574
- @Override
575
- public void onSuccess() {
576
- promise.resolve(true);
577
- }
578
-
579
- @Override
580
- public void onFailure(@Nullable String s) {
581
- promise.reject(ERROR_CODE_SET_CATEGORY_PREFERENCE, ERROR_MESSAGE_SET_CATEGORY_PREFERENCE);
582
- }
583
- });
584
- }
585
-
586
- @ReactMethod
587
- public void onNetmeraPushMessageReceived(ReadableMap map) {
588
- Map<String, String> data = new HashMap<>();
589
-
590
- Bundle bundle = new Bundle();
591
- for (String key : map.toHashMap().keySet()) {
592
- data.put(key, map.getString(key));
593
- bundle.putString(key, map.getString(key));
594
- }
595
-
596
- if (data.containsKey("google.c.sender.id")) {
597
- Netmera.onNetmeraPushMessageReceived(new com.google.firebase.messaging.RemoteMessage(bundle));
598
- } else {
599
- com.huawei.hms.push.RemoteMessage.Builder builder = new com.huawei.hms.push.RemoteMessage.Builder("to");
600
- builder.setData(data);
601
- Netmera.onNetmeraPushMessageReceived(builder.build());
602
- }
603
- }
604
-
605
- @ReactMethod
606
- public void onNetmeraNewToken(String pushToken) {
607
- Netmera.onNetmeraNewToken(pushToken);
608
- }
609
-
610
- @ReactMethod
611
- public void startDataTransfer() {
612
- Netmera.startDataTransfer();
613
- }
614
-
615
- @ReactMethod
616
- public void stopDataTransfer() {
617
- Netmera.stopDataTransfer();
618
- }
619
-
620
- private boolean hasKey(Map map, String key) {
621
- return map.containsKey(key) && map.get(key) != null;
622
- }
623
-
624
- private boolean hasKey(ReadableMap map, String key) {
625
- return map.hasKey(key) && !map.isNull(key);
626
- }
627
-
628
- public static void emitEvent(String eventName, String eventData) {
629
- reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName, eventData);
630
- }
631
- }
@@ -1,35 +0,0 @@
1
- //
2
- // RNNetmeraPackage.java
3
- // Netmera SDK
4
- //
5
- // Created by Huseyin Kocoglu on 22.04.2019.
6
- // Copyright © 2019 Netmera. All rights reserved.
7
- //
8
-
9
- package com.netmera.reactnativesdk;
10
-
11
- import com.facebook.react.ReactPackage;
12
- import com.facebook.react.bridge.JavaScriptModule;
13
- import com.facebook.react.bridge.NativeModule;
14
- import com.facebook.react.bridge.ReactApplicationContext;
15
- import com.facebook.react.uimanager.ViewManager;
16
-
17
- import java.util.Arrays;
18
- import java.util.Collections;
19
- import java.util.List;
20
-
21
- public class RNNetmeraPackage implements ReactPackage {
22
- @Override
23
- public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
24
- return Arrays.<NativeModule>asList(new RNNetmeraModule(reactContext));
25
- }
26
-
27
- public List<Class<? extends JavaScriptModule>> createJSModules() {
28
- return Collections.emptyList();
29
- }
30
-
31
- @Override
32
- public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
33
- return Collections.emptyList();
34
- }
35
- }