@qonversion/react-native-sdk 10.0.0-RC1

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 (290) hide show
  1. package/README.md +129 -0
  2. package/android/build.gradle +92 -0
  3. package/android/gradle.properties +6 -0
  4. package/android/src/main/AndroidManifest.xml +2 -0
  5. package/android/src/main/java/com/qonversion/reactnativesdk/EntitiesConverter.kt +135 -0
  6. package/android/src/main/java/com/qonversion/reactnativesdk/NoCodesModule.kt +76 -0
  7. package/android/src/main/java/com/qonversion/reactnativesdk/QonversionModule.kt +278 -0
  8. package/android/src/main/java/com/qonversion/reactnativesdk/QonversionPackage.kt +43 -0
  9. package/android/src/main/java/com/qonversion/reactnativesdk/Utils.kt +32 -0
  10. package/ios/RNNoCodes.h +5 -0
  11. package/ios/RNNoCodes.mm +61 -0
  12. package/ios/RNNoCodesImpl.swift +69 -0
  13. package/ios/RNQonversion.h +5 -0
  14. package/ios/RNQonversion.mm +189 -0
  15. package/ios/RNQonversionImpl.swift +250 -0
  16. package/ios/qonversion-react-native-sdk-Bridging-Header.h +6 -0
  17. package/lib/module/NoCodes.js +32 -0
  18. package/lib/module/NoCodes.js.map +1 -0
  19. package/lib/module/NoCodesApi.js +2 -0
  20. package/lib/module/NoCodesApi.js.map +1 -0
  21. package/lib/module/NoCodesConfig.js +10 -0
  22. package/lib/module/NoCodesConfig.js.map +1 -0
  23. package/lib/module/NoCodesConfigBuilder.js +35 -0
  24. package/lib/module/NoCodesConfigBuilder.js.map +1 -0
  25. package/lib/module/Qonversion.js +35 -0
  26. package/lib/module/Qonversion.js.map +1 -0
  27. package/lib/module/QonversionApi.js +4 -0
  28. package/lib/module/QonversionApi.js.map +1 -0
  29. package/lib/module/QonversionConfig.js +16 -0
  30. package/lib/module/QonversionConfig.js.map +1 -0
  31. package/lib/module/QonversionConfigBuilder.js +90 -0
  32. package/lib/module/QonversionConfigBuilder.js.map +1 -0
  33. package/lib/module/dto/Entitlement.js +24 -0
  34. package/lib/module/dto/Entitlement.js.map +1 -0
  35. package/lib/module/dto/EntitlementsUpdateListener.js +4 -0
  36. package/lib/module/dto/EntitlementsUpdateListener.js.map +1 -0
  37. package/lib/module/dto/Experiment.js +11 -0
  38. package/lib/module/dto/Experiment.js.map +1 -0
  39. package/lib/module/dto/ExperimentGroup.js +11 -0
  40. package/lib/module/dto/ExperimentGroup.js.map +1 -0
  41. package/lib/module/dto/IntroEligibility.js +9 -0
  42. package/lib/module/dto/IntroEligibility.js.map +1 -0
  43. package/lib/module/dto/NoCodesAction.js +11 -0
  44. package/lib/module/dto/NoCodesAction.js.map +1 -0
  45. package/lib/module/dto/NoCodesError.js +13 -0
  46. package/lib/module/dto/NoCodesError.js.map +1 -0
  47. package/lib/module/dto/NoCodesListener.js +4 -0
  48. package/lib/module/dto/NoCodesListener.js.map +1 -0
  49. package/lib/module/dto/Offering.js +14 -0
  50. package/lib/module/dto/Offering.js.map +1 -0
  51. package/lib/module/dto/Offerings.js +13 -0
  52. package/lib/module/dto/Offerings.js.map +1 -0
  53. package/lib/module/dto/Product.js +114 -0
  54. package/lib/module/dto/Product.js.map +1 -0
  55. package/lib/module/dto/PromoPurchasesListener.js +4 -0
  56. package/lib/module/dto/PromoPurchasesListener.js.map +1 -0
  57. package/lib/module/dto/PromotionalOffer.js +10 -0
  58. package/lib/module/dto/PromotionalOffer.js.map +1 -0
  59. package/lib/module/dto/PurchaseModel.js +26 -0
  60. package/lib/module/dto/PurchaseModel.js.map +1 -0
  61. package/lib/module/dto/PurchaseOptions.js +15 -0
  62. package/lib/module/dto/PurchaseOptions.js.map +1 -0
  63. package/lib/module/dto/PurchaseOptionsBuilder.js +117 -0
  64. package/lib/module/dto/PurchaseOptionsBuilder.js.map +1 -0
  65. package/lib/module/dto/PurchaseUpdateModel.js +32 -0
  66. package/lib/module/dto/PurchaseUpdateModel.js.map +1 -0
  67. package/lib/module/dto/QonversionError.js +15 -0
  68. package/lib/module/dto/QonversionError.js.map +1 -0
  69. package/lib/module/dto/RemoteConfig.js +11 -0
  70. package/lib/module/dto/RemoteConfig.js.map +1 -0
  71. package/lib/module/dto/RemoteConfigList.js +18 -0
  72. package/lib/module/dto/RemoteConfigList.js.map +1 -0
  73. package/lib/module/dto/RemoteConfigurationSource.js +13 -0
  74. package/lib/module/dto/RemoteConfigurationSource.js.map +1 -0
  75. package/lib/module/dto/ScreenPresentationConfig.js +22 -0
  76. package/lib/module/dto/ScreenPresentationConfig.js.map +1 -0
  77. package/lib/module/dto/SubscriptionPeriod.js +26 -0
  78. package/lib/module/dto/SubscriptionPeriod.js.map +1 -0
  79. package/lib/module/dto/Transaction.js +18 -0
  80. package/lib/module/dto/Transaction.js.map +1 -0
  81. package/lib/module/dto/User.js +10 -0
  82. package/lib/module/dto/User.js.map +1 -0
  83. package/lib/module/dto/UserProperties.js +71 -0
  84. package/lib/module/dto/UserProperties.js.map +1 -0
  85. package/lib/module/dto/UserProperty.js +17 -0
  86. package/lib/module/dto/UserProperty.js.map +1 -0
  87. package/lib/module/dto/enums.js +425 -0
  88. package/lib/module/dto/enums.js.map +1 -0
  89. package/lib/module/dto/storeProducts/ProductInAppDetails.js +16 -0
  90. package/lib/module/dto/storeProducts/ProductInAppDetails.js.map +1 -0
  91. package/lib/module/dto/storeProducts/ProductInstallmentPlanDetails.js +25 -0
  92. package/lib/module/dto/storeProducts/ProductInstallmentPlanDetails.js.map +1 -0
  93. package/lib/module/dto/storeProducts/ProductOfferDetails.js +76 -0
  94. package/lib/module/dto/storeProducts/ProductOfferDetails.js.map +1 -0
  95. package/lib/module/dto/storeProducts/ProductPrice.js +37 -0
  96. package/lib/module/dto/storeProducts/ProductPrice.js.map +1 -0
  97. package/lib/module/dto/storeProducts/ProductPricingPhase.js +52 -0
  98. package/lib/module/dto/storeProducts/ProductPricingPhase.js.map +1 -0
  99. package/lib/module/dto/storeProducts/ProductStoreDetails.js +114 -0
  100. package/lib/module/dto/storeProducts/ProductStoreDetails.js.map +1 -0
  101. package/lib/module/dto/storeProducts/SKPaymentDiscount.js +13 -0
  102. package/lib/module/dto/storeProducts/SKPaymentDiscount.js.map +1 -0
  103. package/lib/module/dto/storeProducts/SKProduct.js +22 -0
  104. package/lib/module/dto/storeProducts/SKProduct.js.map +1 -0
  105. package/lib/module/dto/storeProducts/SKProductDiscount.js +16 -0
  106. package/lib/module/dto/storeProducts/SKProductDiscount.js.map +1 -0
  107. package/lib/module/dto/storeProducts/SKSubscriptionPeriod.js +10 -0
  108. package/lib/module/dto/storeProducts/SKSubscriptionPeriod.js.map +1 -0
  109. package/lib/module/dto/storeProducts/SkuDetails.js +30 -0
  110. package/lib/module/dto/storeProducts/SkuDetails.js.map +1 -0
  111. package/lib/module/index.js +40 -0
  112. package/lib/module/index.js.map +1 -0
  113. package/lib/module/internal/Mapper.js +676 -0
  114. package/lib/module/internal/Mapper.js.map +1 -0
  115. package/lib/module/internal/NoCodesInternal.js +70 -0
  116. package/lib/module/internal/NoCodesInternal.js.map +1 -0
  117. package/lib/module/internal/QonversionInternal.js +237 -0
  118. package/lib/module/internal/QonversionInternal.js.map +1 -0
  119. package/lib/module/internal/specs/NativeNoCodesModule.js +5 -0
  120. package/lib/module/internal/specs/NativeNoCodesModule.js.map +1 -0
  121. package/lib/module/internal/specs/NativeQonversionModule.js +5 -0
  122. package/lib/module/internal/specs/NativeQonversionModule.js.map +1 -0
  123. package/lib/module/internal/utils.js +10 -0
  124. package/lib/module/internal/utils.js.map +1 -0
  125. package/lib/module/package.json +1 -0
  126. package/lib/typescript/package.json +1 -0
  127. package/lib/typescript/src/NoCodes.d.ts +23 -0
  128. package/lib/typescript/src/NoCodes.d.ts.map +1 -0
  129. package/lib/typescript/src/NoCodesApi.d.ts +20 -0
  130. package/lib/typescript/src/NoCodesApi.d.ts.map +1 -0
  131. package/lib/typescript/src/NoCodesConfig.d.ts +8 -0
  132. package/lib/typescript/src/NoCodesConfig.d.ts.map +1 -0
  133. package/lib/typescript/src/NoCodesConfigBuilder.d.ts +26 -0
  134. package/lib/typescript/src/NoCodesConfigBuilder.d.ts.map +1 -0
  135. package/lib/typescript/src/Qonversion.d.ts +26 -0
  136. package/lib/typescript/src/Qonversion.d.ts.map +1 -0
  137. package/lib/typescript/src/QonversionApi.d.ts +285 -0
  138. package/lib/typescript/src/QonversionApi.d.ts.map +1 -0
  139. package/lib/typescript/src/QonversionConfig.d.ts +14 -0
  140. package/lib/typescript/src/QonversionConfig.d.ts.map +1 -0
  141. package/lib/typescript/src/QonversionConfigBuilder.d.ts +65 -0
  142. package/lib/typescript/src/QonversionConfigBuilder.d.ts.map +1 -0
  143. package/lib/typescript/src/dto/Entitlement.d.ts +22 -0
  144. package/lib/typescript/src/dto/Entitlement.d.ts.map +1 -0
  145. package/lib/typescript/src/dto/EntitlementsUpdateListener.d.ts +10 -0
  146. package/lib/typescript/src/dto/EntitlementsUpdateListener.d.ts.map +1 -0
  147. package/lib/typescript/src/dto/Experiment.d.ts +9 -0
  148. package/lib/typescript/src/dto/Experiment.d.ts.map +1 -0
  149. package/lib/typescript/src/dto/ExperimentGroup.d.ts +9 -0
  150. package/lib/typescript/src/dto/ExperimentGroup.d.ts.map +1 -0
  151. package/lib/typescript/src/dto/IntroEligibility.d.ts +7 -0
  152. package/lib/typescript/src/dto/IntroEligibility.d.ts.map +1 -0
  153. package/lib/typescript/src/dto/NoCodesAction.d.ts +10 -0
  154. package/lib/typescript/src/dto/NoCodesAction.d.ts.map +1 -0
  155. package/lib/typescript/src/dto/NoCodesError.d.ts +12 -0
  156. package/lib/typescript/src/dto/NoCodesError.d.ts.map +1 -0
  157. package/lib/typescript/src/dto/NoCodesListener.d.ts +34 -0
  158. package/lib/typescript/src/dto/NoCodesListener.d.ts.map +1 -0
  159. package/lib/typescript/src/dto/Offering.d.ts +11 -0
  160. package/lib/typescript/src/dto/Offering.d.ts.map +1 -0
  161. package/lib/typescript/src/dto/Offerings.d.ts +9 -0
  162. package/lib/typescript/src/dto/Offerings.d.ts.map +1 -0
  163. package/lib/typescript/src/dto/Product.d.ts +95 -0
  164. package/lib/typescript/src/dto/Product.d.ts.map +1 -0
  165. package/lib/typescript/src/dto/PromoPurchasesListener.d.ts +12 -0
  166. package/lib/typescript/src/dto/PromoPurchasesListener.d.ts.map +1 -0
  167. package/lib/typescript/src/dto/PromotionalOffer.d.ts +9 -0
  168. package/lib/typescript/src/dto/PromotionalOffer.d.ts.map +1 -0
  169. package/lib/typescript/src/dto/PurchaseModel.d.ts +19 -0
  170. package/lib/typescript/src/dto/PurchaseModel.d.ts.map +1 -0
  171. package/lib/typescript/src/dto/PurchaseOptions.d.ts +15 -0
  172. package/lib/typescript/src/dto/PurchaseOptions.d.ts.map +1 -0
  173. package/lib/typescript/src/dto/PurchaseOptionsBuilder.d.ts +84 -0
  174. package/lib/typescript/src/dto/PurchaseOptionsBuilder.d.ts.map +1 -0
  175. package/lib/typescript/src/dto/PurchaseUpdateModel.d.ts +25 -0
  176. package/lib/typescript/src/dto/PurchaseUpdateModel.d.ts.map +1 -0
  177. package/lib/typescript/src/dto/QonversionError.d.ts +11 -0
  178. package/lib/typescript/src/dto/QonversionError.d.ts.map +1 -0
  179. package/lib/typescript/src/dto/RemoteConfig.d.ts +10 -0
  180. package/lib/typescript/src/dto/RemoteConfig.d.ts.map +1 -0
  181. package/lib/typescript/src/dto/RemoteConfigList.d.ts +10 -0
  182. package/lib/typescript/src/dto/RemoteConfigList.d.ts.map +1 -0
  183. package/lib/typescript/src/dto/RemoteConfigurationSource.d.ts +11 -0
  184. package/lib/typescript/src/dto/RemoteConfigurationSource.d.ts.map +1 -0
  185. package/lib/typescript/src/dto/ScreenPresentationConfig.d.ts +18 -0
  186. package/lib/typescript/src/dto/ScreenPresentationConfig.d.ts.map +1 -0
  187. package/lib/typescript/src/dto/SubscriptionPeriod.d.ts +21 -0
  188. package/lib/typescript/src/dto/SubscriptionPeriod.d.ts.map +1 -0
  189. package/lib/typescript/src/dto/Transaction.d.ts +16 -0
  190. package/lib/typescript/src/dto/Transaction.d.ts.map +1 -0
  191. package/lib/typescript/src/dto/User.d.ts +7 -0
  192. package/lib/typescript/src/dto/User.d.ts.map +1 -0
  193. package/lib/typescript/src/dto/UserProperties.d.ts +49 -0
  194. package/lib/typescript/src/dto/UserProperties.d.ts.map +1 -0
  195. package/lib/typescript/src/dto/UserProperty.d.ts +13 -0
  196. package/lib/typescript/src/dto/UserProperty.d.ts.map +1 -0
  197. package/lib/typescript/src/dto/enums.d.ts +343 -0
  198. package/lib/typescript/src/dto/enums.d.ts.map +1 -0
  199. package/lib/typescript/src/dto/storeProducts/ProductInAppDetails.d.ts +13 -0
  200. package/lib/typescript/src/dto/storeProducts/ProductInAppDetails.d.ts.map +1 -0
  201. package/lib/typescript/src/dto/storeProducts/ProductInstallmentPlanDetails.d.ts +20 -0
  202. package/lib/typescript/src/dto/storeProducts/ProductInstallmentPlanDetails.d.ts.map +1 -0
  203. package/lib/typescript/src/dto/storeProducts/ProductOfferDetails.d.ts +63 -0
  204. package/lib/typescript/src/dto/storeProducts/ProductOfferDetails.d.ts.map +1 -0
  205. package/lib/typescript/src/dto/storeProducts/ProductPrice.d.ts +29 -0
  206. package/lib/typescript/src/dto/storeProducts/ProductPrice.d.ts.map +1 -0
  207. package/lib/typescript/src/dto/storeProducts/ProductPricingPhase.d.ts +44 -0
  208. package/lib/typescript/src/dto/storeProducts/ProductPricingPhase.d.ts.map +1 -0
  209. package/lib/typescript/src/dto/storeProducts/ProductStoreDetails.d.ts +97 -0
  210. package/lib/typescript/src/dto/storeProducts/ProductStoreDetails.d.ts.map +1 -0
  211. package/lib/typescript/src/dto/storeProducts/SKPaymentDiscount.d.ts +10 -0
  212. package/lib/typescript/src/dto/storeProducts/SKPaymentDiscount.d.ts.map +1 -0
  213. package/lib/typescript/src/dto/storeProducts/SKProduct.d.ts +21 -0
  214. package/lib/typescript/src/dto/storeProducts/SKProduct.d.ts.map +1 -0
  215. package/lib/typescript/src/dto/storeProducts/SKProductDiscount.d.ts +15 -0
  216. package/lib/typescript/src/dto/storeProducts/SKProductDiscount.d.ts.map +1 -0
  217. package/lib/typescript/src/dto/storeProducts/SKSubscriptionPeriod.d.ts +8 -0
  218. package/lib/typescript/src/dto/storeProducts/SKSubscriptionPeriod.d.ts.map +1 -0
  219. package/lib/typescript/src/dto/storeProducts/SkuDetails.d.ts +27 -0
  220. package/lib/typescript/src/dto/storeProducts/SkuDetails.d.ts.map +1 -0
  221. package/lib/typescript/src/index.d.ts +41 -0
  222. package/lib/typescript/src/index.d.ts.map +1 -0
  223. package/lib/typescript/src/internal/Mapper.d.ts +312 -0
  224. package/lib/typescript/src/internal/Mapper.d.ts.map +1 -0
  225. package/lib/typescript/src/internal/NoCodesInternal.d.ts +14 -0
  226. package/lib/typescript/src/internal/NoCodesInternal.d.ts.map +1 -0
  227. package/lib/typescript/src/internal/QonversionInternal.d.ts +60 -0
  228. package/lib/typescript/src/internal/QonversionInternal.d.ts.map +1 -0
  229. package/lib/typescript/src/internal/specs/NativeNoCodesModule.d.ts +17 -0
  230. package/lib/typescript/src/internal/specs/NativeNoCodesModule.d.ts.map +1 -0
  231. package/lib/typescript/src/internal/specs/NativeQonversionModule.d.ts +56 -0
  232. package/lib/typescript/src/internal/specs/NativeQonversionModule.d.ts.map +1 -0
  233. package/lib/typescript/src/internal/utils.d.ts +3 -0
  234. package/lib/typescript/src/internal/utils.d.ts.map +1 -0
  235. package/package.json +151 -0
  236. package/qonversion-react-native-sdk.podspec +21 -0
  237. package/src/NoCodes.ts +37 -0
  238. package/src/NoCodesApi.ts +22 -0
  239. package/src/NoCodesConfig.ts +16 -0
  240. package/src/NoCodesConfigBuilder.ts +40 -0
  241. package/src/Qonversion.ts +40 -0
  242. package/src/QonversionApi.ts +318 -0
  243. package/src/QonversionConfig.ts +32 -0
  244. package/src/QonversionConfigBuilder.ts +102 -0
  245. package/src/dto/Entitlement.ts +57 -0
  246. package/src/dto/EntitlementsUpdateListener.ts +11 -0
  247. package/src/dto/Experiment.ts +15 -0
  248. package/src/dto/ExperimentGroup.ts +15 -0
  249. package/src/dto/IntroEligibility.ts +11 -0
  250. package/src/dto/NoCodesAction.ts +21 -0
  251. package/src/dto/NoCodesError.ts +26 -0
  252. package/src/dto/NoCodesListener.ts +39 -0
  253. package/src/dto/Offering.ts +20 -0
  254. package/src/dto/Offerings.ts +17 -0
  255. package/src/dto/Product.ts +159 -0
  256. package/src/dto/PromoPurchasesListener.ts +13 -0
  257. package/src/dto/PromotionalOffer.ts +17 -0
  258. package/src/dto/PurchaseModel.ts +29 -0
  259. package/src/dto/PurchaseOptions.ts +33 -0
  260. package/src/dto/PurchaseOptionsBuilder.ts +127 -0
  261. package/src/dto/PurchaseUpdateModel.ts +43 -0
  262. package/src/dto/QonversionError.ts +24 -0
  263. package/src/dto/RemoteConfig.ts +16 -0
  264. package/src/dto/RemoteConfigList.ts +23 -0
  265. package/src/dto/RemoteConfigurationSource.ts +26 -0
  266. package/src/dto/ScreenPresentationConfig.ts +24 -0
  267. package/src/dto/SubscriptionPeriod.ts +33 -0
  268. package/src/dto/Transaction.ts +40 -0
  269. package/src/dto/User.ts +11 -0
  270. package/src/dto/UserProperties.ts +78 -0
  271. package/src/dto/UserProperty.ts +21 -0
  272. package/src/dto/enums.ts +389 -0
  273. package/src/dto/storeProducts/ProductInAppDetails.ts +17 -0
  274. package/src/dto/storeProducts/ProductInstallmentPlanDetails.ts +28 -0
  275. package/src/dto/storeProducts/ProductOfferDetails.ts +102 -0
  276. package/src/dto/storeProducts/ProductPrice.ts +46 -0
  277. package/src/dto/storeProducts/ProductPricingPhase.ts +71 -0
  278. package/src/dto/storeProducts/ProductStoreDetails.ts +151 -0
  279. package/src/dto/storeProducts/SKPaymentDiscount.ts +23 -0
  280. package/src/dto/storeProducts/SKProduct.ts +53 -0
  281. package/src/dto/storeProducts/SKProductDiscount.ts +38 -0
  282. package/src/dto/storeProducts/SKSubscriptionPeriod.ts +13 -0
  283. package/src/dto/storeProducts/SkuDetails.ts +68 -0
  284. package/src/index.ts +43 -0
  285. package/src/internal/Mapper.ts +1221 -0
  286. package/src/internal/NoCodesInternal.ts +84 -0
  287. package/src/internal/QonversionInternal.ts +370 -0
  288. package/src/internal/specs/NativeNoCodesModule.ts +20 -0
  289. package/src/internal/specs/NativeQonversionModule.ts +74 -0
  290. package/src/internal/utils.ts +9 -0
package/README.md ADDED
@@ -0,0 +1,129 @@
1
+ <h1 align="center">
2
+ Qonversion
3
+ </h1>
4
+
5
+ Qonversion - In-app subscription monetization: implement subscriptions and grow your app’s revenue with A/B experiments
6
+
7
+ * In-app subscription management SDK
8
+ * API and webhooks to make your subscription data available where you need it
9
+ * Seamless Stripe integration to enable cross-platform access management
10
+ * Subscribers CRM with user-level transactions
11
+ * Instant access to real-time subscription analytics
12
+ * Built-in A/B experiments for subscription business model
13
+
14
+ <p align="center">
15
+ <a href="https://qonversion.io"><img width="90%" src="https://qcdn3.sfo3.digitaloceanspaces.com/github/qonversion_platform.png">
16
+ </a>
17
+ </p>
18
+
19
+ [![npm](https://img.shields.io/npm/v/react-native-qonversion)](https://www.npmjs.com/package/react-native-qonversion)
20
+ [![MIT License](http://img.shields.io/cocoapods/l/Qonversion.svg?style=flat)](https://qonversion.io)
21
+
22
+
23
+ ## In-App Subscription Implementation & Management
24
+
25
+ <p align="center">
26
+ <a href="https://documentation.qonversion.io/docs/integrations-overview"><img width="90%" src="https://user-images.githubusercontent.com/13959241/161107203-8ef3ecee-86be-47a2-ac57-b21d3da19339.png">
27
+ </a>
28
+ </p>
29
+
30
+ 1. Qonversion SDK provides three simple methods to manage subscriptions:
31
+ * Get in-app product details
32
+ * Make purchases
33
+ * Check subscription status to manage premium access
34
+ 2. Qonversion communicates with Apple or Google platforms both through SDK and server-side to process native in-app payments and keep subscription statuses up to date.
35
+ 3. You can use Qonversion webhooks and API in addition to SDK to get user-level data where you need it.
36
+
37
+ See the [quick start guide documentation](https://documentation.qonversion.io/docs/quickstart).
38
+
39
+ ## Analytics
40
+
41
+ Qonversion provides advanced subscription analytics out of the box. You can monitor real-time metrics from new users and trial-to-paid conversions to revenue, MRR, ARR, cohort retention, and more. Understand your customers and make better decisions with precise subscription analytics.
42
+
43
+ <p align="center">
44
+ <a href="https://documentation.qonversion.io/docs/analytics"><img width="90%" src="https://files.readme.io/9a4fdf6-Analytics.png">
45
+ </a>
46
+ </p>
47
+
48
+
49
+ ## A/B Experiments
50
+
51
+ Qonversion's A/B Experiments feature provides everything required to quickly launch paywall and other monetization experiments, analyze results and roll out winning versions without releasing a new app build. Qonversion A/B Experiments include:
52
+
53
+ * User segmentation by country, install date, app version, free/paying user
54
+ * Traffic allocation
55
+ * Advanced subscription analytics
56
+ * Visualization of A/B experiments results
57
+ * Statistical significance of the results
58
+ * Roll out winning versions without app release with remote config
59
+
60
+
61
+ <p align="center">
62
+ <a href="https://documentation.qonversion.io/docs/subscription-ab-testing"><img width="90%" src="https://qcdn3.sfo3.digitaloceanspaces.com/github/ab_tests.png">
63
+ </a>
64
+ </p>
65
+
66
+ See more details [here](https://documentation.qonversion.io/docs/paywall-experiments).
67
+
68
+ ## Integrations
69
+
70
+ Send user-level subscription data to your favorite platforms.
71
+
72
+ * Amplitude
73
+ * Mixpanel
74
+ * Appsflyer
75
+ * Adjust
76
+ * Singular
77
+ * CleverTap
78
+ * [All other integrations here](qonversion.io/integrations)
79
+
80
+ <p align="center">
81
+ <a href="https://documentation.qonversion.io/docs/integrations-overview"><img width="90%", src="https://qcdn3.sfo3.digitaloceanspaces.com/github/integrations.png">
82
+ </a>
83
+ </p>
84
+
85
+ ## Why Qonversion?
86
+
87
+ * **No headaches with Apple's StoreKit & Google Billing.** Qonversion provides simple methods to handle Apple StoreKit & Google Billing purchase flow.
88
+ * **Receipt validation.** Qonversion validates user receipts with Apple and Google to provide 100% accurate purchase information and subscription statuses. It also prevents unauthorized access to the premium features of your app.
89
+ * **Track and increase your revenue.** Qonversion provides detailed real-time revenue analytics including cohort analysis, trial conversion rates, country segmentation, and much more.
90
+ * **Integrations with the leading mobile platforms.** Qonversion allows sending data to platforms like AppsFlyer, Adjust, Branch, Tenjin, Facebook Ads, Amplitude, Mixpanel, and many others.
91
+ * **Change promoted in-app products.** Change promoted in-app products anytime without app releases.
92
+ * **A/B test** and identify winning in-app purchases, subscriptions, or paywalls.
93
+ * **Cross-device and cross-platform access management.** If you provide user authorization in your app, you can easily set Qonversion to provide premium access to authorized users across devices and operating systems.
94
+ * **SDK caches the data.** Qonversion SDK caches purchase data including in-app products and entitlements, so the user experience is not affected even with a slow or interrupted network connection.
95
+ * **Webhooks.** You can easily send all the data to your server with Qonversion webhooks.
96
+ * **Customer support.** You can always reach out to our customer support and get the help required.
97
+
98
+ Convinced? Let's go!
99
+
100
+ ## Documentation
101
+
102
+ Check the [full documentation](https://documentation.qonversion.io/docs/quickstart) to learn about implementation details and available features.
103
+
104
+ #### Help us improve the documentation
105
+
106
+ Whether you’re a core user or trying it out for the first time, you can make a valuable contribution to Qonversion by improving the documentation. Help us by:
107
+
108
+ * sending us feedback about something you thought was confusing or simply missing
109
+ * sending us a pull request via GitHub
110
+ * suggesting better wording or ways of explaining certain topics in the [Qonversion documentation](http://documentation.qonversion.io). Use `SUGGEST EDITS` button in the top right corner.
111
+
112
+ ## Contributing
113
+
114
+ Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
115
+
116
+ 1. Fork the Project
117
+ 2. Create your Feature Branch (`git checkout -b feature/SuperFeature`)
118
+ 3. Commit your Changes. Use small commits with separate logic. (`git commit -m 'Add some super feature'`)
119
+ 4. Push to the Branch (`git push origin feature/SuperFeature`)
120
+ 5. Open a Pull Request
121
+
122
+
123
+ ## Have a question?
124
+
125
+ Contact us via [issues on GitHub](https://github.com/qonversion/react-native-sdk/issues) or [ask a question](https://documentation.qonversion.io/discuss-new) on the site.
126
+
127
+ ## License
128
+
129
+ Qonversion SDK is available under the MIT license.
@@ -0,0 +1,92 @@
1
+ buildscript {
2
+ ext.getExtOrDefault = {name ->
3
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeSdk_' + name]
4
+ }
5
+
6
+ repositories {
7
+ google()
8
+ mavenCentral()
9
+ }
10
+
11
+ dependencies {
12
+ classpath "com.android.tools.build:gradle:8.7.2"
13
+ // noinspection DifferentKotlinGradleVersion
14
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
15
+ }
16
+ }
17
+
18
+ def isNewArchitectureEnabled() {
19
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
20
+ }
21
+
22
+ apply plugin: "com.android.library"
23
+ apply plugin: "kotlin-android"
24
+
25
+ if (isNewArchitectureEnabled()) {
26
+ apply plugin: "com.facebook.react"
27
+ }
28
+
29
+ def getExtOrIntegerDefault(name) {
30
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ReactNativeSdk_" + name]).toInteger()
31
+ }
32
+
33
+ android {
34
+ namespace "com.qonversion.reactnativesdk"
35
+
36
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
37
+
38
+ defaultConfig {
39
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
40
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
41
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
42
+ }
43
+
44
+ buildFeatures {
45
+ buildConfig true
46
+ }
47
+
48
+ buildTypes {
49
+ release {
50
+ minifyEnabled false
51
+ }
52
+ }
53
+
54
+ lintOptions {
55
+ disable "GradleCompatible"
56
+ }
57
+
58
+ compileOptions {
59
+ sourceCompatibility JavaVersion.VERSION_1_8
60
+ targetCompatibility JavaVersion.VERSION_1_8
61
+ }
62
+
63
+ sourceSets {
64
+ main {
65
+ java.srcDirs += [
66
+ "generated/java",
67
+ "generated/jni"
68
+ ]
69
+ }
70
+ }
71
+ }
72
+
73
+ repositories {
74
+ mavenCentral()
75
+ google()
76
+ }
77
+
78
+ def kotlin_version = getExtOrDefault("kotlinVersion")
79
+
80
+ dependencies {
81
+ implementation "com.facebook.react:react-android"
82
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
83
+ implementation "io.qonversion:sandwich:6.0.10"
84
+ }
85
+
86
+ if (isNewArchitectureEnabled()) {
87
+ react {
88
+ jsRootDir = file("../src/")
89
+ libraryName = "ReactNativeSdk"
90
+ codegenJavaPackageName = "com.qonversion.reactnativesdk"
91
+ }
92
+ }
@@ -0,0 +1,6 @@
1
+ ReactNativeSdk_kotlinVersion=2.0.21
2
+ ReactNativeSdk_minSdkVersion=24
3
+ ReactNativeSdk_targetSdkVersion=34
4
+ ReactNativeSdk_compileSdkVersion=35
5
+ ReactNativeSdk_ndkVersion=27.1.12297006
6
+ newArchEnabled=true
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -0,0 +1,135 @@
1
+ package com.qonversion.reactnativesdk
2
+
3
+ import com.facebook.react.bridge.ReadableArray
4
+ import com.facebook.react.bridge.ReadableMap
5
+ import com.facebook.react.bridge.ReadableMapKeySetIterator
6
+ import com.facebook.react.bridge.ReadableType
7
+ import com.facebook.react.bridge.WritableArray
8
+ import com.facebook.react.bridge.WritableMap
9
+ import com.facebook.react.bridge.WritableNativeArray
10
+ import com.facebook.react.bridge.WritableNativeMap
11
+ import org.json.JSONArray
12
+ import org.json.JSONException
13
+ import org.json.JSONObject
14
+
15
+ class EntitiesConverter {
16
+ companion object {
17
+ @Throws(JSONException::class)
18
+ fun convertReadableMapToHashMap(readableMap: ReadableMap): HashMap<String, Any> {
19
+ val jsonObject = convertMapToJson(readableMap)
20
+ return toMap(jsonObject) as HashMap<String, Any>
21
+ }
22
+
23
+ @Throws(JSONException::class)
24
+ fun toMap(jsonObj: JSONObject): Map<String, Any> {
25
+ val map: MutableMap<String, Any> = HashMap()
26
+ val keys: Iterator<String> = jsonObj.keys()
27
+ while (keys.hasNext()) {
28
+ val key = keys.next()
29
+ var value = jsonObj[key]
30
+ if (value is JSONArray) {
31
+ value = toList(value)
32
+ } else if (value is JSONObject) {
33
+ value = toMap(value)
34
+ }
35
+ map[key] = value
36
+ }
37
+ return map
38
+ }
39
+
40
+ @Throws(JSONException::class)
41
+ fun toList(array: JSONArray): List<Any> {
42
+ val list: MutableList<Any> = ArrayList()
43
+ for (i in 0 until array.length()) {
44
+ var value = array[i]
45
+ if (value is JSONArray) {
46
+ value = toList(value)
47
+ } else if (value is JSONObject) {
48
+ value = toMap(value)
49
+ }
50
+ list.add(value)
51
+ }
52
+ return list
53
+ }
54
+
55
+ @Throws(JSONException::class)
56
+ fun convertMapToJson(readableMap: ReadableMap): JSONObject {
57
+ val `object` = JSONObject()
58
+ val iterator: ReadableMapKeySetIterator = readableMap.keySetIterator()
59
+ while (iterator.hasNextKey()) {
60
+ val key = iterator.nextKey()
61
+ when (readableMap.getType(key)) {
62
+ ReadableType.Null -> `object`.put(key, JSONObject.NULL)
63
+ ReadableType.Boolean -> `object`.put(key, readableMap.getBoolean(key))
64
+ ReadableType.Number -> `object`.put(key, readableMap.getDouble(key))
65
+ ReadableType.String -> `object`.put(key, readableMap.getString(key))
66
+ ReadableType.Map -> `object`.put(key, convertMapToJson(readableMap.getMap(key)!!))
67
+ ReadableType.Array -> `object`.put(key, convertArrayToJson(readableMap.getArray(key)!!))
68
+ }
69
+ }
70
+ return `object`
71
+ }
72
+
73
+ @Throws(JSONException::class)
74
+ fun convertArrayToJson(readableArray: ReadableArray): JSONArray {
75
+ val array = JSONArray()
76
+ for (i in 0 until readableArray.size()) {
77
+ when (readableArray.getType(i)) {
78
+ ReadableType.Null -> {}
79
+ ReadableType.Boolean -> array.put(readableArray.getBoolean(i))
80
+ ReadableType.Number -> array.put(readableArray.getDouble(i))
81
+ ReadableType.String -> array.put(readableArray.getString(i))
82
+ ReadableType.Map -> array.put(convertMapToJson(readableArray.getMap(i)!!))
83
+ ReadableType.Array -> array.put(convertArrayToJson(readableArray.getArray(i)!!))
84
+ }
85
+ }
86
+ return array
87
+ }
88
+
89
+ fun convertArrayToStringList(readableArray: ReadableArray): List<String> {
90
+ val list: MutableList<String> = ArrayList()
91
+ for (i in 0 until readableArray.size()) {
92
+ list.add(readableArray.getString(i)!!)
93
+ }
94
+ return list
95
+ }
96
+
97
+ fun convertListToWritableArray(list: List<*>): WritableArray {
98
+ val array: WritableArray = WritableNativeArray()
99
+ for (i in list.indices) {
100
+ val value = list[i]
101
+ when (value) {
102
+ is String -> array.pushString(value)
103
+ is Int -> array.pushInt(value)
104
+ is Long -> array.pushDouble(value.toDouble())
105
+ is Double -> array.pushDouble(value)
106
+ is Float -> array.pushDouble(value.toDouble())
107
+ is Boolean -> array.pushBoolean(value)
108
+ is List<*> -> array.pushArray(convertListToWritableArray(value))
109
+ is Map<*, *> -> array.pushMap(convertMapToWritableMap(value))
110
+ }
111
+ }
112
+ return array
113
+ }
114
+
115
+ fun convertMapToWritableMap(map: Map<*, *>): WritableMap {
116
+ val writableMap: WritableMap = WritableNativeMap()
117
+ val keys: Set<*> = map.keys
118
+ for (key in keys) {
119
+ val keyStr = key.toString()
120
+ val value = map[key]
121
+ when (value) {
122
+ is String -> writableMap.putString(keyStr, value)
123
+ is Int -> writableMap.putInt(keyStr, value)
124
+ is Long -> writableMap.putDouble(keyStr, value.toDouble())
125
+ is Double -> writableMap.putDouble(keyStr, value)
126
+ is Float -> writableMap.putDouble(keyStr, value.toDouble())
127
+ is Boolean -> writableMap.putBoolean(keyStr, value)
128
+ is List<*> -> writableMap.putArray(keyStr, convertListToWritableArray(value))
129
+ is Map<*, *> -> writableMap.putMap(keyStr, convertMapToWritableMap(value))
130
+ }
131
+ }
132
+ return writableMap
133
+ }
134
+ }
135
+ }
@@ -0,0 +1,76 @@
1
+ package com.qonversion.reactnativesdk
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import com.facebook.react.module.annotations.ReactModule
5
+ import com.facebook.react.bridge.Promise
6
+ import com.facebook.react.bridge.ReactMethod
7
+ import com.facebook.react.bridge.ReadableMap
8
+ import com.facebook.react.bridge.WritableMap
9
+ import com.facebook.react.bridge.WritableNativeMap
10
+ import io.qonversion.sandwich.BridgeData
11
+ import io.qonversion.sandwich.NoCodesSandwich
12
+ import io.qonversion.sandwich.NoCodesEventListener
13
+
14
+ @ReactModule(name = NoCodesModule.NAME)
15
+ class NoCodesModule(private val reactContext: ReactApplicationContext) : NativeNoCodesModuleSpec(reactContext) {
16
+ private val noCodesSandwich: NoCodesSandwich = NoCodesSandwich()
17
+ private val noCodesEventListener: NoCodesEventListener = object : NoCodesEventListener {
18
+ override fun onNoCodesEvent(event: NoCodesEventListener.Event, payload: BridgeData?) {
19
+ val eventMap: WritableMap = WritableNativeMap()
20
+ eventMap.putString("name", event.key)
21
+ payload?.let {
22
+ val payloadMap = EntitiesConverter.convertMapToWritableMap(it)
23
+
24
+ eventMap.putMap("payload", payloadMap)
25
+ }
26
+ emitOnNoCodeEvent(eventMap)
27
+ }
28
+ }
29
+
30
+ override fun getName(): String {
31
+ return NAME
32
+ }
33
+
34
+ @ReactMethod
35
+ override fun initialize(projectKey: String, source: String, version: String) {
36
+ noCodesSandwich.storeSdkInfo(reactContext, source, version)
37
+ noCodesSandwich.initialize(reactContext, projectKey, null, null, null)
38
+ noCodesSandwich.setDelegate(noCodesEventListener)
39
+ noCodesSandwich.setScreenCustomizationDelegate()
40
+ }
41
+
42
+ @ReactMethod
43
+ override fun setScreenPresentationConfig(configData: ReadableMap, contextKey: String?, promise: Promise) {
44
+ try {
45
+ val config: Map<String, Any> = EntitiesConverter.convertReadableMapToHashMap(configData)
46
+ noCodesSandwich.setScreenPresentationConfig(config, contextKey)
47
+ promise.resolve(true)
48
+ } catch (e: Exception) {
49
+ promise.reject(e)
50
+ }
51
+ }
52
+
53
+ @ReactMethod
54
+ override fun showScreen(contextKey: String, promise: Promise) {
55
+ try {
56
+ noCodesSandwich.showScreen(contextKey)
57
+ promise.resolve(true)
58
+ } catch (e: Exception) {
59
+ promise.reject(e)
60
+ }
61
+ }
62
+
63
+ @ReactMethod
64
+ override fun close(promise: Promise) {
65
+ try {
66
+ noCodesSandwich.close()
67
+ promise.resolve(true)
68
+ } catch (e: Exception) {
69
+ promise.reject(e)
70
+ }
71
+ }
72
+
73
+ companion object {
74
+ const val NAME = "RNNoCodes"
75
+ }
76
+ }