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.
- package/NitroIap.podspec +33 -0
- package/README.md +163 -51
- package/android/CMakeLists.txt +32 -0
- package/android/build.gradle +107 -138
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -13
- package/android/src/main/AndroidManifest.xml +1 -4
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +843 -0
- package/android/src/main/java/com/margelo/nitro/iap/NitroIapPackage.java +33 -0
- package/android/src/main/java/com/margelo/nitro/iap/Types.kt +173 -0
- package/ios/Bridge.h +8 -0
- package/ios/ErrorUtils.swift +153 -0
- package/ios/HybridRnIap.swift +1326 -0
- package/ios/ProductStore.swift +33 -0
- package/ios/reactnativeiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/reactnativeiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/lib/module/helpers/subscription.js +56 -0
- package/lib/module/helpers/subscription.js.map +1 -0
- package/lib/module/hooks/useIAP.js +175 -123
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/index.js +1015 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/specs/RnIap.nitro.js +4 -0
- package/lib/{commonjs/modules/common.js.map → module/specs/RnIap.nitro.js.map} +1 -1
- package/lib/module/types.js +187 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils/error.js +80 -0
- package/lib/module/utils/error.js.map +1 -0
- package/lib/module/utils/type-bridge.js +202 -0
- package/lib/module/utils/type-bridge.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/plugin/src/withIAP.d.ts +2 -7
- package/lib/typescript/plugin/src/withIAP.d.ts.map +1 -1
- package/lib/typescript/scripts/check-nitro-versions.d.ts +3 -0
- package/lib/typescript/scripts/check-nitro-versions.d.ts.map +1 -0
- package/lib/typescript/src/helpers/subscription.d.ts +14 -0
- package/lib/typescript/src/helpers/subscription.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useIAP.d.ts +42 -26
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +356 -8
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +404 -0
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +544 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/error.d.ts +30 -0
- package/lib/typescript/src/utils/error.d.ts.map +1 -0
- package/lib/typescript/src/utils/type-bridge.d.ts +40 -0
- package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/NitroIap+autolinking.cmake +80 -0
- package/nitrogen/generated/android/NitroIap+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroIapOnLoad.cpp +50 -0
- package/nitrogen/generated/android/NitroIapOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +78 -0
- package/nitrogen/generated/android/c++/JFunc_void_NitroPurchase.hpp +78 -0
- package/nitrogen/generated/android/c++/JFunc_void_NitroPurchaseResult.hpp +78 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +577 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +93 -0
- package/nitrogen/generated/android/c++/JNitroAndroidReceiptValidationOptions.hpp +66 -0
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidOptions.hpp +54 -0
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesIosOptions.hpp +65 -0
- package/nitrogen/generated/android/c++/JNitroAvailablePurchasesOptions.hpp +62 -0
- package/nitrogen/generated/android/c++/JNitroFinishTransactionAndroidParams.hpp +58 -0
- package/nitrogen/generated/android/c++/JNitroFinishTransactionIosParams.hpp +53 -0
- package/nitrogen/generated/android/c++/JNitroFinishTransactionParams.hpp +62 -0
- package/nitrogen/generated/android/c++/JNitroProduct.hpp +154 -0
- package/nitrogen/generated/android/c++/JNitroPurchase.hpp +122 -0
- package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +66 -0
- package/nitrogen/generated/android/c++/JNitroPurchaseResult.hpp +70 -0
- package/nitrogen/generated/android/c++/JNitroReceiptValidationParams.hpp +60 -0
- package/nitrogen/generated/android/c++/JNitroReceiptValidationResultAndroid.hpp +122 -0
- package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +68 -0
- package/nitrogen/generated/android/c++/JNitroRequestPurchaseAndroid.hpp +115 -0
- package/nitrogen/generated/android/c++/JNitroRequestPurchaseIos.hpp +84 -0
- package/nitrogen/generated/android/c++/JNitroSubscriptionOffer.hpp +57 -0
- package/nitrogen/generated/android/c++/JNitroSubscriptionRenewalInfo.hpp +74 -0
- package/nitrogen/generated/android/c++/JNitroSubscriptionStatus.hpp +64 -0
- package/nitrogen/generated/android/c++/JVariant_Boolean_NitroPurchaseResult.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_Boolean_NitroPurchaseResult.hpp +71 -0
- package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.hpp +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroProduct.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchase.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchaseResult.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +198 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAndroidReceiptValidationOptions.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidOptions.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesIosOptions.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesOptions.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionAndroidParams.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionIosParams.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionParams.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroIapOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +104 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseResult.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationParams.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultAndroid.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultIOS.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseAndroid.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseIos.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionOffer.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionRenewalInfo.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionStatus.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_Boolean_NitroPurchaseResult.kt +42 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.kt +42 -0
- package/nitrogen/generated/ios/NitroIap+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +152 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +1061 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +107 -0
- package/nitrogen/generated/ios/NitroIapAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroIapAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +355 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_NitroProduct.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_NitroPurchase.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_NitroPurchaseResult.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroProduct_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroPurchase_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__vector_NitroSubscriptionStatus__.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_NitroReceiptValidationResultIOS__NitroReceiptValidationResultAndroid_.swift +59 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_bool__NitroPurchaseResult_.swift +59 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_NitroProduct_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_NitroPurchase_.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +78 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +750 -0
- package/nitrogen/generated/ios/swift/NitroAndroidReceiptValidationOptions.swift +80 -0
- package/nitrogen/generated/ios/swift/NitroAvailablePurchasesAndroidOptions.swift +54 -0
- package/nitrogen/generated/ios/swift/NitroAvailablePurchasesIosOptions.swift +116 -0
- package/nitrogen/generated/ios/swift/NitroAvailablePurchasesOptions.swift +84 -0
- package/nitrogen/generated/ios/swift/NitroFinishTransactionAndroidParams.swift +58 -0
- package/nitrogen/generated/ios/swift/NitroFinishTransactionIosParams.swift +35 -0
- package/nitrogen/generated/ios/swift/NitroFinishTransactionParams.swift +84 -0
- package/nitrogen/generated/ios/swift/NitroProduct.swift +653 -0
- package/nitrogen/generated/ios/swift/NitroPurchase.swift +453 -0
- package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +84 -0
- package/nitrogen/generated/ios/swift/NitroPurchaseResult.swift +117 -0
- package/nitrogen/generated/ios/swift/NitroReceiptValidationParams.swift +65 -0
- package/nitrogen/generated/ios/swift/NitroReceiptValidationResultAndroid.swift +258 -0
- package/nitrogen/generated/ios/swift/NitroReceiptValidationResultIOS.swift +87 -0
- package/nitrogen/generated/ios/swift/NitroRequestPurchaseAndroid.swift +225 -0
- package/nitrogen/generated/ios/swift/NitroRequestPurchaseIos.swift +161 -0
- package/nitrogen/generated/ios/swift/NitroSubscriptionOffer.swift +46 -0
- package/nitrogen/generated/ios/swift/NitroSubscriptionRenewalInfo.swift +152 -0
- package/nitrogen/generated/ios/swift/NitroSubscriptionStatus.swift +76 -0
- package/nitrogen/generated/ios/swift/Variant_Bool_NitroPurchaseResult.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.swift +18 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +50 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +125 -0
- package/nitrogen/generated/shared/c++/NitroAndroidReceiptValidationOptions.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidOptions.hpp +68 -0
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesIosOptions.hpp +79 -0
- package/nitrogen/generated/shared/c++/NitroAvailablePurchasesOptions.hpp +76 -0
- package/nitrogen/generated/shared/c++/NitroFinishTransactionAndroidParams.hpp +72 -0
- package/nitrogen/generated/shared/c++/NitroFinishTransactionIosParams.hpp +67 -0
- package/nitrogen/generated/shared/c++/NitroFinishTransactionParams.hpp +76 -0
- package/nitrogen/generated/shared/c++/NitroProduct.hpp +168 -0
- package/nitrogen/generated/shared/c++/NitroPurchase.hpp +136 -0
- package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +76 -0
- package/nitrogen/generated/shared/c++/NitroPurchaseResult.hpp +84 -0
- package/nitrogen/generated/shared/c++/NitroReceiptValidationParams.hpp +74 -0
- package/nitrogen/generated/shared/c++/NitroReceiptValidationResultAndroid.hpp +136 -0
- package/nitrogen/generated/shared/c++/NitroReceiptValidationResultIOS.hpp +82 -0
- package/nitrogen/generated/shared/c++/NitroRequestPurchaseAndroid.hpp +95 -0
- package/nitrogen/generated/shared/c++/NitroRequestPurchaseIos.hpp +85 -0
- package/nitrogen/generated/shared/c++/NitroSubscriptionOffer.hpp +71 -0
- package/nitrogen/generated/shared/c++/NitroSubscriptionRenewalInfo.hpp +88 -0
- package/nitrogen/generated/shared/c++/NitroSubscriptionStatus.hpp +78 -0
- package/package.json +144 -104
- package/plugin/build/src/withIAP.d.ts +3 -0
- package/plugin/build/src/withIAP.js +81 -0
- package/plugin/build/tsconfig.tsbuildinfo +1 -0
- package/plugin/build/withIAP.d.ts +2 -7
- package/plugin/build/withIAP.js +62 -51
- package/plugin/src/withIAP.ts +119 -0
- package/plugin/tsconfig.json +18 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/src/helpers/subscription.ts +65 -0
- package/src/hooks/useIAP.ts +361 -222
- package/src/index.ts +1194 -9
- package/src/specs/RnIap.nitro.ts +501 -0
- package/src/types.ts +680 -0
- package/src/utils/error.ts +97 -0
- package/src/utils/type-bridge.ts +209 -0
- package/LICENSE +0 -21
- package/RNIap.podspec +0 -36
- package/android/src/amazon/AndroidManifest.xml +0 -14
- package/android/src/amazon/java/com/dooboolab/rniap/EventSender.kt +0 -10
- package/android/src/amazon/java/com/dooboolab/rniap/PurchasingServiceProxy.kt +0 -29
- package/android/src/amazon/java/com/dooboolab/rniap/PurchasingServiceProxyAmazonImpl.kt +0 -31
- package/android/src/amazon/java/com/dooboolab/rniap/RNIapActivityListener.kt +0 -55
- package/android/src/amazon/java/com/dooboolab/rniap/RNIapAmazonListener.kt +0 -325
- package/android/src/amazon/java/com/dooboolab/rniap/RNIapAmazonModule.kt +0 -244
- package/android/src/amazon/java/com/dooboolab/rniap/RNIapPackage.kt +0 -17
- package/android/src/amazon/java/com/dooboolab/rniap/modifysubscription/RNIapAmazonModifySubscriptionListener.kt +0 -88
- package/android/src/amazon/java/com/dooboolab/rniap/utils/Extensions.kt +0 -22
- package/android/src/main/java/com/dooboolab/rniap/PromiseUtils.kt +0 -62
- package/android/src/main/java/com/dooboolab/rniap/PromiseUtlis.kt +0 -43
- package/android/src/play/java/com/dooboolab/rniap/PlayUtils.kt +0 -114
- package/android/src/play/java/com/dooboolab/rniap/RNIapActivityListener.kt +0 -15
- package/android/src/play/java/com/dooboolab/rniap/RNIapModule.kt +0 -911
- package/android/src/play/java/com/dooboolab/rniap/RNIapPackage.kt +0 -17
- package/android/src/testAmazon/java/com/dooboolab/rniap/RNIapAmazonModuleTest.kt +0 -170
- package/app.plugin.js +0 -1
- package/ios/IapSerializationUtils.swift +0 -290
- package/ios/IapTypes.swift +0 -56
- package/ios/IapUtils.swift +0 -40
- package/ios/LatestPromiseKeeper.swift +0 -52
- package/ios/RNIapIos-Bridging-Header.h +0 -2
- package/ios/RNIapIos.m +0 -69
- package/ios/RNIapIos.swift +0 -868
- package/ios/RNIapIos.xcodeproj/project.pbxproj +0 -289
- package/ios/RNIapIosSk2.m +0 -126
- package/ios/RNIapIosSk2.swift +0 -1413
- package/ios/ThreadSafe.swift +0 -18
- package/lib/commonjs/eventEmitter.js +0 -195
- package/lib/commonjs/eventEmitter.js.map +0 -1
- package/lib/commonjs/hooks/index.js +0 -17
- package/lib/commonjs/hooks/index.js.map +0 -1
- package/lib/commonjs/hooks/useIAP.js +0 -203
- package/lib/commonjs/hooks/useIAP.js.map +0 -1
- package/lib/commonjs/hooks/withIAPContext.js +0 -95
- package/lib/commonjs/hooks/withIAPContext.js.map +0 -1
- package/lib/commonjs/iap.js +0 -836
- package/lib/commonjs/iap.js.map +0 -1
- package/lib/commonjs/index.js +0 -105
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/internal/enhancedFetch.js +0 -26
- package/lib/commonjs/internal/enhancedFetch.js.map +0 -1
- package/lib/commonjs/internal/fillProductsWithAdditionalData.js +0 -50
- package/lib/commonjs/internal/fillProductsWithAdditionalData.js.map +0 -1
- package/lib/commonjs/internal/index.js +0 -39
- package/lib/commonjs/internal/index.js.map +0 -1
- package/lib/commonjs/internal/platform.js +0 -119
- package/lib/commonjs/internal/platform.js.map +0 -1
- package/lib/commonjs/modules/amazon.js +0 -50
- package/lib/commonjs/modules/amazon.js.map +0 -1
- package/lib/commonjs/modules/android.js +0 -92
- package/lib/commonjs/modules/android.js.map +0 -1
- package/lib/commonjs/modules/common.js +0 -2
- package/lib/commonjs/modules/index.js +0 -50
- package/lib/commonjs/modules/index.js.map +0 -1
- package/lib/commonjs/modules/ios.js +0 -160
- package/lib/commonjs/modules/ios.js.map +0 -1
- package/lib/commonjs/modules/iosSk2.js +0 -113
- package/lib/commonjs/modules/iosSk2.js.map +0 -1
- package/lib/commonjs/purchaseError.js +0 -170
- package/lib/commonjs/purchaseError.js.map +0 -1
- package/lib/commonjs/types/amazon.js +0 -2
- package/lib/commonjs/types/amazon.js.map +0 -1
- package/lib/commonjs/types/android.js +0 -67
- package/lib/commonjs/types/android.js.map +0 -1
- package/lib/commonjs/types/apple.js +0 -24
- package/lib/commonjs/types/apple.js.map +0 -1
- package/lib/commonjs/types/appleSk2.js +0 -137
- package/lib/commonjs/types/appleSk2.js.map +0 -1
- package/lib/commonjs/types/index.js +0 -67
- package/lib/commonjs/types/index.js.map +0 -1
- package/lib/commonjs/utils/errorMapping.js +0 -83
- package/lib/commonjs/utils/errorMapping.js.map +0 -1
- package/lib/commonjs/utils/typeGuards.js +0 -74
- package/lib/commonjs/utils/typeGuards.js.map +0 -1
- package/lib/module/eventEmitter.js +0 -185
- package/lib/module/eventEmitter.js.map +0 -1
- package/lib/module/hooks/index.js +0 -2
- package/lib/module/hooks/index.js.map +0 -1
- package/lib/module/hooks/withIAPContext.js +0 -86
- package/lib/module/hooks/withIAPContext.js.map +0 -1
- package/lib/module/iap.js +0 -805
- package/lib/module/iap.js.map +0 -1
- package/lib/module/internal/enhancedFetch.js +0 -19
- package/lib/module/internal/enhancedFetch.js.map +0 -1
- package/lib/module/internal/fillProductsWithAdditionalData.js +0 -43
- package/lib/module/internal/fillProductsWithAdditionalData.js.map +0 -1
- package/lib/module/internal/index.js +0 -4
- package/lib/module/internal/index.js.map +0 -1
- package/lib/module/internal/platform.js +0 -102
- package/lib/module/internal/platform.js.map +0 -1
- package/lib/module/modules/amazon.js +0 -42
- package/lib/module/modules/amazon.js.map +0 -1
- package/lib/module/modules/android.js +0 -81
- package/lib/module/modules/android.js.map +0 -1
- package/lib/module/modules/common.js +0 -2
- package/lib/module/modules/common.js.map +0 -1
- package/lib/module/modules/index.js +0 -5
- package/lib/module/modules/index.js.map +0 -1
- package/lib/module/modules/ios.js +0 -145
- package/lib/module/modules/ios.js.map +0 -1
- package/lib/module/modules/iosSk2.js +0 -96
- package/lib/module/modules/iosSk2.js.map +0 -1
- package/lib/module/purchaseError.js +0 -164
- package/lib/module/purchaseError.js.map +0 -1
- package/lib/module/types/amazon.js +0 -2
- package/lib/module/types/amazon.js.map +0 -1
- package/lib/module/types/android.js +0 -63
- package/lib/module/types/android.js.map +0 -1
- package/lib/module/types/apple.js +0 -17
- package/lib/module/types/apple.js.map +0 -1
- package/lib/module/types/appleSk2.js +0 -129
- package/lib/module/types/appleSk2.js.map +0 -1
- package/lib/module/types/index.js +0 -75
- package/lib/module/types/index.js.map +0 -1
- package/lib/module/utils/errorMapping.js +0 -75
- package/lib/module/utils/errorMapping.js.map +0 -1
- package/lib/module/utils/typeGuards.js +0 -61
- package/lib/module/utils/typeGuards.js.map +0 -1
- package/lib/typescript/src/eventEmitter.d.ts +0 -151
- package/lib/typescript/src/eventEmitter.d.ts.map +0 -1
- package/lib/typescript/src/hooks/index.d.ts +0 -2
- package/lib/typescript/src/hooks/index.d.ts.map +0 -1
- package/lib/typescript/src/hooks/withIAPContext.d.ts +0 -27
- package/lib/typescript/src/hooks/withIAPContext.d.ts.map +0 -1
- package/lib/typescript/src/iap.d.ts +0 -503
- package/lib/typescript/src/iap.d.ts.map +0 -1
- package/lib/typescript/src/internal/enhancedFetch.d.ts +0 -6
- package/lib/typescript/src/internal/enhancedFetch.d.ts.map +0 -1
- package/lib/typescript/src/internal/fillProductsWithAdditionalData.d.ts +0 -7
- package/lib/typescript/src/internal/fillProductsWithAdditionalData.d.ts.map +0 -1
- package/lib/typescript/src/internal/index.d.ts +0 -4
- package/lib/typescript/src/internal/index.d.ts.map +0 -1
- package/lib/typescript/src/internal/platform.d.ts +0 -27
- package/lib/typescript/src/internal/platform.d.ts.map +0 -1
- package/lib/typescript/src/modules/amazon.d.ts +0 -55
- package/lib/typescript/src/modules/amazon.d.ts.map +0 -1
- package/lib/typescript/src/modules/android.d.ts +0 -74
- package/lib/typescript/src/modules/android.d.ts.map +0 -1
- package/lib/typescript/src/modules/common.d.ts +0 -14
- package/lib/typescript/src/modules/common.d.ts.map +0 -1
- package/lib/typescript/src/modules/index.d.ts +0 -5
- package/lib/typescript/src/modules/index.d.ts.map +0 -1
- package/lib/typescript/src/modules/ios.d.ts +0 -117
- package/lib/typescript/src/modules/ios.d.ts.map +0 -1
- package/lib/typescript/src/modules/iosSk2.d.ts +0 -140
- package/lib/typescript/src/modules/iosSk2.d.ts.map +0 -1
- package/lib/typescript/src/purchaseError.d.ts +0 -133
- package/lib/typescript/src/purchaseError.d.ts.map +0 -1
- package/lib/typescript/src/types/amazon.d.ts +0 -33
- package/lib/typescript/src/types/amazon.d.ts.map +0 -1
- package/lib/typescript/src/types/android.d.ts +0 -66
- package/lib/typescript/src/types/android.d.ts.map +0 -1
- package/lib/typescript/src/types/apple.d.ts +0 -27
- package/lib/typescript/src/types/apple.d.ts.map +0 -1
- package/lib/typescript/src/types/appleSk2.d.ts +0 -129
- package/lib/typescript/src/types/appleSk2.d.ts.map +0 -1
- package/lib/typescript/src/types/index.d.ts +0 -302
- package/lib/typescript/src/types/index.d.ts.map +0 -1
- package/lib/typescript/src/utils/errorMapping.d.ts +0 -29
- package/lib/typescript/src/utils/errorMapping.d.ts.map +0 -1
- package/lib/typescript/src/utils/typeGuards.d.ts +0 -53
- package/lib/typescript/src/utils/typeGuards.d.ts.map +0 -1
- package/src/eventEmitter.ts +0 -212
- package/src/hooks/index.ts +0 -1
- package/src/hooks/withIAPContext.tsx +0 -179
- package/src/iap.ts +0 -1046
- package/src/internal/enhancedFetch.ts +0 -25
- package/src/internal/fillProductsWithAdditionalData.ts +0 -47
- package/src/internal/index.ts +0 -3
- package/src/internal/platform.ts +0 -135
- package/src/modules/amazon.ts +0 -94
- package/src/modules/android.ts +0 -179
- package/src/modules/common.ts +0 -16
- package/src/modules/index.ts +0 -4
- package/src/modules/ios.ts +0 -229
- package/src/modules/iosSk2.ts +0 -194
- package/src/purchaseError.ts +0 -196
- package/src/types/amazon.ts +0 -40
- package/src/types/android.ts +0 -89
- package/src/types/apple.ts +0 -44
- package/src/types/appleSk2.ts +0 -275
- package/src/types/index.ts +0 -379
- package/src/utils/errorMapping.ts +0 -88
- package/src/utils/typeGuards.ts +0 -90
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import StoreKit
|
|
3
|
+
|
|
4
|
+
@available(iOS 15.0, *)
|
|
5
|
+
actor ProductStore {
|
|
6
|
+
private(set) var products: [String: Product] = [:]
|
|
7
|
+
|
|
8
|
+
func addProduct(_ product: Product) {
|
|
9
|
+
self.products[product.id] = product
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
func addProducts(_ products: [Product]) {
|
|
13
|
+
for product in products {
|
|
14
|
+
self.products[product.id] = product
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
func getAllProducts() -> [Product] {
|
|
19
|
+
return Array(self.products.values)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
func getProduct(productID: String) -> Product? {
|
|
23
|
+
return self.products[productID]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
func removeAll() {
|
|
27
|
+
products.removeAll()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
func performOnActor(_ action: @escaping (isolated ProductStore) -> Void) async {
|
|
31
|
+
action(self)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { getAvailablePurchases } from "../index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get active subscriptions
|
|
6
|
+
* @param subscriptionIds - Optional array of subscription IDs to filter by
|
|
7
|
+
* @returns Promise<ActiveSubscription[]> - Array of active subscriptions
|
|
8
|
+
*/
|
|
9
|
+
export const getActiveSubscriptions = async subscriptionIds => {
|
|
10
|
+
try {
|
|
11
|
+
// Get available purchases and filter for subscriptions
|
|
12
|
+
const purchases = await getAvailablePurchases();
|
|
13
|
+
|
|
14
|
+
// Filter for subscriptions and map to ActiveSubscription format
|
|
15
|
+
const subscriptions = purchases.filter(purchase => {
|
|
16
|
+
// Filter by subscription IDs if provided
|
|
17
|
+
if (subscriptionIds && subscriptionIds.length > 0) {
|
|
18
|
+
return subscriptionIds.includes(purchase.productId);
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}).map(purchase => {
|
|
22
|
+
const iosPurchase = purchase;
|
|
23
|
+
return {
|
|
24
|
+
productId: purchase.productId,
|
|
25
|
+
isActive: true,
|
|
26
|
+
// If it's in availablePurchases, it's active
|
|
27
|
+
expirationDateIOS: iosPurchase.expirationDateIOS ? new Date(iosPurchase.expirationDateIOS) : undefined,
|
|
28
|
+
autoRenewingAndroid: purchase.autoRenewingAndroid,
|
|
29
|
+
environmentIOS: iosPurchase.environmentIOS,
|
|
30
|
+
willExpireSoon: false,
|
|
31
|
+
// Would need to calculate based on expiration date
|
|
32
|
+
daysUntilExpirationIOS: iosPurchase.expirationDateIOS ? Math.ceil((iosPurchase.expirationDateIOS - Date.now()) / (1000 * 60 * 60 * 24)) : undefined
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
return subscriptions;
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error('Failed to get active subscriptions:', error);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if there are any active subscriptions
|
|
44
|
+
* @param subscriptionIds - Optional array of subscription IDs to check
|
|
45
|
+
* @returns Promise<boolean> - True if there are active subscriptions
|
|
46
|
+
*/
|
|
47
|
+
export const hasActiveSubscriptions = async subscriptionIds => {
|
|
48
|
+
try {
|
|
49
|
+
const activeSubscriptions = await getActiveSubscriptions(subscriptionIds);
|
|
50
|
+
return activeSubscriptions.length > 0;
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error('Failed to check active subscriptions:', error);
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getAvailablePurchases","getActiveSubscriptions","subscriptionIds","purchases","subscriptions","filter","purchase","length","includes","productId","map","iosPurchase","isActive","expirationDateIOS","Date","undefined","autoRenewingAndroid","environmentIOS","willExpireSoon","daysUntilExpirationIOS","Math","ceil","now","error","console","hasActiveSubscriptions","activeSubscriptions"],"sourceRoot":"../../../src","sources":["helpers/subscription.ts"],"mappings":";;AAAA,SAAQA,qBAAqB,QAAO,aAAK;AAOzC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAG,MACpCC,eAA0B,IACQ;EAClC,IAAI;IACF;IACA,MAAMC,SAAS,GAAG,MAAMH,qBAAqB,CAAC,CAAC;;IAE/C;IACA,MAAMI,aAAa,GAAGD,SAAS,CAC5BE,MAAM,CAAEC,QAAQ,IAAK;MACpB;MACA,IAAIJ,eAAe,IAAIA,eAAe,CAACK,MAAM,GAAG,CAAC,EAAE;QACjD,OAAOL,eAAe,CAACM,QAAQ,CAACF,QAAQ,CAACG,SAAS,CAAC;MACrD;MACA,OAAO,IAAI;IACb,CAAC,CAAC,CACDC,GAAG,CAAEJ,QAAQ,IAAyB;MACrC,MAAMK,WAAW,GAAGL,QAAuB;MAC3C,OAAO;QACLG,SAAS,EAAEH,QAAQ,CAACG,SAAS;QAC7BG,QAAQ,EAAE,IAAI;QAAE;QAChBC,iBAAiB,EAAEF,WAAW,CAACE,iBAAiB,GAAG,IAAIC,IAAI,CAACH,WAAW,CAACE,iBAAiB,CAAC,GAAGE,SAAS;QACtGC,mBAAmB,EAAGV,QAAQ,CAAqBU,mBAAmB;QACtEC,cAAc,EAAEN,WAAW,CAACM,cAAc;QAC1CC,cAAc,EAAE,KAAK;QAAE;QACvBC,sBAAsB,EAAER,WAAW,CAACE,iBAAiB,GACnDO,IAAI,CAACC,IAAI,CAAC,CAACV,WAAW,CAACE,iBAAiB,GAAGC,IAAI,CAACQ,GAAG,CAAC,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,GAAGP;MACtF,CAAC;IACH,CAAC,CAAC;IAEJ,OAAOX,aAAa;EACtB,CAAC,CAAC,OAAOmB,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,qCAAqC,EAAEA,KAAK,CAAC;IAC3D,MAAMA,KAAK;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,sBAAsB,GAAG,MACpCvB,eAA0B,IACL;EACrB,IAAI;IACF,MAAMwB,mBAAmB,GAAG,MAAMzB,sBAAsB,CAACC,eAAe,CAAC;IACzE,OAAOwB,mBAAmB,CAACnB,MAAM,GAAG,CAAC;EACvC,CAAC,CAAC,OAAOgB,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,uCAAuC,EAAEA,KAAK,CAAC;IAC7D,OAAO,KAAK;EACd;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// External dependencies
|
|
4
|
+
import { useCallback, useEffect, useState, useRef } from 'react';
|
|
2
5
|
import { Platform } from 'react-native';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
|
|
7
|
+
// Internal modules
|
|
8
|
+
import { endConnection, initConnection, purchaseErrorListener, purchaseUpdatedListener, promotedProductListenerIOS, getAvailablePurchases, finishTransaction as finishTransactionInternal, requestPurchase as requestPurchaseInternal, fetchProducts, validateReceipt as validateReceiptInternal, getActiveSubscriptions, hasActiveSubscriptions } from "../index.js";
|
|
9
|
+
import { syncIOS, requestPromotedProductIOS, buyPromotedProductIOS } from "../index.js";
|
|
10
|
+
|
|
11
|
+
// Types
|
|
12
|
+
|
|
13
|
+
// Types for event subscriptions
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* React Hook for managing In-App Purchases.
|
|
17
|
+
* See documentation at https://expo-iap.hyo.dev/docs/hooks/useIAP
|
|
18
|
+
*/
|
|
19
|
+
export function useIAP(options) {
|
|
20
|
+
const [connected, setConnected] = useState(false);
|
|
21
|
+
const [products, setProducts] = useState([]);
|
|
22
|
+
const [promotedProductsIOS] = useState([]);
|
|
23
|
+
const [subscriptions, setSubscriptions] = useState([]);
|
|
24
|
+
const [availablePurchases, setAvailablePurchases] = useState([]);
|
|
25
|
+
const [currentPurchase, setCurrentPurchase] = useState();
|
|
26
|
+
const [promotedProductIOS, setPromotedProductIOS] = useState();
|
|
27
|
+
const [currentPurchaseError, setCurrentPurchaseError] = useState();
|
|
28
|
+
const [promotedProductIdIOS] = useState();
|
|
29
|
+
const [activeSubscriptions, setActiveSubscriptions] = useState([]);
|
|
25
30
|
const optionsRef = useRef(options);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
optionsRef.current = options;
|
|
28
|
-
}, [options]);
|
|
29
31
|
|
|
30
32
|
// Helper function to merge arrays with duplicate checking
|
|
31
33
|
const mergeWithDuplicateCheck = useCallback((existingItems, newItems, getKey) => {
|
|
@@ -38,159 +40,209 @@ export const useIAP = options => {
|
|
|
38
40
|
});
|
|
39
41
|
return merged;
|
|
40
42
|
}, []);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
optionsRef.current = options;
|
|
45
|
+
}, [options]);
|
|
46
|
+
const subscriptionsRef = useRef({});
|
|
47
|
+
const subscriptionsRefState = useRef([]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
subscriptionsRefState.current = subscriptions;
|
|
50
|
+
}, [subscriptions]);
|
|
41
51
|
const clearCurrentPurchase = useCallback(() => {
|
|
42
52
|
setCurrentPurchase(undefined);
|
|
43
|
-
}, [
|
|
53
|
+
}, []);
|
|
44
54
|
const clearCurrentPurchaseError = useCallback(() => {
|
|
45
55
|
setCurrentPurchaseError(undefined);
|
|
46
|
-
}, [
|
|
47
|
-
const
|
|
48
|
-
skus
|
|
49
|
-
}) => {
|
|
56
|
+
}, []);
|
|
57
|
+
const getProductsInternal = useCallback(async skus => {
|
|
50
58
|
try {
|
|
51
|
-
const result = await
|
|
52
|
-
skus
|
|
59
|
+
const result = await fetchProducts({
|
|
60
|
+
skus,
|
|
61
|
+
type: 'inapp'
|
|
53
62
|
});
|
|
54
|
-
setProducts(mergeWithDuplicateCheck(
|
|
63
|
+
setProducts(prevProducts => mergeWithDuplicateCheck(prevProducts, result, product => product.id));
|
|
55
64
|
} catch (error) {
|
|
56
|
-
console.error('Error
|
|
65
|
+
console.error('Error fetching products:', error);
|
|
57
66
|
}
|
|
58
|
-
}, [
|
|
59
|
-
const
|
|
60
|
-
skus
|
|
61
|
-
}) => {
|
|
67
|
+
}, [mergeWithDuplicateCheck]);
|
|
68
|
+
const getSubscriptionsInternal = useCallback(async skus => {
|
|
62
69
|
try {
|
|
63
|
-
const result = await
|
|
64
|
-
skus
|
|
70
|
+
const result = await fetchProducts({
|
|
71
|
+
skus,
|
|
72
|
+
type: 'subs'
|
|
65
73
|
});
|
|
66
|
-
setSubscriptions(mergeWithDuplicateCheck(
|
|
74
|
+
setSubscriptions(prevSubscriptions => mergeWithDuplicateCheck(prevSubscriptions, result, subscription => subscription.id));
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error('Error fetching subscriptions:', error);
|
|
77
|
+
}
|
|
78
|
+
}, [mergeWithDuplicateCheck]);
|
|
79
|
+
const fetchProductsInternal = useCallback(async params => {
|
|
80
|
+
try {
|
|
81
|
+
const result = await fetchProducts(params);
|
|
82
|
+
if (params.type === 'subs') {
|
|
83
|
+
setSubscriptions(prevSubscriptions => mergeWithDuplicateCheck(prevSubscriptions, result, subscription => subscription.id));
|
|
84
|
+
} else {
|
|
85
|
+
setProducts(prevProducts => mergeWithDuplicateCheck(prevProducts, result, product => product.id));
|
|
86
|
+
}
|
|
67
87
|
} catch (error) {
|
|
68
|
-
console.error('Error
|
|
88
|
+
console.error('Error fetching products:', error);
|
|
69
89
|
}
|
|
70
|
-
}, [
|
|
71
|
-
const
|
|
90
|
+
}, [mergeWithDuplicateCheck]);
|
|
91
|
+
const getAvailablePurchasesInternal = useCallback(async () => {
|
|
72
92
|
try {
|
|
73
|
-
const result = await
|
|
93
|
+
const result = await getAvailablePurchases();
|
|
74
94
|
setAvailablePurchases(result);
|
|
75
95
|
} catch (error) {
|
|
76
|
-
console.error('Error
|
|
96
|
+
console.error('Error fetching available purchases:', error);
|
|
97
|
+
}
|
|
98
|
+
}, []);
|
|
99
|
+
const getActiveSubscriptionsInternal = useCallback(async subscriptionIds => {
|
|
100
|
+
try {
|
|
101
|
+
const result = await getActiveSubscriptions(subscriptionIds);
|
|
102
|
+
setActiveSubscriptions(result);
|
|
103
|
+
return result;
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error('Error getting active subscriptions:', error);
|
|
106
|
+
// Don't clear existing activeSubscriptions on error - preserve current state
|
|
107
|
+
// This prevents the UI from showing empty state when there are temporary network issues
|
|
108
|
+
return [];
|
|
77
109
|
}
|
|
78
|
-
}, [
|
|
79
|
-
const
|
|
110
|
+
}, []);
|
|
111
|
+
const hasActiveSubscriptionsInternal = useCallback(async subscriptionIds => {
|
|
80
112
|
try {
|
|
81
|
-
|
|
82
|
-
setPurchaseHistory(result);
|
|
113
|
+
return await hasActiveSubscriptions(subscriptionIds);
|
|
83
114
|
} catch (error) {
|
|
84
|
-
console.error('Error
|
|
115
|
+
console.error('Error checking active subscriptions:', error);
|
|
116
|
+
return false;
|
|
85
117
|
}
|
|
86
|
-
}, [
|
|
118
|
+
}, []);
|
|
87
119
|
const finishTransaction = useCallback(async ({
|
|
88
120
|
purchase,
|
|
89
|
-
isConsumable
|
|
90
|
-
developerPayloadAndroid
|
|
121
|
+
isConsumable
|
|
91
122
|
}) => {
|
|
92
123
|
try {
|
|
93
|
-
return await
|
|
124
|
+
return await finishTransactionInternal({
|
|
94
125
|
purchase,
|
|
95
|
-
isConsumable
|
|
96
|
-
developerPayloadAndroid
|
|
126
|
+
isConsumable
|
|
97
127
|
});
|
|
98
128
|
} catch (err) {
|
|
99
129
|
throw err;
|
|
100
130
|
} finally {
|
|
101
|
-
if (purchase.
|
|
102
|
-
|
|
131
|
+
if (purchase.id === currentPurchase?.id) {
|
|
132
|
+
clearCurrentPurchase();
|
|
103
133
|
}
|
|
104
|
-
if (purchase.
|
|
105
|
-
|
|
134
|
+
if (purchase.id === currentPurchaseError?.productId) {
|
|
135
|
+
clearCurrentPurchaseError();
|
|
106
136
|
}
|
|
107
137
|
}
|
|
108
|
-
}, [currentPurchase
|
|
109
|
-
const
|
|
138
|
+
}, [currentPurchase?.id, currentPurchaseError?.productId, clearCurrentPurchase, clearCurrentPurchaseError]);
|
|
139
|
+
const requestPurchaseWithReset = useCallback(async requestObj => {
|
|
140
|
+
clearCurrentPurchase();
|
|
141
|
+
clearCurrentPurchaseError();
|
|
110
142
|
try {
|
|
111
|
-
|
|
112
|
-
// Try to sync with store on iOS
|
|
113
|
-
if (Platform.OS === 'ios' && ((_optionsRef$current = optionsRef.current) === null || _optionsRef$current === void 0 ? void 0 : _optionsRef$current.shouldAutoSyncPurchases) !== false) {
|
|
114
|
-
try {
|
|
115
|
-
await sync();
|
|
116
|
-
} catch (syncError) {
|
|
117
|
-
var _optionsRef$current2, _optionsRef$current2$;
|
|
118
|
-
console.error('Sync error:', syncError);
|
|
119
|
-
(_optionsRef$current2 = optionsRef.current) === null || _optionsRef$current2 === void 0 || (_optionsRef$current2$ = _optionsRef$current2.onSyncError) === null || _optionsRef$current2$ === void 0 || _optionsRef$current2$.call(_optionsRef$current2, syncError);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Get available purchases
|
|
124
|
-
await getAvailablePurchases();
|
|
143
|
+
return await requestPurchaseInternal(requestObj);
|
|
125
144
|
} catch (error) {
|
|
126
|
-
console.error('Error restoring purchases:', error);
|
|
127
145
|
throw error;
|
|
128
146
|
}
|
|
129
|
-
}, [
|
|
130
|
-
const
|
|
147
|
+
}, [clearCurrentPurchase, clearCurrentPurchaseError]);
|
|
148
|
+
const refreshSubscriptionStatus = useCallback(async productId => {
|
|
149
|
+
try {
|
|
150
|
+
if (subscriptionsRefState.current.some(sub => sub.id === productId)) {
|
|
151
|
+
await getSubscriptionsInternal([productId]);
|
|
152
|
+
await getAvailablePurchasesInternal();
|
|
153
|
+
}
|
|
154
|
+
} catch (error) {
|
|
155
|
+
console.warn('Failed to refresh subscription status:', error);
|
|
156
|
+
}
|
|
157
|
+
}, [getAvailablePurchasesInternal, getSubscriptionsInternal]);
|
|
158
|
+
const restorePurchases = useCallback(async () => {
|
|
131
159
|
try {
|
|
132
160
|
if (Platform.OS === 'ios') {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return {
|
|
141
|
-
isValid: false,
|
|
142
|
-
message: 'Android receipt validation should be performed server-side'
|
|
143
|
-
};
|
|
161
|
+
await syncIOS().catch(error => {
|
|
162
|
+
if (optionsRef.current?.onSyncError) {
|
|
163
|
+
optionsRef.current.onSyncError(error);
|
|
164
|
+
} else {
|
|
165
|
+
console.warn('Error restoring purchases:', error);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
144
168
|
}
|
|
145
|
-
|
|
169
|
+
await getAvailablePurchasesInternal();
|
|
146
170
|
} catch (error) {
|
|
147
|
-
console.
|
|
148
|
-
throw error;
|
|
171
|
+
console.warn('Failed to restore purchases:', error);
|
|
149
172
|
}
|
|
173
|
+
}, [getAvailablePurchasesInternal]);
|
|
174
|
+
const validateReceipt = useCallback(async (sku, androidOptions) => {
|
|
175
|
+
return validateReceiptInternal(sku, androidOptions);
|
|
150
176
|
}, []);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
177
|
+
const initIapWithSubscriptions = useCallback(async () => {
|
|
178
|
+
const result = await initConnection();
|
|
179
|
+
setConnected(result);
|
|
180
|
+
if (result) {
|
|
181
|
+
subscriptionsRef.current.purchaseUpdate = purchaseUpdatedListener(async purchase => {
|
|
182
|
+
setCurrentPurchaseError(undefined);
|
|
183
|
+
setCurrentPurchase(purchase);
|
|
184
|
+
if ('expirationDateIOS' in purchase) {
|
|
185
|
+
await refreshSubscriptionStatus(purchase.id);
|
|
186
|
+
}
|
|
187
|
+
if (optionsRef.current?.onPurchaseSuccess) {
|
|
188
|
+
optionsRef.current.onPurchaseSuccess(purchase);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
subscriptionsRef.current.purchaseError = purchaseErrorListener(error => {
|
|
192
|
+
setCurrentPurchase(undefined);
|
|
193
|
+
setCurrentPurchaseError(error);
|
|
194
|
+
if (optionsRef.current?.onPurchaseError) {
|
|
195
|
+
optionsRef.current.onPurchaseError(error);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
if (Platform.OS === 'ios') {
|
|
199
|
+
// iOS promoted products listener
|
|
200
|
+
subscriptionsRef.current.promotedProductsIOS = promotedProductListenerIOS(product => {
|
|
201
|
+
setPromotedProductIOS(product);
|
|
202
|
+
if (optionsRef.current?.onPromotedProductIOS) {
|
|
203
|
+
optionsRef.current.onPromotedProductIOS(product);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
163
207
|
}
|
|
164
|
-
}, [
|
|
208
|
+
}, [refreshSubscriptionStatus]);
|
|
165
209
|
useEffect(() => {
|
|
166
|
-
|
|
210
|
+
initIapWithSubscriptions();
|
|
211
|
+
const currentSubscriptions = subscriptionsRef.current;
|
|
167
212
|
return () => {
|
|
213
|
+
currentSubscriptions.purchaseUpdate?.remove();
|
|
214
|
+
currentSubscriptions.purchaseError?.remove();
|
|
215
|
+
currentSubscriptions.promotedProductsIOS?.remove();
|
|
216
|
+
currentSubscriptions.promotedProductIOS?.remove();
|
|
217
|
+
endConnection();
|
|
168
218
|
setConnected(false);
|
|
169
|
-
setCurrentPurchaseError(undefined);
|
|
170
219
|
};
|
|
171
|
-
|
|
172
|
-
}, []);
|
|
220
|
+
}, [initIapWithSubscriptions]);
|
|
173
221
|
return {
|
|
174
222
|
connected,
|
|
175
223
|
products,
|
|
176
224
|
promotedProductsIOS,
|
|
225
|
+
promotedProductIdIOS,
|
|
177
226
|
subscriptions,
|
|
178
|
-
|
|
227
|
+
finishTransaction,
|
|
179
228
|
availablePurchases,
|
|
180
229
|
currentPurchase,
|
|
181
230
|
currentPurchaseError,
|
|
182
|
-
|
|
231
|
+
promotedProductIOS,
|
|
232
|
+
activeSubscriptions,
|
|
183
233
|
clearCurrentPurchase,
|
|
184
234
|
clearCurrentPurchaseError,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
getPurchaseHistory,
|
|
190
|
-
requestPurchase: iapRequestPurchase,
|
|
191
|
-
requestSubscription: iapRequestSubscription,
|
|
235
|
+
getAvailablePurchases: getAvailablePurchasesInternal,
|
|
236
|
+
fetchProducts: fetchProductsInternal,
|
|
237
|
+
requestPurchase: requestPurchaseWithReset,
|
|
238
|
+
validateReceipt,
|
|
192
239
|
restorePurchases,
|
|
193
|
-
|
|
240
|
+
getProducts: getProductsInternal,
|
|
241
|
+
getSubscriptions: getSubscriptionsInternal,
|
|
242
|
+
requestPromotedProductIOS,
|
|
243
|
+
buyPromotedProductIOS,
|
|
244
|
+
getActiveSubscriptions: getActiveSubscriptionsInternal,
|
|
245
|
+
hasActiveSubscriptions: hasActiveSubscriptionsInternal
|
|
194
246
|
};
|
|
195
|
-
}
|
|
247
|
+
}
|
|
196
248
|
//# sourceMappingURL=useIAP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useEffect","useRef","Platform","
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useState","useRef","Platform","endConnection","initConnection","purchaseErrorListener","purchaseUpdatedListener","promotedProductListenerIOS","getAvailablePurchases","finishTransaction","finishTransactionInternal","requestPurchase","requestPurchaseInternal","fetchProducts","validateReceipt","validateReceiptInternal","getActiveSubscriptions","hasActiveSubscriptions","syncIOS","requestPromotedProductIOS","buyPromotedProductIOS","useIAP","options","connected","setConnected","products","setProducts","promotedProductsIOS","subscriptions","setSubscriptions","availablePurchases","setAvailablePurchases","currentPurchase","setCurrentPurchase","promotedProductIOS","setPromotedProductIOS","currentPurchaseError","setCurrentPurchaseError","promotedProductIdIOS","activeSubscriptions","setActiveSubscriptions","optionsRef","mergeWithDuplicateCheck","existingItems","newItems","getKey","merged","forEach","newItem","isDuplicate","some","existingItem","push","current","subscriptionsRef","subscriptionsRefState","clearCurrentPurchase","undefined","clearCurrentPurchaseError","getProductsInternal","skus","result","type","prevProducts","product","id","error","console","getSubscriptionsInternal","prevSubscriptions","subscription","fetchProductsInternal","params","getAvailablePurchasesInternal","getActiveSubscriptionsInternal","subscriptionIds","hasActiveSubscriptionsInternal","purchase","isConsumable","err","productId","requestPurchaseWithReset","requestObj","refreshSubscriptionStatus","sub","warn","restorePurchases","OS","catch","onSyncError","sku","androidOptions","initIapWithSubscriptions","purchaseUpdate","onPurchaseSuccess","purchaseError","onPurchaseError","onPromotedProductIOS","currentSubscriptions","remove","getProducts","getSubscriptions"],"sourceRoot":"../../../src","sources":["hooks/useIAP.ts"],"mappings":";;AAAA;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,OAAO;AAChE,SAASC,QAAQ,QAAQ,cAAc;;AAEvC;AACA,SACEC,aAAa,EACb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