react-native-iap 13.0.4 → 14.0.0-rc.1
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 +145 -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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iap.d.ts","sourceRoot":"","sources":["../../../src/iap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAU9C,OAAO,EAOL,cAAc,EAIf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,OAAO,EACP,eAAe,EAGf,QAAQ,EACR,cAAc,EAEd,eAAe,EACf,mBAAmB,EACnB,YAAY,EAKZ,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAC,CAAC;AAMlE;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GACxB,gBAAgB,GAChB,sBAAsB,GACtB,gBAAgB,CAAC;AAErB,eAAO,MAAM,KAAK;;UAkBjB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,QAAO,QAAQ,OAAO,CACb,CAAC;AAErC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,QAAO,QAAQ,OAAO,CACb,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,0CAA0C,QACjD,QAAQ,OAAO,CACuC,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,WAAW;UAGhB,MAAM,EAAE;MACZ,QAAQ,MAAM,OAAO,CAAC,CA0BzB,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AgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAUA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enhancedFetch.d.ts","sourceRoot":"","sources":["../../../../src/internal/enhancedFetch.ts"],"names":[],"mappings":"AAAA,UAAU,sBAAuB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;IAChE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,iBACnB,MAAM,SACJ,sBAAsB,eAkB9B,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProductCommon } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* For Amazon products, we add the currency code from the user's information
|
|
4
|
-
* since it isn't included in the product information.
|
|
5
|
-
*/
|
|
6
|
-
export declare const fillProductsWithAdditionalData: <T extends ProductCommon>(items: T[]) => Promise<T[]>;
|
|
7
|
-
//# sourceMappingURL=fillProductsWithAdditionalData.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fillProductsWithAdditionalData.d.ts","sourceRoot":"","sources":["../../../../src/internal/fillProductsWithAdditionalData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAI5C;;;GAGG;AACH,eAAO,MAAM,8BAA8B,uDAoC1C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kCAAkC,CAAC;AACjD,cAAc,YAAY,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare const RNIapIos: import("..").IosModuleProps, RNIapIosSk2: import("../modules/iosSk2").IosModulePropsSk2, RNIapModule: import("..").AndroidModuleProps, RNIapAmazonModule: import("..").AmazonModuleProps;
|
|
2
|
-
export declare const isIos: boolean;
|
|
3
|
-
export declare const isAndroid: boolean;
|
|
4
|
-
export declare const isAmazon: boolean;
|
|
5
|
-
export declare const isPlay: boolean;
|
|
6
|
-
export declare const setAndroidNativeModule: (nativeModule: typeof RNIapModule) => void;
|
|
7
|
-
export declare const checkNativeAndroidAvailable: () => void;
|
|
8
|
-
/**
|
|
9
|
-
* If changing the typings of `getAndroidModule` to accommodate extra modules,
|
|
10
|
-
* make sure to update `getAndroidModuleType`.
|
|
11
|
-
*/
|
|
12
|
-
export declare const getAndroidModule: () => typeof RNIapModule | typeof RNIapAmazonModule;
|
|
13
|
-
/**
|
|
14
|
-
* Returns whether the Android in-app-purchase code is using the Android,
|
|
15
|
-
* Amazon, or another store.
|
|
16
|
-
*/
|
|
17
|
-
export declare const getAndroidModuleType: () => 'android' | 'amazon' | null;
|
|
18
|
-
export declare const getNativeModule: () => typeof RNIapModule | typeof RNIapAmazonModule | typeof RNIapIos | typeof RNIapIosSk2;
|
|
19
|
-
export declare const isStorekit2Available: () => boolean;
|
|
20
|
-
export declare const isIosStorekit2: () => boolean;
|
|
21
|
-
export declare const setIosNativeModule: (nativeModule: typeof RNIapIos | typeof RNIapIosSk2) => void;
|
|
22
|
-
export declare const storekit2Mode: () => boolean;
|
|
23
|
-
export declare const storekit1Mode: () => boolean;
|
|
24
|
-
export declare const storekitHybridMode: () => boolean;
|
|
25
|
-
export declare const getIosModule: () => typeof RNIapIos | typeof RNIapIosSk2;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/internal/platform.ts"],"names":[],"mappings":"AAIA,QAAA,MAAO,QAAQ,+BAAE,WAAW,iDAAE,WAAW,mCAAE,iBAAiB,gCAAiB,CAAC;AAE9E,eAAO,MAAM,KAAK,SAAwB,CAAC;AAC3C,eAAO,MAAM,SAAS,SAA4B,CAAC;AACnD,eAAO,MAAM,QAAQ,SAAmC,CAAC;AACzD,eAAO,MAAM,MAAM,SAA6B,CAAC;AAMjD,eAAO,MAAM,sBAAsB,iBACnB,kBAAkB,KAC/B,IAEF,CAAC;AAEF,eAAO,MAAM,2BAA2B,QAAO,IAI9C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QACzB,kBAAkB,GAClB,wBAQH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,SAAS,GAAG,QAAQ,GAAG,IAU9D,CAAC;AAEF,eAAO,MAAM,eAAe,QACxB,kBAAkB,GAClB,wBAAwB,GACxB,eAAe,GACf,kBAEH,CAAC;AAMF,eAAO,MAAM,oBAAoB,QAAO,OACG,CAAC;AAE5C,eAAO,MAAM,cAAc,eAIH,CAAC;AAEzB,eAAO,MAAM,kBAAkB,iBACf,eAAe,GAAG,kBAAkB,KACjD,IAEF,CAAC;AAEF,eAAO,MAAM,aAAa,eAWzB,CAAC;AAEF,eAAO,MAAM,aAAa,eAOzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,eAU9B,CAAC;AAQF,eAAO,MAAM,YAAY,QAAO,eAAe,GAAG,kBAQjD,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Product, ProrationModesAmazon, Purchase, Sku } from '../types';
|
|
2
|
-
import type { AmazonLicensingStatus, ReceiptType, UserDataAmazon } from '../types/amazon';
|
|
3
|
-
import type { NativeModuleProps } from './common';
|
|
4
|
-
type GetUser = () => Promise<UserDataAmazon>;
|
|
5
|
-
type FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;
|
|
6
|
-
type GetItemsByType = (type: string, skus: Sku[]) => Promise<Product[]>;
|
|
7
|
-
type GetAvailableItems = () => Promise<Purchase[]>;
|
|
8
|
-
type BuyItemByType = (sku: Sku, proration: ProrationModesAmazon) => Promise<Purchase>;
|
|
9
|
-
type AcknowledgePurchase = (purchaseToken: string, developerPayloadAndroid?: string) => Promise<boolean>;
|
|
10
|
-
type ConsumeProduct = (purchaseToken: string, developerPayloadAndroid?: string) => Promise<boolean>;
|
|
11
|
-
type StartListening = () => Promise<void>;
|
|
12
|
-
export interface AmazonModuleProps extends NativeModuleProps {
|
|
13
|
-
getUser: GetUser;
|
|
14
|
-
flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;
|
|
15
|
-
getItemsByType: GetItemsByType;
|
|
16
|
-
getAvailableItems: GetAvailableItems;
|
|
17
|
-
buyItemByType: BuyItemByType;
|
|
18
|
-
acknowledgePurchase: AcknowledgePurchase;
|
|
19
|
-
consumeProduct: ConsumeProduct;
|
|
20
|
-
/** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */
|
|
21
|
-
startListening: StartListening;
|
|
22
|
-
verifyLicense: () => Promise<AmazonLicensingStatus>;
|
|
23
|
-
deepLinkToSubscriptions: (isAmazonDevice: boolean) => Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
export declare const AmazonModule: AmazonModuleProps;
|
|
26
|
-
/**
|
|
27
|
-
* Validate receipt for Amazon. NOTE: This method is here for debugging purposes only. Including
|
|
28
|
-
* your developer secret in the binary you ship to users is potentially dangerous.
|
|
29
|
-
* Use server side validation instead for your production builds
|
|
30
|
-
* @param {string} developerSecret: from the Amazon developer console.
|
|
31
|
-
* @param {string} userId who purchased the item.
|
|
32
|
-
* @param {string} receiptId long obfuscated string returned when purchasing the item
|
|
33
|
-
* @param {boolean} useSandbox Defaults to true, use sandbox environment or production.
|
|
34
|
-
* @returns {Promise<object>}
|
|
35
|
-
*/
|
|
36
|
-
export declare const validateReceiptAmazon: ({ developerSecret, userId, receiptId, useSandbox, }: {
|
|
37
|
-
developerSecret: string;
|
|
38
|
-
userId: string;
|
|
39
|
-
receiptId: string;
|
|
40
|
-
useSandbox: boolean;
|
|
41
|
-
}) => Promise<ReceiptType>;
|
|
42
|
-
/**
|
|
43
|
-
* Returns the status of verifying app's license @see AmazonLicensingStatus
|
|
44
|
-
*/
|
|
45
|
-
export declare const verifyLicense: () => Promise<AmazonLicensingStatus>;
|
|
46
|
-
/**
|
|
47
|
-
* Deep link to subscriptions screen on Android.
|
|
48
|
-
* @param {string} sku The product's SKU (on Android)
|
|
49
|
-
* @returns {Promise<void>}
|
|
50
|
-
*/
|
|
51
|
-
export declare const deepLinkToSubscriptionsAmazon: ({ isAmazonDevice, }: {
|
|
52
|
-
isAmazonDevice: boolean;
|
|
53
|
-
}) => Promise<void>;
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=amazon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"amazon.d.ts","sourceRoot":"","sources":["../../../../src/modules/amazon.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAG,EAAC,MAAM,UAAU,CAAC;AAC3E,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAGhD,KAAK,OAAO,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;AAC7C,KAAK,mCAAmC,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAClE,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AACxE,KAAK,iBAAiB,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AACnD,KAAK,aA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ourceAndroid, Product, ProductType, Purchase, PurchaseResult, ReplacementModesAndroid, Sku } from '../types';
|
|
2
|
-
import type * as Android from '../types/android';
|
|
3
|
-
import type { NativeModuleProps } from './common';
|
|
4
|
-
type FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;
|
|
5
|
-
type GetItemsByType = <T = Product>(type: ProductType, skus: Sku[]) => Promise<T[]>;
|
|
6
|
-
type GetAvailableItemsByType = <T = Purchase>(type: ProductType) => Promise<T[]>;
|
|
7
|
-
type GetPurchaseHistoryByType = <T = Purchase>(type: ProductType) => Promise<T[]>;
|
|
8
|
-
export type BuyItemByType = (type: string, skus: Sku[], purchaseToken: string | undefined, replacementModeAndroid: ReplacementModesAndroid | -1, obfuscatedAccountId: string | undefined, obfuscatedProfileId: string | undefined, subscriptionOffers: string[], isOfferPersonalized: boolean) => Promise<Purchase>;
|
|
9
|
-
type AcknowledgePurchase = (purchaseToken: string, developerPayloadAndroid?: string) => Promise<PurchaseResult | boolean>;
|
|
10
|
-
type ConsumeProduct = (purchaseToken: string, developerPayloadAndroid?: string) => Promise<PurchaseResult | boolean>;
|
|
11
|
-
type StartListening = () => Promise<void>;
|
|
12
|
-
type GetPackageName = () => Promise<string>;
|
|
13
|
-
type GetStorefront = () => Promise<string>;
|
|
14
|
-
type GetAvailableItems = () => Promise<Purchase[]>;
|
|
15
|
-
export interface AndroidModuleProps extends NativeModuleProps {
|
|
16
|
-
flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;
|
|
17
|
-
getItemsByType: GetItemsByType;
|
|
18
|
-
getAvailableItemsByType: GetAvailableItemsByType;
|
|
19
|
-
getPurchaseHistoryByType: GetPurchaseHistoryByType;
|
|
20
|
-
buyItemByType: BuyItemByType;
|
|
21
|
-
acknowledgePurchase: AcknowledgePurchase;
|
|
22
|
-
consumeProduct: ConsumeProduct;
|
|
23
|
-
/** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */
|
|
24
|
-
startListening: StartListening;
|
|
25
|
-
getPackageName: GetPackageName;
|
|
26
|
-
getStorefront: GetStorefront;
|
|
27
|
-
isFeatureSupported: (feature: Android.FeatureType) => Promise<boolean>;
|
|
28
|
-
getAvailableItems?: GetAvailableItems;
|
|
29
|
-
}
|
|
30
|
-
export declare const AndroidModule: AndroidModuleProps;
|
|
31
|
-
export declare const getInstallSourceAndroid: () => InstallSourceAndroid;
|
|
32
|
-
/**
|
|
33
|
-
* Deep link to subscriptions screen on Android.
|
|
34
|
-
* @param {string} sku The product's SKU (on Android)
|
|
35
|
-
* @returns {Promise<void>}
|
|
36
|
-
*/
|
|
37
|
-
export declare const deepLinkToSubscriptionsAndroid: ({ sku, }: {
|
|
38
|
-
sku: Sku;
|
|
39
|
-
}) => Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including
|
|
42
|
-
* your access token in the binary you ship to users is potentially dangerous.
|
|
43
|
-
* Use server side validation instead for your production builds
|
|
44
|
-
* @param {string} packageName package name of your app.
|
|
45
|
-
* @param {string} productId product id for your in app product.
|
|
46
|
-
* @param {string} productToken token for your purchase.
|
|
47
|
-
* @param {string} accessToken accessToken from googleApis.
|
|
48
|
-
* @param {boolean} isSub whether this is subscription or inapp. `true` for subscription.
|
|
49
|
-
* @returns {Promise<object>}
|
|
50
|
-
*/
|
|
51
|
-
export declare const validateReceiptAndroid: ({ packageName, productId, productToken, accessToken, isSub, }: {
|
|
52
|
-
packageName: string;
|
|
53
|
-
productId: string;
|
|
54
|
-
productToken: string;
|
|
55
|
-
accessToken: string;
|
|
56
|
-
isSub?: boolean | undefined;
|
|
57
|
-
}) => Promise<Android.ReceiptType>;
|
|
58
|
-
/**
|
|
59
|
-
* Acknowledge a product (on Android.) No-op on iOS.
|
|
60
|
-
* @param {string} token The product's token (on Android)
|
|
61
|
-
* @returns {Promise<PurchaseResult | void>}
|
|
62
|
-
*/
|
|
63
|
-
export declare const acknowledgePurchaseAndroid: ({ token, developerPayload, }: {
|
|
64
|
-
token: string;
|
|
65
|
-
developerPayload?: string | undefined;
|
|
66
|
-
}) => Promise<PurchaseResult | boolean | void>;
|
|
67
|
-
/**
|
|
68
|
-
* Acknowledge a product (on Android.) No-op on iOS.
|
|
69
|
-
* @param {Android.FeatureType} feature to be checked
|
|
70
|
-
* @returns {Promise<boolean>}
|
|
71
|
-
*/
|
|
72
|
-
export declare const isFeatureSupported: (feature: Android.FeatureType) => Promise<boolean>;
|
|
73
|
-
export {};
|
|
74
|
-
//# sourceMappingURL=android.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../src/modules/android.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,GAAG,EACJ,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAIhD,KAAK,mCAAmC,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAElE,KAAK,cAAc,GAAG,CAAC,CAAC,GAAG,OAAO,EAChC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,GAAG,EAAE,KACR,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AAElB,KAAK,uBAAuB,GAAG,CAAC,CAAC,GAAG,QAAQ,EAC1C,IAAI,EAAE,WAAW,KACd,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AAElB,KAAK,wBAAwB,GAAG,CAAC,CAAC,GAAG,QAAQ,EAC3C,IAAI,EAAE,WAAW,KACd,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AAElB,MAAM,MAAM,aAAa,GAAG,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EAAE,EACX,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,sB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EAAE,iBAAiB,CAAC;CACvC;AAED,eAAO,MAAM,aAAa,oBAAkD,CAAC;AAE7E,eAAO,MAAM,uBAAuB,QAAO,oBAI1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;SAGpC,GAAG;MACN,QAAQ,IAAI,CAMf,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB;iBAOpB,MAAM;eACR,MAAM;kBACH,MAAM;iBACP,MAAM;;MAEjB,QAAQ,QAAQ,WAAW,CAsB9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;WAI9B,MAAM;;MAEX,QAAQ,cAAc,GAAG,OAAO,GAAG,IAAI,CAE1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,YACpB,QAAQ,WAAW,KAC3B,QAAQ,OAAO,CAKjB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common interface for all native modules (iOS — AppStore, Android — PlayStore and Amazon).
|
|
3
|
-
*/
|
|
4
|
-
export interface NativeModuleProps {
|
|
5
|
-
/** Required method to start a payment provider connection */
|
|
6
|
-
initConnection(): Promise<boolean>;
|
|
7
|
-
/** Required method to end the payment provider connection */
|
|
8
|
-
endConnection(): Promise<boolean>;
|
|
9
|
-
/** addListener for NativeEventEmitter */
|
|
10
|
-
addListener(eventType: string): void;
|
|
11
|
-
/** removeListeners for NativeEventEmitter */
|
|
12
|
-
removeListeners(count: number): void;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/modules/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC,6DAA6D;IAC7D,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAElC,yCAAyC;IACzC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC,6CAA6C;IAC7C,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import type { ResponseBody as ReceiptValidationResponse } from '@jeremybarbet/apple-api-types';
|
|
2
|
-
import type { ProductIOS, ProductPurchase, Purchase, Sku, SubscriptionIOS } from '../types';
|
|
3
|
-
import type { PaymentDiscount } from '../types/apple';
|
|
4
|
-
import type { NativeModuleProps } from './common';
|
|
5
|
-
type getItems = (skus: Sku[]) => Promise<ProductIOS[] | SubscriptionIOS[]>;
|
|
6
|
-
type getAvailableItems = (automaticallyFinishRestoredTransactions: boolean) => Promise<Purchase[]>;
|
|
7
|
-
export type BuyProduct = (sku: Sku, andDangerouslyFinishTransactionAutomaticallyIOS: boolean, applicationUsername: string | undefined, quantity: number, withOffer: Record<keyof PaymentDiscount, string> | undefined) => Promise<Purchase>;
|
|
8
|
-
type clearTransaction = () => Promise<void>;
|
|
9
|
-
type clearProducts = () => Promise<void>;
|
|
10
|
-
type promotedProduct = () => Promise<ProductIOS | null>;
|
|
11
|
-
type buyPromotedProduct = () => Promise<void>;
|
|
12
|
-
type requestReceipt = (refresh: boolean) => Promise<string | undefined | null>;
|
|
13
|
-
type finishTransaction = (transactionIdentifier: string) => Promise<boolean>;
|
|
14
|
-
type getPendingTransactions = () => Promise<ProductPurchase[]>;
|
|
15
|
-
type presentCodeRedemptionSheet = () => Promise<null>;
|
|
16
|
-
export interface IosModuleProps extends NativeModuleProps {
|
|
17
|
-
getItems: getItems;
|
|
18
|
-
getAvailableItems: getAvailableItems;
|
|
19
|
-
buyProduct: BuyProduct;
|
|
20
|
-
clearTransaction: clearTransaction;
|
|
21
|
-
clearProducts: clearProducts;
|
|
22
|
-
promotedProduct: promotedProduct;
|
|
23
|
-
buyPromotedProduct: buyPromotedProduct;
|
|
24
|
-
requestReceipt: requestReceipt;
|
|
25
|
-
finishTransaction: finishTransaction;
|
|
26
|
-
getPendingTransactions: getPendingTransactions;
|
|
27
|
-
presentCodeRedemptionSheet: presentCodeRedemptionSheet;
|
|
28
|
-
disable: () => Promise<null>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get the current receipt base64 encoded in IOS.
|
|
32
|
-
* @returns {Promise<ProductPurchase[]>}
|
|
33
|
-
*/
|
|
34
|
-
export declare const getPendingPurchasesIOS: () => Promise<ProductPurchase[]>;
|
|
35
|
-
/**
|
|
36
|
-
* Get the current receipt base64 encoded in IOS.
|
|
37
|
-
*
|
|
38
|
-
* The sequence should be as follows:
|
|
39
|
-
* Call getReceiptIOS({forceRefresh: false}). That will return the cached receipt that is available on TestFlight and Production.
|
|
40
|
-
* In the case of Sandbox the receipt might not be cached, causing it to return nil.
|
|
41
|
-
* In that case you might want to let the user that they will to be prompted for credentials.
|
|
42
|
-
* If they accept, call it again with `getReceiptIOS({forceRefresh:true}) If it fails or the user declines, assume they haven't purchased any items.
|
|
43
|
-
* Reference: https://developer.apple.com/forums/thread/662350
|
|
44
|
-
*
|
|
45
|
-
* From: https://apphud.com/blog/app-store-receipt-validation#what-is-app-store-receipt
|
|
46
|
-
> Q: Does a receipt always exist in the app?
|
|
47
|
-
> A: If a user downloaded the app from the App Store – yes. However, in sandbox if your app was installed via Xcode or Testflight, then there won't be a receipt until you make a purchase or restore.
|
|
48
|
-
*
|
|
49
|
-
## Usage
|
|
50
|
-
```tsx
|
|
51
|
-
import {getReceiptIOS} from 'react-native-iap';
|
|
52
|
-
try{
|
|
53
|
-
let receipt = await getReceiptIOS({forceRefresh: false});
|
|
54
|
-
if(!receipt){
|
|
55
|
-
// Let user know that they might get prompted for credentials
|
|
56
|
-
const shouldShowPrompt = // Display UI with details, Did user agree?. this only for Sandbox testing
|
|
57
|
-
if(shouldShowPrompt){
|
|
58
|
-
receipt = await getReceiptIOS({forceRefresh: true});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}catch(error:Error){
|
|
62
|
-
// error while getting the receipt, it might indicate an invalid receipt of a connection error while trying to get it
|
|
63
|
-
}
|
|
64
|
-
// If !receipt assume user doesn't own the items
|
|
65
|
-
```
|
|
66
|
-
* @param {forceRefresh?:boolean} Requests the receipt from Bundle.main.appStoreReceiptURL.
|
|
67
|
-
Based on the note above, looks like forceRefresh only makes sense when testing an app not downloaded from the Appstore.
|
|
68
|
-
And only afer a direct user action.
|
|
69
|
-
* @returns {Promise<string | undefined | null>} The receipt data
|
|
70
|
-
*/
|
|
71
|
-
export declare const getReceiptIOS: ({ forceRefresh, }: {
|
|
72
|
-
forceRefresh?: boolean | undefined;
|
|
73
|
-
}) => Promise<string | undefined | null>;
|
|
74
|
-
/**
|
|
75
|
-
* Launches a modal to register the redeem offer code in IOS.
|
|
76
|
-
* @returns {Promise<null>}
|
|
77
|
-
*/
|
|
78
|
-
export declare const presentCodeRedemptionSheetIOS: () => Promise<null>;
|
|
79
|
-
/**
|
|
80
|
-
* Should Add Store Payment (iOS only)
|
|
81
|
-
* Indicates the the App Store purchase should continue from the app instead of the App Store.
|
|
82
|
-
* @returns {Promise<Product | null>} promoted product
|
|
83
|
-
*/
|
|
84
|
-
export declare const getPromotedProductIOS: () => Promise<ProductIOS | null>;
|
|
85
|
-
/**
|
|
86
|
-
* Buy the currently selected promoted product (iOS only)
|
|
87
|
-
* Initiates the payment process for a promoted product. Should only be called in response to the `iap-promoted-product` event.
|
|
88
|
-
* @returns {Promise<void>}
|
|
89
|
-
*/
|
|
90
|
-
export declare const buyPromotedProductIOS: () => Promise<void>;
|
|
91
|
-
/**
|
|
92
|
-
* Validate receipt for iOS.
|
|
93
|
-
* @param {object} receiptBody the receipt body to send to apple server.
|
|
94
|
-
* @param {boolean} isTest whether this is in test environment which is sandbox.
|
|
95
|
-
* @returns {Promise<Apple.ReceiptValidationResponse | false>}
|
|
96
|
-
*/
|
|
97
|
-
export declare const validateReceiptIos: ({ receiptBody, isTest, }: {
|
|
98
|
-
receiptBody: Record<string, unknown>;
|
|
99
|
-
isTest?: boolean | undefined;
|
|
100
|
-
}) => Promise<ReceiptValidationResponse | false>;
|
|
101
|
-
/**
|
|
102
|
-
* Clear Transaction (iOS only)
|
|
103
|
-
* Finish remaining transactions. Related to issue #257 and #801
|
|
104
|
-
* link : https://github.com/hyochan/react-native-iap/issues/257
|
|
105
|
-
* https://github.com/hyochan/react-native-iap/issues/801
|
|
106
|
-
* @returns {Promise<void>}
|
|
107
|
-
*/
|
|
108
|
-
export declare const clearTransactionIOS: () => Promise<void>;
|
|
109
|
-
/**
|
|
110
|
-
* Clear valid Products (iOS only)
|
|
111
|
-
* Remove all products which are validated by Apple server.
|
|
112
|
-
* @returns {void}
|
|
113
|
-
*/
|
|
114
|
-
export declare const clearProductsIOS: () => Promise<void>;
|
|
115
|
-
export declare const deepLinkToSubscriptionsIos: () => Promise<void>;
|
|
116
|
-
export {};
|
|
117
|
-
//# sourceMappingURL=ios.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../src/modules/ios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,IAAI,yBAAyB,EAAC,MAAM,+BAA+B,CAAC;AAI7F,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,QAAQ,EACR,GAAG,EACH,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CA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,CAAC;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAa,QAAQ,eAAe,EAAE,CAChC,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,aAAa;;MAItB,QAAQ,MAAM,GAAG,SAAS,GAAG,IAAI,CAMpC,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,QAAa,QAAQ,IAAI,CACtB,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAO,QAAQ,UAAU,GAAG,IAAI,CAMjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAO,QAAQ,IAAI,CAChB,CAAC;AA+CtC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;iBAIhB,OAAO,MAAM,EAAE,OAAO,CAAC;;MAElC,QAAQ,yBAAyB,GAAG,KAAK,CAY5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAO,QAAQ,IAAI,CAChB,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAO,QAAQ,IAAI,CAChB,CAAC;AAEjC,eAAO,MAAM,0BAA0B,QAAO,QAAQ,IAAI,CACO,CAAC"}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import type { Product, ProductPurchase, Sku } from '../types';
|
|
2
|
-
import type { PaymentDiscountSk2, ProductSk2, ProductStatus, RefundRequestStatus, TransactionSk2 } from '../types/appleSk2';
|
|
3
|
-
import type { NativeModuleProps } from './common';
|
|
4
|
-
type getItems = (skus: Sku[]) => Promise<ProductSk2[]>;
|
|
5
|
-
type getAvailableItems = (alsoPublishToEventListener?: boolean, onlyIncludeActiveItems?: boolean) => Promise<TransactionSk2[]>;
|
|
6
|
-
export type BuyProduct = (sku: Sku, andDangerouslyFinishTransactionAutomaticallyIOS: boolean, applicationUsername: string | undefined, quantity: number, withOffer: Record<keyof PaymentDiscountSk2, string> | undefined) => Promise<TransactionSk2>;
|
|
7
|
-
type clearTransaction = () => Promise<void>;
|
|
8
|
-
type clearProducts = () => Promise<void>;
|
|
9
|
-
type promotedProduct = () => Promise<Product | null>;
|
|
10
|
-
type buyPromotedProduct = () => Promise<void>;
|
|
11
|
-
type finishTransaction = (transactionIdentifier: string) => Promise<boolean>;
|
|
12
|
-
type getPendingTransactions = () => Promise<ProductPurchase[]>;
|
|
13
|
-
type presentCodeRedemptionSheet = () => Promise<null>;
|
|
14
|
-
type showManageSubscriptions = () => Promise<null>;
|
|
15
|
-
type getStorefront = () => Promise<string>;
|
|
16
|
-
type getAppTransaction = () => Promise<{
|
|
17
|
-
appTransactionID: string;
|
|
18
|
-
originalAppVersion: string;
|
|
19
|
-
originalPurchaseDate: number;
|
|
20
|
-
deviceVerification: string;
|
|
21
|
-
deviceVerificationNonce: string;
|
|
22
|
-
appVersion: string;
|
|
23
|
-
signedDate: number;
|
|
24
|
-
environment: string;
|
|
25
|
-
}>;
|
|
26
|
-
export interface IosModulePropsSk2 extends NativeModuleProps {
|
|
27
|
-
isAvailable(): number;
|
|
28
|
-
latestTransaction(sku: string): Promise<TransactionSk2>;
|
|
29
|
-
currentEntitlement(sku: string): Promise<TransactionSk2>;
|
|
30
|
-
subscriptionStatus(sku: string): Promise<ProductStatus[]>;
|
|
31
|
-
isEligibleForIntroOffer(groupID: string): Promise<Boolean>;
|
|
32
|
-
sync(): Promise<null>;
|
|
33
|
-
getItems: getItems;
|
|
34
|
-
getAvailableItems: getAvailableItems;
|
|
35
|
-
buyProduct: BuyProduct;
|
|
36
|
-
clearTransaction: clearTransaction;
|
|
37
|
-
clearProducts: clearProducts;
|
|
38
|
-
promotedProduct: promotedProduct;
|
|
39
|
-
buyPromotedProduct: buyPromotedProduct;
|
|
40
|
-
finishTransaction: finishTransaction;
|
|
41
|
-
getPendingTransactions: getPendingTransactions;
|
|
42
|
-
presentCodeRedemptionSheet: presentCodeRedemptionSheet;
|
|
43
|
-
showManageSubscriptions: showManageSubscriptions;
|
|
44
|
-
disable: () => Promise<null>;
|
|
45
|
-
beginRefundRequest: (sku: string) => Promise<RefundRequestStatus>;
|
|
46
|
-
getStorefront: getStorefront;
|
|
47
|
-
getAppTransaction: getAppTransaction;
|
|
48
|
-
getReceiptData: () => Promise<string>;
|
|
49
|
-
isTransactionVerified: (sku: string) => Promise<boolean>;
|
|
50
|
-
getTransactionJws: (sku: string) => Promise<string>;
|
|
51
|
-
validateReceiptIos: (sku: string) => Promise<{
|
|
52
|
-
isValid: boolean;
|
|
53
|
-
receiptData: string;
|
|
54
|
-
jwsRepresentation: string;
|
|
55
|
-
latestTransaction?: TransactionSk2;
|
|
56
|
-
}>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Sync state with Appstore (iOS only)
|
|
60
|
-
* https://developer.apple.com/documentation/storekit/appstore/3791906-sync
|
|
61
|
-
*/
|
|
62
|
-
export declare const sync: () => Promise<null>;
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
*/
|
|
66
|
-
export declare const isEligibleForIntroOffer: (groupID: string) => Promise<Boolean>;
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
export declare const subscriptionStatus: (sku: string) => Promise<ProductStatus[]>;
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
*/
|
|
74
|
-
export declare const currentEntitlement: (sku: string) => Promise<TransactionSk2>;
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
|
-
export declare const latestTransaction: (sku: string) => Promise<TransactionSk2>;
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
*/
|
|
82
|
-
export declare const beginRefundRequest: (sku: string) => Promise<RefundRequestStatus>;
|
|
83
|
-
/**
|
|
84
|
-
*
|
|
85
|
-
*/
|
|
86
|
-
export declare const showManageSubscriptions: () => Promise<null>;
|
|
87
|
-
/**
|
|
88
|
-
*
|
|
89
|
-
*/
|
|
90
|
-
export declare const finishTransaction: (transactionIdentifier: string) => Promise<Boolean>;
|
|
91
|
-
/**
|
|
92
|
-
* Get the receipt data from the iOS device.
|
|
93
|
-
* This returns the base64 encoded receipt data which can be sent to your server
|
|
94
|
-
* for verification with Apple's server.
|
|
95
|
-
*
|
|
96
|
-
* NOTE: For proper security, always verify receipts on your server using
|
|
97
|
-
* Apple's verifyReceipt endpoint, not directly from the app.
|
|
98
|
-
*
|
|
99
|
-
* @returns {Promise<string>} Base64 encoded receipt data
|
|
100
|
-
*/
|
|
101
|
-
export declare const getReceiptIos: () => Promise<string>;
|
|
102
|
-
/**
|
|
103
|
-
* Check if a transaction is verified through StoreKit 2.
|
|
104
|
-
* StoreKit 2 performs local verification of transaction JWS signatures.
|
|
105
|
-
*
|
|
106
|
-
* @param {string} sku The product's SKU (on iOS)
|
|
107
|
-
* @returns {Promise<boolean>} True if the transaction is verified
|
|
108
|
-
*/
|
|
109
|
-
export declare const isTransactionVerified: (sku: string) => Promise<boolean>;
|
|
110
|
-
/**
|
|
111
|
-
* Get the JWS representation of a purchase for server-side verification.
|
|
112
|
-
* The JWS (JSON Web Signature) can be verified on your server using Apple's public keys.
|
|
113
|
-
*
|
|
114
|
-
* @param {string} sku The product's SKU (on iOS)
|
|
115
|
-
* @returns {Promise<string>} JWS representation of the transaction
|
|
116
|
-
*/
|
|
117
|
-
export declare const getTransactionJws: (sku: string) => Promise<string>;
|
|
118
|
-
/**
|
|
119
|
-
* Validate receipt for iOS using StoreKit 2's built-in verification.
|
|
120
|
-
* Returns receipt data and verification information to help with server-side validation.
|
|
121
|
-
*
|
|
122
|
-
* NOTE: For proper security, Apple recommends verifying receipts on your server using
|
|
123
|
-
* the verifyReceipt endpoint rather than relying solely on client-side verification.
|
|
124
|
-
*
|
|
125
|
-
* @param {string} sku The product's SKU (on iOS)
|
|
126
|
-
* @returns {Promise<{
|
|
127
|
-
* isValid: boolean;
|
|
128
|
-
* receiptData: string;
|
|
129
|
-
* jwsRepresentation: string;
|
|
130
|
-
* latestTransaction?: TransactionSk2;
|
|
131
|
-
* }>}
|
|
132
|
-
*/
|
|
133
|
-
export declare const validateReceiptIos: (sku: string) => Promise<{
|
|
134
|
-
isValid: boolean;
|
|
135
|
-
receiptData: string;
|
|
136
|
-
jwsRepresentation: string;
|
|
137
|
-
latestTransaction?: TransactionSk2;
|
|
138
|
-
}>;
|
|
139
|
-
export {};
|
|
140
|
-
//# sourceMappingURL=iosSk2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iosSk2.d.ts","sourceRoot":"","sources":["../../../../src/modules/iosSk2.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAC,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAGhD,KAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AAEvD,KAAK,iBAAiB,GAAG,CACvB,0BAA0B,CAAC,EAAE,OAAO,EACpC,sBAAsB,CAAC,EAAE,OAAO,KAC7B,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;AAE/B,MAAM,MAAM,UAAU,GAAG,CACvB,GAAG,EAAE,GAAG,EACR,+CAA+C,EAAE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