react-native-iap 13.0.4 → 14.0.0-rc.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 (381) hide show
  1. package/NitroIap.podspec +33 -0
  2. package/README.md +163 -51
  3. package/android/CMakeLists.txt +32 -0
  4. package/android/build.gradle +107 -138
  5. package/android/fix-prefab.gradle +51 -0
  6. package/android/gradle.properties +5 -13
  7. package/android/src/main/AndroidManifest.xml +1 -4
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  9. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +843 -0
  10. package/android/src/main/java/com/margelo/nitro/iap/NitroIapPackage.java +33 -0
  11. package/android/src/main/java/com/margelo/nitro/iap/Types.kt +173 -0
  12. package/ios/Bridge.h +8 -0
  13. package/ios/ErrorUtils.swift +153 -0
  14. package/ios/HybridRnIap.swift +1326 -0
  15. package/ios/ProductStore.swift +33 -0
  16. package/ios/reactnativeiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  17. package/ios/reactnativeiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  18. package/lib/module/helpers/subscription.js +56 -0
  19. package/lib/module/helpers/subscription.js.map +1 -0
  20. package/lib/module/hooks/useIAP.js +175 -123
  21. package/lib/module/hooks/useIAP.js.map +1 -1
  22. package/lib/module/index.js +1015 -9
  23. package/lib/module/index.js.map +1 -1
  24. package/lib/module/package.json +1 -0
  25. package/lib/module/specs/RnIap.nitro.js +4 -0
  26. package/lib/{commonjs/modules/common.js.map → module/specs/RnIap.nitro.js.map} +1 -1
  27. package/lib/module/types.js +187 -0
  28. package/lib/module/types.js.map +1 -0
  29. package/lib/module/utils/error.js +80 -0
  30. package/lib/module/utils/error.js.map +1 -0
  31. package/lib/module/utils/type-bridge.js +202 -0
  32. package/lib/module/utils/type-bridge.js.map +1 -0
  33. package/lib/typescript/package.json +1 -0
  34. package/lib/typescript/plugin/src/withIAP.d.ts +2 -7
  35. package/lib/typescript/plugin/src/withIAP.d.ts.map +1 -1
  36. package/lib/typescript/scripts/check-nitro-versions.d.ts +3 -0
  37. package/lib/typescript/scripts/check-nitro-versions.d.ts.map +1 -0
  38. package/lib/typescript/src/helpers/subscription.d.ts +14 -0
  39. package/lib/typescript/src/helpers/subscription.d.ts.map +1 -0
  40. package/lib/typescript/src/hooks/useIAP.d.ts +42 -26
  41. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
  42. package/lib/typescript/src/index.d.ts +356 -8
  43. package/lib/typescript/src/index.d.ts.map +1 -1
  44. package/lib/typescript/src/specs/RnIap.nitro.d.ts +404 -0
  45. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -0
  46. package/lib/typescript/src/types.d.ts +544 -0
  47. package/lib/typescript/src/types.d.ts.map +1 -0
  48. package/lib/typescript/src/utils/error.d.ts +30 -0
  49. package/lib/typescript/src/utils/error.d.ts.map +1 -0
  50. package/lib/typescript/src/utils/type-bridge.d.ts +40 -0
  51. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -0
  52. package/nitro.json +17 -0
  53. package/nitrogen/generated/android/NitroIap+autolinking.cmake +80 -0
  54. package/nitrogen/generated/android/NitroIap+autolinking.gradle +27 -0
  55. package/nitrogen/generated/android/NitroIapOnLoad.cpp +50 -0
  56. package/nitrogen/generated/android/NitroIapOnLoad.hpp +25 -0
  57. package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +78 -0
  58. package/nitrogen/generated/android/c++/JFunc_void_NitroPurchase.hpp +78 -0
  59. package/nitrogen/generated/android/c++/JFunc_void_NitroPurchaseResult.hpp +78 -0
  60. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +577 -0
  61. package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +93 -0
  62. package/nitrogen/generated/android/c++/JNitroAndroidReceiptValidationOptions.hpp +66 -0
  63. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidOptions.hpp +54 -0
  64. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesIosOptions.hpp +65 -0
  65. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesOptions.hpp +62 -0
  66. package/nitrogen/generated/android/c++/JNitroFinishTransactionAndroidParams.hpp +58 -0
  67. package/nitrogen/generated/android/c++/JNitroFinishTransactionIosParams.hpp +53 -0
  68. package/nitrogen/generated/android/c++/JNitroFinishTransactionParams.hpp +62 -0
  69. package/nitrogen/generated/android/c++/JNitroProduct.hpp +154 -0
  70. package/nitrogen/generated/android/c++/JNitroPurchase.hpp +122 -0
  71. package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +66 -0
  72. package/nitrogen/generated/android/c++/JNitroPurchaseResult.hpp +70 -0
  73. package/nitrogen/generated/android/c++/JNitroReceiptValidationParams.hpp +60 -0
  74. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultAndroid.hpp +122 -0
  75. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +68 -0
  76. package/nitrogen/generated/android/c++/JNitroRequestPurchaseAndroid.hpp +115 -0
  77. package/nitrogen/generated/android/c++/JNitroRequestPurchaseIos.hpp +84 -0
  78. package/nitrogen/generated/android/c++/JNitroSubscriptionOffer.hpp +57 -0
  79. package/nitrogen/generated/android/c++/JNitroSubscriptionRenewalInfo.hpp +74 -0
  80. package/nitrogen/generated/android/c++/JNitroSubscriptionStatus.hpp +64 -0
  81. package/nitrogen/generated/android/c++/JVariant_Boolean_NitroPurchaseResult.cpp +26 -0
  82. package/nitrogen/generated/android/c++/JVariant_Boolean_NitroPurchaseResult.hpp +71 -0
  83. package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.cpp +26 -0
  84. package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.hpp +75 -0
  85. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroProduct.kt +81 -0
  86. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchase.kt +81 -0
  87. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchaseResult.kt +81 -0
  88. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +198 -0
  89. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAndroidReceiptValidationOptions.kt +38 -0
  90. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidOptions.kt +29 -0
  91. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesIosOptions.kt +38 -0
  92. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesOptions.kt +32 -0
  93. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionAndroidParams.kt +32 -0
  94. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionIosParams.kt +29 -0
  95. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionParams.kt +32 -0
  96. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroIapOnLoad.kt +35 -0
  97. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +104 -0
  98. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +80 -0
  99. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +32 -0
  100. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseResult.kt +41 -0
  101. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationParams.kt +32 -0
  102. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultAndroid.kt +80 -0
  103. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultIOS.kt +38 -0
  104. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseAndroid.kt +47 -0
  105. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseIos.kt +41 -0
  106. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionOffer.kt +32 -0
  107. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionRenewalInfo.kt +44 -0
  108. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionStatus.kt +35 -0
  109. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_Boolean_NitroPurchaseResult.kt +42 -0
  110. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.kt +42 -0
  111. package/nitrogen/generated/ios/NitroIap+autolinking.rb +60 -0
  112. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +152 -0
  113. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +1061 -0
  114. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +107 -0
  115. package/nitrogen/generated/ios/NitroIapAutolinking.mm +33 -0
  116. package/nitrogen/generated/ios/NitroIapAutolinking.swift +25 -0
  117. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.cpp +11 -0
  118. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +355 -0
  119. package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  120. package/nitrogen/generated/ios/swift/Func_void_NitroProduct.swift +47 -0
  121. package/nitrogen/generated/ios/swift/Func_void_NitroPurchase.swift +47 -0
  122. package/nitrogen/generated/ios/swift/Func_void_NitroPurchaseResult.swift +47 -0
  123. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  124. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  125. package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroProduct_.swift +54 -0
  126. package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroPurchase_.swift +54 -0
  127. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +54 -0
  128. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__vector_NitroSubscriptionStatus__.swift +54 -0
  129. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  130. package/nitrogen/generated/ios/swift/Func_void_std__variant_NitroReceiptValidationResultIOS__NitroReceiptValidationResultAndroid_.swift +59 -0
  131. package/nitrogen/generated/ios/swift/Func_void_std__variant_bool__NitroPurchaseResult_.swift +59 -0
  132. package/nitrogen/generated/ios/swift/Func_void_std__vector_NitroProduct_.swift +47 -0
  133. package/nitrogen/generated/ios/swift/Func_void_std__vector_NitroPurchase_.swift +47 -0
  134. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +78 -0
  135. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +750 -0
  136. package/nitrogen/generated/ios/swift/NitroAndroidReceiptValidationOptions.swift +80 -0
  137. package/nitrogen/generated/ios/swift/NitroAvailablePurchasesAndroidOptions.swift +54 -0
  138. package/nitrogen/generated/ios/swift/NitroAvailablePurchasesIosOptions.swift +116 -0
  139. package/nitrogen/generated/ios/swift/NitroAvailablePurchasesOptions.swift +84 -0
  140. package/nitrogen/generated/ios/swift/NitroFinishTransactionAndroidParams.swift +58 -0
  141. package/nitrogen/generated/ios/swift/NitroFinishTransactionIosParams.swift +35 -0
  142. package/nitrogen/generated/ios/swift/NitroFinishTransactionParams.swift +84 -0
  143. package/nitrogen/generated/ios/swift/NitroProduct.swift +653 -0
  144. package/nitrogen/generated/ios/swift/NitroPurchase.swift +453 -0
  145. package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +84 -0
  146. package/nitrogen/generated/ios/swift/NitroPurchaseResult.swift +117 -0
  147. package/nitrogen/generated/ios/swift/NitroReceiptValidationParams.swift +65 -0
  148. package/nitrogen/generated/ios/swift/NitroReceiptValidationResultAndroid.swift +258 -0
  149. package/nitrogen/generated/ios/swift/NitroReceiptValidationResultIOS.swift +87 -0
  150. package/nitrogen/generated/ios/swift/NitroRequestPurchaseAndroid.swift +225 -0
  151. package/nitrogen/generated/ios/swift/NitroRequestPurchaseIos.swift +161 -0
  152. package/nitrogen/generated/ios/swift/NitroSubscriptionOffer.swift +46 -0
  153. package/nitrogen/generated/ios/swift/NitroSubscriptionRenewalInfo.swift +152 -0
  154. package/nitrogen/generated/ios/swift/NitroSubscriptionStatus.swift +76 -0
  155. package/nitrogen/generated/ios/swift/Variant_Bool_NitroPurchaseResult.swift +18 -0
  156. package/nitrogen/generated/ios/swift/Variant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.swift +18 -0
  157. package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +50 -0
  158. package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +125 -0
  159. package/nitrogen/generated/shared/c++/NitroAndroidReceiptValidationOptions.hpp +80 -0
  160. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidOptions.hpp +68 -0
  161. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesIosOptions.hpp +79 -0
  162. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesOptions.hpp +76 -0
  163. package/nitrogen/generated/shared/c++/NitroFinishTransactionAndroidParams.hpp +72 -0
  164. package/nitrogen/generated/shared/c++/NitroFinishTransactionIosParams.hpp +67 -0
  165. package/nitrogen/generated/shared/c++/NitroFinishTransactionParams.hpp +76 -0
  166. package/nitrogen/generated/shared/c++/NitroProduct.hpp +168 -0
  167. package/nitrogen/generated/shared/c++/NitroPurchase.hpp +136 -0
  168. package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +76 -0
  169. package/nitrogen/generated/shared/c++/NitroPurchaseResult.hpp +84 -0
  170. package/nitrogen/generated/shared/c++/NitroReceiptValidationParams.hpp +74 -0
  171. package/nitrogen/generated/shared/c++/NitroReceiptValidationResultAndroid.hpp +136 -0
  172. package/nitrogen/generated/shared/c++/NitroReceiptValidationResultIOS.hpp +82 -0
  173. package/nitrogen/generated/shared/c++/NitroRequestPurchaseAndroid.hpp +95 -0
  174. package/nitrogen/generated/shared/c++/NitroRequestPurchaseIos.hpp +85 -0
  175. package/nitrogen/generated/shared/c++/NitroSubscriptionOffer.hpp +71 -0
  176. package/nitrogen/generated/shared/c++/NitroSubscriptionRenewalInfo.hpp +88 -0
  177. package/nitrogen/generated/shared/c++/NitroSubscriptionStatus.hpp +78 -0
  178. package/package.json +144 -104
  179. package/plugin/build/src/withIAP.d.ts +3 -0
  180. package/plugin/build/src/withIAP.js +81 -0
  181. package/plugin/build/tsconfig.tsbuildinfo +1 -0
  182. package/plugin/build/withIAP.d.ts +2 -7
  183. package/plugin/build/withIAP.js +62 -51
  184. package/plugin/src/withIAP.ts +119 -0
  185. package/plugin/tsconfig.json +18 -0
  186. package/plugin/tsconfig.tsbuildinfo +1 -0
  187. package/src/helpers/subscription.ts +65 -0
  188. package/src/hooks/useIAP.ts +361 -222
  189. package/src/index.ts +1194 -9
  190. package/src/specs/RnIap.nitro.ts +501 -0
  191. package/src/types.ts +680 -0
  192. package/src/utils/error.ts +97 -0
  193. package/src/utils/type-bridge.ts +209 -0
  194. package/LICENSE +0 -21
  195. package/RNIap.podspec +0 -36
  196. package/android/src/amazon/AndroidManifest.xml +0 -14
  197. package/android/src/amazon/java/com/dooboolab/rniap/EventSender.kt +0 -10
  198. package/android/src/amazon/java/com/dooboolab/rniap/PurchasingServiceProxy.kt +0 -29
  199. package/android/src/amazon/java/com/dooboolab/rniap/PurchasingServiceProxyAmazonImpl.kt +0 -31
  200. package/android/src/amazon/java/com/dooboolab/rniap/RNIapActivityListener.kt +0 -55
  201. package/android/src/amazon/java/com/dooboolab/rniap/RNIapAmazonListener.kt +0 -325
  202. package/android/src/amazon/java/com/dooboolab/rniap/RNIapAmazonModule.kt +0 -244
  203. package/android/src/amazon/java/com/dooboolab/rniap/RNIapPackage.kt +0 -17
  204. package/android/src/amazon/java/com/dooboolab/rniap/modifysubscription/RNIapAmazonModifySubscriptionListener.kt +0 -88
  205. package/android/src/amazon/java/com/dooboolab/rniap/utils/Extensions.kt +0 -22
  206. package/android/src/main/java/com/dooboolab/rniap/PromiseUtils.kt +0 -62
  207. package/android/src/main/java/com/dooboolab/rniap/PromiseUtlis.kt +0 -43
  208. package/android/src/play/java/com/dooboolab/rniap/PlayUtils.kt +0 -114
  209. package/android/src/play/java/com/dooboolab/rniap/RNIapActivityListener.kt +0 -15
  210. package/android/src/play/java/com/dooboolab/rniap/RNIapModule.kt +0 -911
  211. package/android/src/play/java/com/dooboolab/rniap/RNIapPackage.kt +0 -17
  212. package/android/src/testAmazon/java/com/dooboolab/rniap/RNIapAmazonModuleTest.kt +0 -170
  213. package/app.plugin.js +0 -1
  214. package/ios/IapSerializationUtils.swift +0 -290
  215. package/ios/IapTypes.swift +0 -56
  216. package/ios/IapUtils.swift +0 -40
  217. package/ios/LatestPromiseKeeper.swift +0 -52
  218. package/ios/RNIapIos-Bridging-Header.h +0 -2
  219. package/ios/RNIapIos.m +0 -69
  220. package/ios/RNIapIos.swift +0 -868
  221. package/ios/RNIapIos.xcodeproj/project.pbxproj +0 -289
  222. package/ios/RNIapIosSk2.m +0 -126
  223. package/ios/RNIapIosSk2.swift +0 -1413
  224. package/ios/ThreadSafe.swift +0 -18
  225. package/lib/commonjs/eventEmitter.js +0 -195
  226. package/lib/commonjs/eventEmitter.js.map +0 -1
  227. package/lib/commonjs/hooks/index.js +0 -17
  228. package/lib/commonjs/hooks/index.js.map +0 -1
  229. package/lib/commonjs/hooks/useIAP.js +0 -203
  230. package/lib/commonjs/hooks/useIAP.js.map +0 -1
  231. package/lib/commonjs/hooks/withIAPContext.js +0 -95
  232. package/lib/commonjs/hooks/withIAPContext.js.map +0 -1
  233. package/lib/commonjs/iap.js +0 -836
  234. package/lib/commonjs/iap.js.map +0 -1
  235. package/lib/commonjs/index.js +0 -105
  236. package/lib/commonjs/index.js.map +0 -1
  237. package/lib/commonjs/internal/enhancedFetch.js +0 -26
  238. package/lib/commonjs/internal/enhancedFetch.js.map +0 -1
  239. package/lib/commonjs/internal/fillProductsWithAdditionalData.js +0 -50
  240. package/lib/commonjs/internal/fillProductsWithAdditionalData.js.map +0 -1
  241. package/lib/commonjs/internal/index.js +0 -39
  242. package/lib/commonjs/internal/index.js.map +0 -1
  243. package/lib/commonjs/internal/platform.js +0 -119
  244. package/lib/commonjs/internal/platform.js.map +0 -1
  245. package/lib/commonjs/modules/amazon.js +0 -50
  246. package/lib/commonjs/modules/amazon.js.map +0 -1
  247. package/lib/commonjs/modules/android.js +0 -92
  248. package/lib/commonjs/modules/android.js.map +0 -1
  249. package/lib/commonjs/modules/common.js +0 -2
  250. package/lib/commonjs/modules/index.js +0 -50
  251. package/lib/commonjs/modules/index.js.map +0 -1
  252. package/lib/commonjs/modules/ios.js +0 -160
  253. package/lib/commonjs/modules/ios.js.map +0 -1
  254. package/lib/commonjs/modules/iosSk2.js +0 -113
  255. package/lib/commonjs/modules/iosSk2.js.map +0 -1
  256. package/lib/commonjs/purchaseError.js +0 -170
  257. package/lib/commonjs/purchaseError.js.map +0 -1
  258. package/lib/commonjs/types/amazon.js +0 -2
  259. package/lib/commonjs/types/amazon.js.map +0 -1
  260. package/lib/commonjs/types/android.js +0 -67
  261. package/lib/commonjs/types/android.js.map +0 -1
  262. package/lib/commonjs/types/apple.js +0 -24
  263. package/lib/commonjs/types/apple.js.map +0 -1
  264. package/lib/commonjs/types/appleSk2.js +0 -137
  265. package/lib/commonjs/types/appleSk2.js.map +0 -1
  266. package/lib/commonjs/types/index.js +0 -67
  267. package/lib/commonjs/types/index.js.map +0 -1
  268. package/lib/commonjs/utils/errorMapping.js +0 -83
  269. package/lib/commonjs/utils/errorMapping.js.map +0 -1
  270. package/lib/commonjs/utils/typeGuards.js +0 -74
  271. package/lib/commonjs/utils/typeGuards.js.map +0 -1
  272. package/lib/module/eventEmitter.js +0 -185
  273. package/lib/module/eventEmitter.js.map +0 -1
  274. package/lib/module/hooks/index.js +0 -2
  275. package/lib/module/hooks/index.js.map +0 -1
  276. package/lib/module/hooks/withIAPContext.js +0 -86
  277. package/lib/module/hooks/withIAPContext.js.map +0 -1
  278. package/lib/module/iap.js +0 -805
  279. package/lib/module/iap.js.map +0 -1
  280. package/lib/module/internal/enhancedFetch.js +0 -19
  281. package/lib/module/internal/enhancedFetch.js.map +0 -1
  282. package/lib/module/internal/fillProductsWithAdditionalData.js +0 -43
  283. package/lib/module/internal/fillProductsWithAdditionalData.js.map +0 -1
  284. package/lib/module/internal/index.js +0 -4
  285. package/lib/module/internal/index.js.map +0 -1
  286. package/lib/module/internal/platform.js +0 -102
  287. package/lib/module/internal/platform.js.map +0 -1
  288. package/lib/module/modules/amazon.js +0 -42
  289. package/lib/module/modules/amazon.js.map +0 -1
  290. package/lib/module/modules/android.js +0 -81
  291. package/lib/module/modules/android.js.map +0 -1
  292. package/lib/module/modules/common.js +0 -2
  293. package/lib/module/modules/common.js.map +0 -1
  294. package/lib/module/modules/index.js +0 -5
  295. package/lib/module/modules/index.js.map +0 -1
  296. package/lib/module/modules/ios.js +0 -145
  297. package/lib/module/modules/ios.js.map +0 -1
  298. package/lib/module/modules/iosSk2.js +0 -96
  299. package/lib/module/modules/iosSk2.js.map +0 -1
  300. package/lib/module/purchaseError.js +0 -164
  301. package/lib/module/purchaseError.js.map +0 -1
  302. package/lib/module/types/amazon.js +0 -2
  303. package/lib/module/types/amazon.js.map +0 -1
  304. package/lib/module/types/android.js +0 -63
  305. package/lib/module/types/android.js.map +0 -1
  306. package/lib/module/types/apple.js +0 -17
  307. package/lib/module/types/apple.js.map +0 -1
  308. package/lib/module/types/appleSk2.js +0 -129
  309. package/lib/module/types/appleSk2.js.map +0 -1
  310. package/lib/module/types/index.js +0 -75
  311. package/lib/module/types/index.js.map +0 -1
  312. package/lib/module/utils/errorMapping.js +0 -75
  313. package/lib/module/utils/errorMapping.js.map +0 -1
  314. package/lib/module/utils/typeGuards.js +0 -61
  315. package/lib/module/utils/typeGuards.js.map +0 -1
  316. package/lib/typescript/src/eventEmitter.d.ts +0 -151
  317. package/lib/typescript/src/eventEmitter.d.ts.map +0 -1
  318. package/lib/typescript/src/hooks/index.d.ts +0 -2
  319. package/lib/typescript/src/hooks/index.d.ts.map +0 -1
  320. package/lib/typescript/src/hooks/withIAPContext.d.ts +0 -27
  321. package/lib/typescript/src/hooks/withIAPContext.d.ts.map +0 -1
  322. package/lib/typescript/src/iap.d.ts +0 -503
  323. package/lib/typescript/src/iap.d.ts.map +0 -1
  324. package/lib/typescript/src/internal/enhancedFetch.d.ts +0 -6
  325. package/lib/typescript/src/internal/enhancedFetch.d.ts.map +0 -1
  326. package/lib/typescript/src/internal/fillProductsWithAdditionalData.d.ts +0 -7
  327. package/lib/typescript/src/internal/fillProductsWithAdditionalData.d.ts.map +0 -1
  328. package/lib/typescript/src/internal/index.d.ts +0 -4
  329. package/lib/typescript/src/internal/index.d.ts.map +0 -1
  330. package/lib/typescript/src/internal/platform.d.ts +0 -27
  331. package/lib/typescript/src/internal/platform.d.ts.map +0 -1
  332. package/lib/typescript/src/modules/amazon.d.ts +0 -55
  333. package/lib/typescript/src/modules/amazon.d.ts.map +0 -1
  334. package/lib/typescript/src/modules/android.d.ts +0 -74
  335. package/lib/typescript/src/modules/android.d.ts.map +0 -1
  336. package/lib/typescript/src/modules/common.d.ts +0 -14
  337. package/lib/typescript/src/modules/common.d.ts.map +0 -1
  338. package/lib/typescript/src/modules/index.d.ts +0 -5
  339. package/lib/typescript/src/modules/index.d.ts.map +0 -1
  340. package/lib/typescript/src/modules/ios.d.ts +0 -117
  341. package/lib/typescript/src/modules/ios.d.ts.map +0 -1
  342. package/lib/typescript/src/modules/iosSk2.d.ts +0 -140
  343. package/lib/typescript/src/modules/iosSk2.d.ts.map +0 -1
  344. package/lib/typescript/src/purchaseError.d.ts +0 -133
  345. package/lib/typescript/src/purchaseError.d.ts.map +0 -1
  346. package/lib/typescript/src/types/amazon.d.ts +0 -33
  347. package/lib/typescript/src/types/amazon.d.ts.map +0 -1
  348. package/lib/typescript/src/types/android.d.ts +0 -66
  349. package/lib/typescript/src/types/android.d.ts.map +0 -1
  350. package/lib/typescript/src/types/apple.d.ts +0 -27
  351. package/lib/typescript/src/types/apple.d.ts.map +0 -1
  352. package/lib/typescript/src/types/appleSk2.d.ts +0 -129
  353. package/lib/typescript/src/types/appleSk2.d.ts.map +0 -1
  354. package/lib/typescript/src/types/index.d.ts +0 -302
  355. package/lib/typescript/src/types/index.d.ts.map +0 -1
  356. package/lib/typescript/src/utils/errorMapping.d.ts +0 -29
  357. package/lib/typescript/src/utils/errorMapping.d.ts.map +0 -1
  358. package/lib/typescript/src/utils/typeGuards.d.ts +0 -53
  359. package/lib/typescript/src/utils/typeGuards.d.ts.map +0 -1
  360. package/src/eventEmitter.ts +0 -212
  361. package/src/hooks/index.ts +0 -1
  362. package/src/hooks/withIAPContext.tsx +0 -179
  363. package/src/iap.ts +0 -1046
  364. package/src/internal/enhancedFetch.ts +0 -25
  365. package/src/internal/fillProductsWithAdditionalData.ts +0 -47
  366. package/src/internal/index.ts +0 -3
  367. package/src/internal/platform.ts +0 -135
  368. package/src/modules/amazon.ts +0 -94
  369. package/src/modules/android.ts +0 -179
  370. package/src/modules/common.ts +0 -16
  371. package/src/modules/index.ts +0 -4
  372. package/src/modules/ios.ts +0 -229
  373. package/src/modules/iosSk2.ts +0 -194
  374. package/src/purchaseError.ts +0 -196
  375. package/src/types/amazon.ts +0 -40
  376. package/src/types/android.ts +0 -89
  377. package/src/types/apple.ts +0 -44
  378. package/src/types/appleSk2.ts +0 -275
  379. package/src/types/index.ts +0 -379
  380. package/src/utils/errorMapping.ts +0 -88
  381. package/src/utils/typeGuards.ts +0 -90
@@ -0,0 +1,107 @@
1
+ ///
2
+ /// NitroIap-Swift-Cxx-Umbrella.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ // Forward declarations of C++ defined types
11
+ // Forward declaration of `HybridRnIapSpec` to properly resolve imports.
12
+ namespace margelo::nitro::iap { class HybridRnIapSpec; }
13
+ // Forward declaration of `NitroAndroidReceiptValidationOptions` to properly resolve imports.
14
+ namespace margelo::nitro::iap { struct NitroAndroidReceiptValidationOptions; }
15
+ // Forward declaration of `NitroAvailablePurchasesAndroidOptions` to properly resolve imports.
16
+ namespace margelo::nitro::iap { struct NitroAvailablePurchasesAndroidOptions; }
17
+ // Forward declaration of `NitroAvailablePurchasesIosOptions` to properly resolve imports.
18
+ namespace margelo::nitro::iap { struct NitroAvailablePurchasesIosOptions; }
19
+ // Forward declaration of `NitroAvailablePurchasesOptions` to properly resolve imports.
20
+ namespace margelo::nitro::iap { struct NitroAvailablePurchasesOptions; }
21
+ // Forward declaration of `NitroFinishTransactionAndroidParams` to properly resolve imports.
22
+ namespace margelo::nitro::iap { struct NitroFinishTransactionAndroidParams; }
23
+ // Forward declaration of `NitroFinishTransactionIosParams` to properly resolve imports.
24
+ namespace margelo::nitro::iap { struct NitroFinishTransactionIosParams; }
25
+ // Forward declaration of `NitroFinishTransactionParams` to properly resolve imports.
26
+ namespace margelo::nitro::iap { struct NitroFinishTransactionParams; }
27
+ // Forward declaration of `NitroProduct` to properly resolve imports.
28
+ namespace margelo::nitro::iap { struct NitroProduct; }
29
+ // Forward declaration of `NitroPurchaseRequest` to properly resolve imports.
30
+ namespace margelo::nitro::iap { struct NitroPurchaseRequest; }
31
+ // Forward declaration of `NitroPurchaseResult` to properly resolve imports.
32
+ namespace margelo::nitro::iap { struct NitroPurchaseResult; }
33
+ // Forward declaration of `NitroPurchase` to properly resolve imports.
34
+ namespace margelo::nitro::iap { struct NitroPurchase; }
35
+ // Forward declaration of `NitroReceiptValidationParams` to properly resolve imports.
36
+ namespace margelo::nitro::iap { struct NitroReceiptValidationParams; }
37
+ // Forward declaration of `NitroReceiptValidationResultAndroid` to properly resolve imports.
38
+ namespace margelo::nitro::iap { struct NitroReceiptValidationResultAndroid; }
39
+ // Forward declaration of `NitroReceiptValidationResultIOS` to properly resolve imports.
40
+ namespace margelo::nitro::iap { struct NitroReceiptValidationResultIOS; }
41
+ // Forward declaration of `NitroRequestPurchaseAndroid` to properly resolve imports.
42
+ namespace margelo::nitro::iap { struct NitroRequestPurchaseAndroid; }
43
+ // Forward declaration of `NitroRequestPurchaseIos` to properly resolve imports.
44
+ namespace margelo::nitro::iap { struct NitroRequestPurchaseIos; }
45
+ // Forward declaration of `NitroSubscriptionOffer` to properly resolve imports.
46
+ namespace margelo::nitro::iap { struct NitroSubscriptionOffer; }
47
+ // Forward declaration of `NitroSubscriptionRenewalInfo` to properly resolve imports.
48
+ namespace margelo::nitro::iap { struct NitroSubscriptionRenewalInfo; }
49
+ // Forward declaration of `NitroSubscriptionStatus` to properly resolve imports.
50
+ namespace margelo::nitro::iap { struct NitroSubscriptionStatus; }
51
+
52
+ // Include C++ defined types
53
+ #include "HybridRnIapSpec.hpp"
54
+ #include "NitroAndroidReceiptValidationOptions.hpp"
55
+ #include "NitroAvailablePurchasesAndroidOptions.hpp"
56
+ #include "NitroAvailablePurchasesIosOptions.hpp"
57
+ #include "NitroAvailablePurchasesOptions.hpp"
58
+ #include "NitroFinishTransactionAndroidParams.hpp"
59
+ #include "NitroFinishTransactionIosParams.hpp"
60
+ #include "NitroFinishTransactionParams.hpp"
61
+ #include "NitroProduct.hpp"
62
+ #include "NitroPurchase.hpp"
63
+ #include "NitroPurchaseRequest.hpp"
64
+ #include "NitroPurchaseResult.hpp"
65
+ #include "NitroReceiptValidationParams.hpp"
66
+ #include "NitroReceiptValidationResultAndroid.hpp"
67
+ #include "NitroReceiptValidationResultIOS.hpp"
68
+ #include "NitroRequestPurchaseAndroid.hpp"
69
+ #include "NitroRequestPurchaseIos.hpp"
70
+ #include "NitroSubscriptionOffer.hpp"
71
+ #include "NitroSubscriptionRenewalInfo.hpp"
72
+ #include "NitroSubscriptionStatus.hpp"
73
+ #include <NitroModules/Promise.hpp>
74
+ #include <NitroModules/Result.hpp>
75
+ #include <exception>
76
+ #include <functional>
77
+ #include <memory>
78
+ #include <optional>
79
+ #include <string>
80
+ #include <unordered_map>
81
+ #include <variant>
82
+ #include <vector>
83
+
84
+ // C++ helpers for Swift
85
+ #include "NitroIap-Swift-Cxx-Bridge.hpp"
86
+
87
+ // Common C++ types used in Swift
88
+ #include <NitroModules/ArrayBufferHolder.hpp>
89
+ #include <NitroModules/AnyMapUtils.hpp>
90
+ #include <NitroModules/RuntimeError.hpp>
91
+ #include <NitroModules/DateToChronoDate.hpp>
92
+
93
+ // Forward declarations of Swift defined types
94
+ // Forward declaration of `HybridRnIapSpec_cxx` to properly resolve imports.
95
+ namespace NitroIap { class HybridRnIapSpec_cxx; }
96
+
97
+ // Include Swift defined types
98
+ #if __has_include("NitroIap-Swift.h")
99
+ // This header is generated by Xcode/Swift on every app build.
100
+ // If it cannot be found, make sure the Swift module's name (= podspec name) is actually "NitroIap".
101
+ #include "NitroIap-Swift.h"
102
+ // Same as above, but used when building with frameworks (`use_frameworks`)
103
+ #elif __has_include(<NitroIap/NitroIap-Swift.h>)
104
+ #include <NitroIap/NitroIap-Swift.h>
105
+ #else
106
+ #error NitroIap's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "NitroIap", and try building the app first.
107
+ #endif
@@ -0,0 +1,33 @@
1
+ ///
2
+ /// NitroIapAutolinking.mm
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <NitroModules/HybridObjectRegistry.hpp>
10
+ #import "NitroIap-Swift-Cxx-Umbrella.hpp"
11
+ #import <type_traits>
12
+
13
+ #include "HybridRnIapSpecSwift.hpp"
14
+
15
+ @interface NitroIapAutolinking : NSObject
16
+ @end
17
+
18
+ @implementation NitroIapAutolinking
19
+
20
+ + (void) load {
21
+ using namespace margelo::nitro;
22
+ using namespace margelo::nitro::iap;
23
+
24
+ HybridObjectRegistry::registerHybridObjectConstructor(
25
+ "RnIap",
26
+ []() -> std::shared_ptr<HybridObject> {
27
+ std::shared_ptr<HybridRnIapSpec> hybridObject = NitroIap::NitroIapAutolinking::createRnIap();
28
+ return hybridObject;
29
+ }
30
+ );
31
+ }
32
+
33
+ @end
@@ -0,0 +1,25 @@
1
+ ///
2
+ /// NitroIapAutolinking.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ public final class NitroIapAutolinking {
9
+ public typealias bridge = margelo.nitro.iap.bridge.swift
10
+
11
+ /**
12
+ * Creates an instance of a Swift class that implements `HybridRnIapSpec`,
13
+ * and wraps it in a Swift class that can directly interop with C++ (`HybridRnIapSpec_cxx`)
14
+ *
15
+ * This is generated by Nitrogen and will initialize the class specified
16
+ * in the `"autolinking"` property of `nitro.json` (in this case, `HybridRnIap`).
17
+ */
18
+ public static func createRnIap() -> bridge.std__shared_ptr_HybridRnIapSpec_ {
19
+ let hybridObject = HybridRnIap()
20
+ return { () -> bridge.std__shared_ptr_HybridRnIapSpec_ in
21
+ let __cxxWrapped = hybridObject.getCxxWrapper()
22
+ return __cxxWrapped.getCxxPart()
23
+ }()
24
+ }
25
+ }
@@ -0,0 +1,11 @@
1
+ ///
2
+ /// HybridRnIapSpecSwift.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "HybridRnIapSpecSwift.hpp"
9
+
10
+ namespace margelo::nitro::iap {
11
+ } // namespace margelo::nitro::iap
@@ -0,0 +1,355 @@
1
+ ///
2
+ /// HybridRnIapSpecSwift.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include "HybridRnIapSpec.hpp"
11
+
12
+ // Forward declaration of `HybridRnIapSpec_cxx` to properly resolve imports.
13
+ namespace NitroIap { class HybridRnIapSpec_cxx; }
14
+
15
+ // Forward declaration of `NitroProduct` to properly resolve imports.
16
+ namespace margelo::nitro::iap { struct NitroProduct; }
17
+ // Forward declaration of `NitroPurchaseRequest` to properly resolve imports.
18
+ namespace margelo::nitro::iap { struct NitroPurchaseRequest; }
19
+ // Forward declaration of `NitroRequestPurchaseIos` to properly resolve imports.
20
+ namespace margelo::nitro::iap { struct NitroRequestPurchaseIos; }
21
+ // Forward declaration of `NitroRequestPurchaseAndroid` to properly resolve imports.
22
+ namespace margelo::nitro::iap { struct NitroRequestPurchaseAndroid; }
23
+ // Forward declaration of `NitroSubscriptionOffer` to properly resolve imports.
24
+ namespace margelo::nitro::iap { struct NitroSubscriptionOffer; }
25
+ // Forward declaration of `NitroPurchase` to properly resolve imports.
26
+ namespace margelo::nitro::iap { struct NitroPurchase; }
27
+ // Forward declaration of `NitroAvailablePurchasesOptions` to properly resolve imports.
28
+ namespace margelo::nitro::iap { struct NitroAvailablePurchasesOptions; }
29
+ // Forward declaration of `NitroAvailablePurchasesIosOptions` to properly resolve imports.
30
+ namespace margelo::nitro::iap { struct NitroAvailablePurchasesIosOptions; }
31
+ // Forward declaration of `NitroAvailablePurchasesAndroidOptions` to properly resolve imports.
32
+ namespace margelo::nitro::iap { struct NitroAvailablePurchasesAndroidOptions; }
33
+ // Forward declaration of `NitroPurchaseResult` to properly resolve imports.
34
+ namespace margelo::nitro::iap { struct NitroPurchaseResult; }
35
+ // Forward declaration of `NitroFinishTransactionParams` to properly resolve imports.
36
+ namespace margelo::nitro::iap { struct NitroFinishTransactionParams; }
37
+ // Forward declaration of `NitroFinishTransactionIosParams` to properly resolve imports.
38
+ namespace margelo::nitro::iap { struct NitroFinishTransactionIosParams; }
39
+ // Forward declaration of `NitroFinishTransactionAndroidParams` to properly resolve imports.
40
+ namespace margelo::nitro::iap { struct NitroFinishTransactionAndroidParams; }
41
+ // Forward declaration of `NitroSubscriptionStatus` to properly resolve imports.
42
+ namespace margelo::nitro::iap { struct NitroSubscriptionStatus; }
43
+ // Forward declaration of `NitroSubscriptionRenewalInfo` to properly resolve imports.
44
+ namespace margelo::nitro::iap { struct NitroSubscriptionRenewalInfo; }
45
+ // Forward declaration of `NitroReceiptValidationResultIOS` to properly resolve imports.
46
+ namespace margelo::nitro::iap { struct NitroReceiptValidationResultIOS; }
47
+ // Forward declaration of `NitroReceiptValidationResultAndroid` to properly resolve imports.
48
+ namespace margelo::nitro::iap { struct NitroReceiptValidationResultAndroid; }
49
+ // Forward declaration of `NitroReceiptValidationParams` to properly resolve imports.
50
+ namespace margelo::nitro::iap { struct NitroReceiptValidationParams; }
51
+ // Forward declaration of `NitroAndroidReceiptValidationOptions` to properly resolve imports.
52
+ namespace margelo::nitro::iap { struct NitroAndroidReceiptValidationOptions; }
53
+
54
+ #include <NitroModules/Promise.hpp>
55
+ #include "NitroProduct.hpp"
56
+ #include <vector>
57
+ #include <string>
58
+ #include <optional>
59
+ #include "NitroPurchaseRequest.hpp"
60
+ #include "NitroRequestPurchaseIos.hpp"
61
+ #include <unordered_map>
62
+ #include "NitroRequestPurchaseAndroid.hpp"
63
+ #include "NitroSubscriptionOffer.hpp"
64
+ #include "NitroPurchase.hpp"
65
+ #include "NitroAvailablePurchasesOptions.hpp"
66
+ #include "NitroAvailablePurchasesIosOptions.hpp"
67
+ #include "NitroAvailablePurchasesAndroidOptions.hpp"
68
+ #include "NitroPurchaseResult.hpp"
69
+ #include <variant>
70
+ #include "NitroFinishTransactionParams.hpp"
71
+ #include "NitroFinishTransactionIosParams.hpp"
72
+ #include "NitroFinishTransactionAndroidParams.hpp"
73
+ #include <functional>
74
+ #include "NitroSubscriptionStatus.hpp"
75
+ #include "NitroSubscriptionRenewalInfo.hpp"
76
+ #include "NitroReceiptValidationResultIOS.hpp"
77
+ #include "NitroReceiptValidationResultAndroid.hpp"
78
+ #include "NitroReceiptValidationParams.hpp"
79
+ #include "NitroAndroidReceiptValidationOptions.hpp"
80
+
81
+ #include "NitroIap-Swift-Cxx-Umbrella.hpp"
82
+
83
+ namespace margelo::nitro::iap {
84
+
85
+ /**
86
+ * The C++ part of HybridRnIapSpec_cxx.swift.
87
+ *
88
+ * HybridRnIapSpecSwift (C++) accesses HybridRnIapSpec_cxx (Swift), and might
89
+ * contain some additional bridging code for C++ <> Swift interop.
90
+ *
91
+ * Since this obviously introduces an overhead, I hope at some point in
92
+ * the future, HybridRnIapSpec_cxx can directly inherit from the C++ class HybridRnIapSpec
93
+ * to simplify the whole structure and memory management.
94
+ */
95
+ class HybridRnIapSpecSwift: public virtual HybridRnIapSpec {
96
+ public:
97
+ // Constructor from a Swift instance
98
+ explicit HybridRnIapSpecSwift(const NitroIap::HybridRnIapSpec_cxx& swiftPart):
99
+ HybridObject(HybridRnIapSpec::TAG),
100
+ _swiftPart(swiftPart) { }
101
+
102
+ public:
103
+ // Get the Swift part
104
+ inline NitroIap::HybridRnIapSpec_cxx& getSwiftPart() noexcept {
105
+ return _swiftPart;
106
+ }
107
+
108
+ public:
109
+ inline size_t getExternalMemorySize() noexcept override {
110
+ return _swiftPart.getMemorySize();
111
+ }
112
+ void dispose() noexcept override {
113
+ _swiftPart.dispose();
114
+ }
115
+
116
+ public:
117
+ // Properties
118
+
119
+
120
+ public:
121
+ // Methods
122
+ inline std::shared_ptr<Promise<bool>> initConnection() override {
123
+ auto __result = _swiftPart.initConnection();
124
+ if (__result.hasError()) [[unlikely]] {
125
+ std::rethrow_exception(__result.error());
126
+ }
127
+ auto __value = std::move(__result.value());
128
+ return __value;
129
+ }
130
+ inline std::shared_ptr<Promise<bool>> endConnection() override {
131
+ auto __result = _swiftPart.endConnection();
132
+ if (__result.hasError()) [[unlikely]] {
133
+ std::rethrow_exception(__result.error());
134
+ }
135
+ auto __value = std::move(__result.value());
136
+ return __value;
137
+ }
138
+ inline std::shared_ptr<Promise<std::vector<NitroProduct>>> fetchProducts(const std::vector<std::string>& skus, const std::string& type) override {
139
+ auto __result = _swiftPart.fetchProducts(skus, type);
140
+ if (__result.hasError()) [[unlikely]] {
141
+ std::rethrow_exception(__result.error());
142
+ }
143
+ auto __value = std::move(__result.value());
144
+ return __value;
145
+ }
146
+ inline std::shared_ptr<Promise<void>> requestPurchase(const NitroPurchaseRequest& request) override {
147
+ auto __result = _swiftPart.requestPurchase(request);
148
+ if (__result.hasError()) [[unlikely]] {
149
+ std::rethrow_exception(__result.error());
150
+ }
151
+ auto __value = std::move(__result.value());
152
+ return __value;
153
+ }
154
+ inline std::shared_ptr<Promise<std::vector<NitroPurchase>>> getAvailablePurchases(const std::optional<NitroAvailablePurchasesOptions>& options) override {
155
+ auto __result = _swiftPart.getAvailablePurchases(options);
156
+ if (__result.hasError()) [[unlikely]] {
157
+ std::rethrow_exception(__result.error());
158
+ }
159
+ auto __value = std::move(__result.value());
160
+ return __value;
161
+ }
162
+ inline std::shared_ptr<Promise<std::variant<bool, NitroPurchaseResult>>> finishTransaction(const NitroFinishTransactionParams& params) override {
163
+ auto __result = _swiftPart.finishTransaction(params);
164
+ if (__result.hasError()) [[unlikely]] {
165
+ std::rethrow_exception(__result.error());
166
+ }
167
+ auto __value = std::move(__result.value());
168
+ return __value;
169
+ }
170
+ inline void addPurchaseUpdatedListener(const std::function<void(const NitroPurchase& /* purchase */)>& listener) override {
171
+ auto __result = _swiftPart.addPurchaseUpdatedListener(listener);
172
+ if (__result.hasError()) [[unlikely]] {
173
+ std::rethrow_exception(__result.error());
174
+ }
175
+ }
176
+ inline void addPurchaseErrorListener(const std::function<void(const NitroPurchaseResult& /* error */)>& listener) override {
177
+ auto __result = _swiftPart.addPurchaseErrorListener(listener);
178
+ if (__result.hasError()) [[unlikely]] {
179
+ std::rethrow_exception(__result.error());
180
+ }
181
+ }
182
+ inline void removePurchaseUpdatedListener(const std::function<void(const NitroPurchase& /* purchase */)>& listener) override {
183
+ auto __result = _swiftPart.removePurchaseUpdatedListener(listener);
184
+ if (__result.hasError()) [[unlikely]] {
185
+ std::rethrow_exception(__result.error());
186
+ }
187
+ }
188
+ inline void removePurchaseErrorListener(const std::function<void(const NitroPurchaseResult& /* error */)>& listener) override {
189
+ auto __result = _swiftPart.removePurchaseErrorListener(listener);
190
+ if (__result.hasError()) [[unlikely]] {
191
+ std::rethrow_exception(__result.error());
192
+ }
193
+ }
194
+ inline void addPromotedProductListenerIOS(const std::function<void(const NitroProduct& /* product */)>& listener) override {
195
+ auto __result = _swiftPart.addPromotedProductListenerIOS(listener);
196
+ if (__result.hasError()) [[unlikely]] {
197
+ std::rethrow_exception(__result.error());
198
+ }
199
+ }
200
+ inline void removePromotedProductListenerIOS(const std::function<void(const NitroProduct& /* product */)>& listener) override {
201
+ auto __result = _swiftPart.removePromotedProductListenerIOS(listener);
202
+ if (__result.hasError()) [[unlikely]] {
203
+ std::rethrow_exception(__result.error());
204
+ }
205
+ }
206
+ inline std::shared_ptr<Promise<std::string>> getStorefrontIOS() override {
207
+ auto __result = _swiftPart.getStorefrontIOS();
208
+ if (__result.hasError()) [[unlikely]] {
209
+ std::rethrow_exception(__result.error());
210
+ }
211
+ auto __value = std::move(__result.value());
212
+ return __value;
213
+ }
214
+ inline std::shared_ptr<Promise<std::optional<std::string>>> getAppTransactionIOS() override {
215
+ auto __result = _swiftPart.getAppTransactionIOS();
216
+ if (__result.hasError()) [[unlikely]] {
217
+ std::rethrow_exception(__result.error());
218
+ }
219
+ auto __value = std::move(__result.value());
220
+ return __value;
221
+ }
222
+ inline std::shared_ptr<Promise<std::optional<NitroProduct>>> requestPromotedProductIOS() override {
223
+ auto __result = _swiftPart.requestPromotedProductIOS();
224
+ if (__result.hasError()) [[unlikely]] {
225
+ std::rethrow_exception(__result.error());
226
+ }
227
+ auto __value = std::move(__result.value());
228
+ return __value;
229
+ }
230
+ inline std::shared_ptr<Promise<void>> buyPromotedProductIOS() override {
231
+ auto __result = _swiftPart.buyPromotedProductIOS();
232
+ if (__result.hasError()) [[unlikely]] {
233
+ std::rethrow_exception(__result.error());
234
+ }
235
+ auto __value = std::move(__result.value());
236
+ return __value;
237
+ }
238
+ inline std::shared_ptr<Promise<bool>> presentCodeRedemptionSheetIOS() override {
239
+ auto __result = _swiftPart.presentCodeRedemptionSheetIOS();
240
+ if (__result.hasError()) [[unlikely]] {
241
+ std::rethrow_exception(__result.error());
242
+ }
243
+ auto __value = std::move(__result.value());
244
+ return __value;
245
+ }
246
+ inline std::shared_ptr<Promise<void>> clearTransactionIOS() override {
247
+ auto __result = _swiftPart.clearTransactionIOS();
248
+ if (__result.hasError()) [[unlikely]] {
249
+ std::rethrow_exception(__result.error());
250
+ }
251
+ auto __value = std::move(__result.value());
252
+ return __value;
253
+ }
254
+ inline std::shared_ptr<Promise<std::optional<std::string>>> beginRefundRequestIOS(const std::string& sku) override {
255
+ auto __result = _swiftPart.beginRefundRequestIOS(sku);
256
+ if (__result.hasError()) [[unlikely]] {
257
+ std::rethrow_exception(__result.error());
258
+ }
259
+ auto __value = std::move(__result.value());
260
+ return __value;
261
+ }
262
+ inline std::shared_ptr<Promise<std::optional<std::vector<NitroSubscriptionStatus>>>> subscriptionStatusIOS(const std::string& sku) override {
263
+ auto __result = _swiftPart.subscriptionStatusIOS(sku);
264
+ if (__result.hasError()) [[unlikely]] {
265
+ std::rethrow_exception(__result.error());
266
+ }
267
+ auto __value = std::move(__result.value());
268
+ return __value;
269
+ }
270
+ inline std::shared_ptr<Promise<std::optional<NitroPurchase>>> currentEntitlementIOS(const std::string& sku) override {
271
+ auto __result = _swiftPart.currentEntitlementIOS(sku);
272
+ if (__result.hasError()) [[unlikely]] {
273
+ std::rethrow_exception(__result.error());
274
+ }
275
+ auto __value = std::move(__result.value());
276
+ return __value;
277
+ }
278
+ inline std::shared_ptr<Promise<std::optional<NitroPurchase>>> latestTransactionIOS(const std::string& sku) override {
279
+ auto __result = _swiftPart.latestTransactionIOS(sku);
280
+ if (__result.hasError()) [[unlikely]] {
281
+ std::rethrow_exception(__result.error());
282
+ }
283
+ auto __value = std::move(__result.value());
284
+ return __value;
285
+ }
286
+ inline std::shared_ptr<Promise<std::vector<NitroPurchase>>> getPendingTransactionsIOS() override {
287
+ auto __result = _swiftPart.getPendingTransactionsIOS();
288
+ if (__result.hasError()) [[unlikely]] {
289
+ std::rethrow_exception(__result.error());
290
+ }
291
+ auto __value = std::move(__result.value());
292
+ return __value;
293
+ }
294
+ inline std::shared_ptr<Promise<bool>> syncIOS() override {
295
+ auto __result = _swiftPart.syncIOS();
296
+ if (__result.hasError()) [[unlikely]] {
297
+ std::rethrow_exception(__result.error());
298
+ }
299
+ auto __value = std::move(__result.value());
300
+ return __value;
301
+ }
302
+ inline std::shared_ptr<Promise<bool>> showManageSubscriptionsIOS() override {
303
+ auto __result = _swiftPart.showManageSubscriptionsIOS();
304
+ if (__result.hasError()) [[unlikely]] {
305
+ std::rethrow_exception(__result.error());
306
+ }
307
+ auto __value = std::move(__result.value());
308
+ return __value;
309
+ }
310
+ inline std::shared_ptr<Promise<bool>> isEligibleForIntroOfferIOS(const std::string& groupID) override {
311
+ auto __result = _swiftPart.isEligibleForIntroOfferIOS(groupID);
312
+ if (__result.hasError()) [[unlikely]] {
313
+ std::rethrow_exception(__result.error());
314
+ }
315
+ auto __value = std::move(__result.value());
316
+ return __value;
317
+ }
318
+ inline std::shared_ptr<Promise<std::string>> getReceiptDataIOS() override {
319
+ auto __result = _swiftPart.getReceiptDataIOS();
320
+ if (__result.hasError()) [[unlikely]] {
321
+ std::rethrow_exception(__result.error());
322
+ }
323
+ auto __value = std::move(__result.value());
324
+ return __value;
325
+ }
326
+ inline std::shared_ptr<Promise<bool>> isTransactionVerifiedIOS(const std::string& sku) override {
327
+ auto __result = _swiftPart.isTransactionVerifiedIOS(sku);
328
+ if (__result.hasError()) [[unlikely]] {
329
+ std::rethrow_exception(__result.error());
330
+ }
331
+ auto __value = std::move(__result.value());
332
+ return __value;
333
+ }
334
+ inline std::shared_ptr<Promise<std::optional<std::string>>> getTransactionJwsIOS(const std::string& sku) override {
335
+ auto __result = _swiftPart.getTransactionJwsIOS(sku);
336
+ if (__result.hasError()) [[unlikely]] {
337
+ std::rethrow_exception(__result.error());
338
+ }
339
+ auto __value = std::move(__result.value());
340
+ return __value;
341
+ }
342
+ inline std::shared_ptr<Promise<std::variant<NitroReceiptValidationResultIOS, NitroReceiptValidationResultAndroid>>> validateReceipt(const NitroReceiptValidationParams& params) override {
343
+ auto __result = _swiftPart.validateReceipt(params);
344
+ if (__result.hasError()) [[unlikely]] {
345
+ std::rethrow_exception(__result.error());
346
+ }
347
+ auto __value = std::move(__result.value());
348
+ return __value;
349
+ }
350
+
351
+ private:
352
+ NitroIap::HybridRnIapSpec_cxx _swiftPart;
353
+ };
354
+
355
+ } // namespace margelo::nitro::iap
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+
11
+ /**
12
+ * Wraps a Swift `() -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void {
16
+ public typealias bridge = margelo.nitro.iap.bridge.swift
17
+
18
+ private let closure: () -> Void
19
+
20
+ public init(_ closure: @escaping () -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call() -> Void {
26
+ self.closure()
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void {
45
+ return Unmanaged<Func_void>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_NitroProduct.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+
11
+ /**
12
+ * Wraps a Swift `(_ product: NitroProduct) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_NitroProduct {
16
+ public typealias bridge = margelo.nitro.iap.bridge.swift
17
+
18
+ private let closure: (_ product: NitroProduct) -> Void
19
+
20
+ public init(_ closure: @escaping (_ product: NitroProduct) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(product: NitroProduct) -> Void {
26
+ self.closure(product)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_NitroProduct`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_NitroProduct>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_NitroProduct {
45
+ return Unmanaged<Func_void_NitroProduct>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_NitroPurchase.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import NitroModules
9
+
10
+
11
+ /**
12
+ * Wraps a Swift `(_ purchase: NitroPurchase) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_NitroPurchase {
16
+ public typealias bridge = margelo.nitro.iap.bridge.swift
17
+
18
+ private let closure: (_ purchase: NitroPurchase) -> Void
19
+
20
+ public init(_ closure: @escaping (_ purchase: NitroPurchase) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(purchase: NitroPurchase) -> Void {
26
+ self.closure(purchase)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_NitroPurchase`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_NitroPurchase>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_NitroPurchase {
45
+ return Unmanaged<Func_void_NitroPurchase>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }