@voidhash/nitro-ui 0.0.0-stage → 0.5.0
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/LICENSE.md +21 -0
- package/Package.swift +161 -0
- package/README.md +127 -2
- package/android/nitro-ui.gradle +35 -0
- package/android/src/main/java/com/margelo/nitro/voidhash/HybridVoidhashNativeClient.kt +53 -0
- package/android/src/main/java/com/margelo/nitro/voidhash/VoidhashNitroUIModule.kt +65 -0
- package/android/src/main/java/com/margelo/nitro/voidhash/client/LegacyStorageImporter.kt +526 -0
- package/android/src/main/java/com/margelo/nitro/voidhash/client/SdkBackedNativeClient.kt +1131 -0
- package/android/src/main/java/com/margelo/nitro/voidhash/client/StoreMapping.kt +257 -0
- package/android/src/main/java/com/margelo/nitro/voidhash/client/VoidhashFlowPermissionHandlers.kt +23 -0
- package/android/src/main/java/com/margelo/nitro/voidhash/flows/VoidhashFlowsCore.kt +93 -0
- package/build/chunk-5LFKYB24.js +331 -0
- package/build/chunk-5LFKYB24.js.map +1 -0
- package/build/index.d.ts +2870 -0
- package/build/index.js +4183 -0
- package/build/index.js.map +1 -0
- package/build/navigation.d.ts +66 -0
- package/build/navigation.js +72 -0
- package/build/navigation.js.map +1 -0
- package/ios/HybridVoidhashNativeClient.swift +427 -0
- package/ios/Shared/NativeClientMapping.swift +184 -0
- package/ios/Shared/NativeStoreJson.swift +126 -0
- package/ios/Shared/VoidhashCoreExports.swift +5 -0
- package/ios/Shared/VoidhashLegacyImporter.swift +686 -0
- package/ios/Shared/VoidhashNativeClientCore.swift +1401 -0
- package/nitro.json +8 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroVoidhash+autolinking.cmake +86 -0
- package/nitrogen/generated/android/NitroVoidhash+autolinking.gradle +10 -0
- package/nitrogen/generated/android/NitroVoidhashOnLoad.cpp +22 -0
- package/nitrogen/generated/android/c++/JCallback_Promise_std__string__std__string_std__string.cpp +57 -0
- package/nitrogen/generated/android/c++/JCallback_void_NativeClientEvent.cpp +55 -0
- package/nitrogen/generated/android/c++/JHybridVoidhashNativeClientSpec.cpp +387 -0
- package/nitrogen/generated/android/c++/JNativeAnalyticsConsent.cpp +55 -0
- package/nitrogen/generated/android/c++/JNativeAppStoreMessages.cpp +52 -0
- package/nitrogen/generated/android/c++/JNativeAppStorePurchaseOptions.cpp +36 -0
- package/nitrogen/generated/android/c++/JNativeAppStoreSubscriptionState.cpp +64 -0
- package/nitrogen/generated/android/c++/JNativeAppStoreSubscriptionStatus.cpp +38 -0
- package/nitrogen/generated/android/c++/JNativeClientConfiguration.cpp +75 -0
- package/nitrogen/generated/android/c++/JNativeClientEvent.cpp +52 -0
- package/nitrogen/generated/android/c++/JNativeClientEventType.cpp +70 -0
- package/nitrogen/generated/android/c++/JNativeDiagnostic.cpp +44 -0
- package/nitrogen/generated/android/c++/JNativeDiagnosticKind.cpp +67 -0
- package/nitrogen/generated/android/c++/JNativeEnvironment.cpp +61 -0
- package/nitrogen/generated/android/c++/JNativeFeatureFlag.cpp +41 -0
- package/nitrogen/generated/android/c++/JNativeFeatureFlagsResult.cpp +45 -0
- package/nitrogen/generated/android/c++/JNativeFlowCapability.cpp +58 -0
- package/nitrogen/generated/android/c++/JNativeFlowLoading.cpp +52 -0
- package/nitrogen/generated/android/c++/JNativeFlowPresentation.cpp +42 -0
- package/nitrogen/generated/android/c++/JNativeFlowRevision.cpp +37 -0
- package/nitrogen/generated/android/c++/JNativeFlowRuntime.cpp +52 -0
- package/nitrogen/generated/android/c++/JNativeFlushStatus.cpp +40 -0
- package/nitrogen/generated/android/c++/JNativeFreshnessReason.cpp +58 -0
- package/nitrogen/generated/android/c++/JNativeGooglePlayPurchaseOptions.cpp +40 -0
- package/nitrogen/generated/android/c++/JNativeIdentifyResult.cpp +40 -0
- package/nitrogen/generated/android/c++/JNativeIdentityChange.cpp +38 -0
- package/nitrogen/generated/android/c++/JNativeInAppMessageResult.cpp +38 -0
- package/nitrogen/generated/android/c++/JNativeInAppMessageStatus.cpp +52 -0
- package/nitrogen/generated/android/c++/JNativeOffer.cpp +44 -0
- package/nitrogen/generated/android/c++/JNativeOfferKind.cpp +61 -0
- package/nitrogen/generated/android/c++/JNativeOfferSelection.cpp +55 -0
- package/nitrogen/generated/android/c++/JNativePaymentMode.cpp +58 -0
- package/nitrogen/generated/android/c++/JNativePendingAnalytics.cpp +52 -0
- package/nitrogen/generated/android/c++/JNativePeriod.cpp +39 -0
- package/nitrogen/generated/android/c++/JNativePeriodUnit.cpp +61 -0
- package/nitrogen/generated/android/c++/JNativePersonState.cpp +44 -0
- package/nitrogen/generated/android/c++/JNativePersonWriteResult.cpp +38 -0
- package/nitrogen/generated/android/c++/JNativePrice.cpp +39 -0
- package/nitrogen/generated/android/c++/JNativePricingPhase.cpp +40 -0
- package/nitrogen/generated/android/c++/JNativeProduct.cpp +55 -0
- package/nitrogen/generated/android/c++/JNativeProductType.cpp +61 -0
- package/nitrogen/generated/android/c++/JNativePurchaseIntent.cpp +38 -0
- package/nitrogen/generated/android/c++/JNativePurchaseIntents.cpp +52 -0
- package/nitrogen/generated/android/c++/JNativePurchaseOptions.cpp +49 -0
- package/nitrogen/generated/android/c++/JNativePurchaseOutcome.cpp +55 -0
- package/nitrogen/generated/android/c++/JNativePurchaseResult.cpp +40 -0
- package/nitrogen/generated/android/c++/JNativeRefundRequestStatus.cpp +52 -0
- package/nitrogen/generated/android/c++/JNativeReportedPurchaseState.cpp +55 -0
- package/nitrogen/generated/android/c++/JNativeReportedTransaction.cpp +42 -0
- package/nitrogen/generated/android/c++/JNativeStore.cpp +58 -0
- package/nitrogen/generated/android/c++/JNativeStorePlatform.cpp +52 -0
- package/nitrogen/generated/android/c++/JNativeStorefront.cpp +37 -0
- package/nitrogen/generated/android/c++/JNativeSubscriptionInfo.cpp +45 -0
- package/nitrogen/generated/android/c++/JNativeSubscriptionReplacement.cpp +36 -0
- package/nitrogen/generated/android/c++/JNativeSubscriptionReplacementMode.cpp +61 -0
- package/nitrogen/generated/android/c++/JNativeTransaction.cpp +53 -0
- package/nitrogen/generated/android/c++/JNativeTransactionOffer.cpp +40 -0
- package/nitrogen/generated/android/c++/JNativeTransactionOfferKind.cpp +64 -0
- package/nitrogen/generated/android/c++/JNativeTransactionUpdate.cpp +36 -0
- package/nitrogen/generated/android/c++/JNativeWriteStatus.cpp +55 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JCallback_Promise_std__string__std__string_std__string.hpp +55 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JCallback_void_NativeClientEvent.hpp +54 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JHybridVoidhashNativeClientSpec.hpp +166 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JHybridVoidhashNativeClientSpecJavaPart.hpp +26 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeAnalyticsConsent.hpp +77 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeAppStoreMessages.hpp +72 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeAppStorePurchaseOptions.hpp +51 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeAppStoreSubscriptionState.hpp +92 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeAppStoreSubscriptionStatus.hpp +61 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeClientConfiguration.hpp +190 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeClientEvent.hpp +99 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeClientEventType.hpp +102 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeDiagnostic.hpp +79 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeDiagnosticKind.hpp +97 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeEnvironment.hpp +87 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeFeatureFlag.hpp +68 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeFeatureFlagsResult.hpp +76 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeFlowCapability.hpp +82 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeFlowLoading.hpp +72 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeFlowPresentation.hpp +65 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeFlowRevision.hpp +56 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeFlowRuntime.hpp +72 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeFlushStatus.hpp +63 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeFreshnessReason.hpp +82 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeGooglePlayPurchaseOptions.hpp +63 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeIdentifyResult.hpp +63 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeIdentityChange.hpp +61 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeInAppMessageResult.hpp +57 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeInAppMessageStatus.hpp +72 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeOffer.hpp +71 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeOfferKind.hpp +87 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeOfferSelection.hpp +77 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePaymentMode.hpp +82 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePendingAnalytics.hpp +72 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePeriod.hpp +62 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePeriodUnit.hpp +87 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePersonState.hpp +79 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePersonWriteResult.hpp +57 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePrice.hpp +66 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePricingPhase.hpp +67 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeProduct.hpp +118 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeProductType.hpp +87 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePurchaseIntent.hpp +57 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePurchaseIntents.hpp +72 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePurchaseOptions.hpp +88 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePurchaseOutcome.hpp +77 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativePurchaseResult.hpp +63 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeRefundRequestStatus.hpp +72 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeReportedPurchaseState.hpp +77 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeReportedTransaction.hpp +73 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeStore.hpp +82 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeStorePlatform.hpp +72 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeStorefront.hpp +56 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeSubscriptionInfo.hpp +84 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeSubscriptionReplacement.hpp +55 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeSubscriptionReplacementMode.hpp +87 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeTransaction.hpp +116 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeTransactionOffer.hpp +63 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeTransactionOfferKind.hpp +92 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeTransactionUpdate.hpp +55 -0
- package/nitrogen/generated/android/c++/include/NitroVoidhash/private/JNativeWriteStatus.hpp +77 -0
- package/nitrogen/generated/android/include/NitroVoidhash/private/NitroVoidhashOnLoad.hpp +13 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/Callback_Promise_std__string__std__string_std__string.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/Callback_void_NativeClientEvent.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/HybridVoidhashNativeClientSpec.kt +278 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeAnalyticsConsent.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeAppStoreMessages.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeAppStorePurchaseOptions.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeAppStoreSubscriptionState.kt +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeAppStoreSubscriptionStatus.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeClientConfiguration.kt +172 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeClientEvent.kt +87 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeClientEventType.kt +64 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeDiagnostic.kt +72 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeDiagnosticKind.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeEnvironment.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeFeatureFlag.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeFeatureFlagsResult.kt +67 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeFlowCapability.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeFlowLoading.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeFlowPresentation.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeFlowRevision.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeFlowRuntime.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeFlushStatus.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeFreshnessReason.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeGooglePlayPurchaseOptions.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeIdentifyResult.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeIdentityChange.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeInAppMessageResult.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeInAppMessageStatus.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeOffer.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeOfferKind.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeOfferSelection.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePaymentMode.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePendingAnalytics.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePeriod.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePeriodUnit.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePersonState.kt +72 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePersonWriteResult.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePrice.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePricingPhase.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeProduct.kt +107 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeProductType.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePurchaseIntent.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePurchaseIntents.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePurchaseOptions.kt +77 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePurchaseOutcome.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativePurchaseResult.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeRefundRequestStatus.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeReportedPurchaseState.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeReportedTransaction.kt +67 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeStore.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeStorePlatform.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeStorefront.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeSubscriptionInfo.kt +77 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeSubscriptionReplacement.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeSubscriptionReplacementMode.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeTransaction.kt +107 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeTransactionOffer.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeTransactionOfferKind.kt +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeTransactionUpdate.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NativeWriteStatus.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/voidhash/NitroVoidhashOnLoad.kt +22 -0
- package/nitrogen/generated/apple/NitroVoidhash-Swift-Cxx-Bridge.cpp +381 -0
- package/nitrogen/generated/apple/NitroVoidhashAppleCxx/NitroVoidhashAppleCxx.cpp +9 -0
- package/nitrogen/generated/apple/NitroVoidhashAppleCxx/include/NitroVoidhashAppleCxx/NitroVoidhashAppleCxx.h +265 -0
- package/nitrogen/generated/apple/NitroVoidhashAutolinking.cpp +20 -0
- package/nitrogen/generated/apple/NitroVoidhashAutolinking.mm +24 -0
- package/nitrogen/generated/apple/c++/HybridVoidhashNativeClientSpecSwift.cpp +555 -0
- package/nitrogen/generated/apple/c++/HybridVoidhashNativeClientSpec_cxx-Swift.cpp +28 -0
- package/nitrogen/generated/apple/c++/NativeAnalyticsConsent-Swift.cpp +49 -0
- package/nitrogen/generated/apple/c++/NativeAppStoreMessages-Swift.cpp +46 -0
- package/nitrogen/generated/apple/c++/NativeAppStorePurchaseOptions-Swift.cpp +32 -0
- package/nitrogen/generated/apple/c++/NativeAppStoreSubscriptionState-Swift.cpp +58 -0
- package/nitrogen/generated/apple/c++/NativeAppStoreSubscriptionStatus-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeClientConfiguration-Swift.cpp +57 -0
- package/nitrogen/generated/apple/c++/NativeClientEvent-Swift.cpp +40 -0
- package/nitrogen/generated/apple/c++/NativeClientEventType-Swift.cpp +64 -0
- package/nitrogen/generated/apple/c++/NativeDiagnostic-Swift.cpp +37 -0
- package/nitrogen/generated/apple/c++/NativeDiagnosticKind-Swift.cpp +61 -0
- package/nitrogen/generated/apple/c++/NativeEnvironment-Swift.cpp +55 -0
- package/nitrogen/generated/apple/c++/NativeFeatureFlag-Swift.cpp +35 -0
- package/nitrogen/generated/apple/c++/NativeFeatureFlagsResult-Swift.cpp +36 -0
- package/nitrogen/generated/apple/c++/NativeFlowCapability-Swift.cpp +52 -0
- package/nitrogen/generated/apple/c++/NativeFlowLoading-Swift.cpp +46 -0
- package/nitrogen/generated/apple/c++/NativeFlowPresentation-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeFlowRevision-Swift.cpp +33 -0
- package/nitrogen/generated/apple/c++/NativeFlowRuntime-Swift.cpp +46 -0
- package/nitrogen/generated/apple/c++/NativeFlushStatus-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeFreshnessReason-Swift.cpp +52 -0
- package/nitrogen/generated/apple/c++/NativeGooglePlayPurchaseOptions-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeIdentifyResult-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeIdentityChange-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeInAppMessageResult-Swift.cpp +33 -0
- package/nitrogen/generated/apple/c++/NativeInAppMessageStatus-Swift.cpp +46 -0
- package/nitrogen/generated/apple/c++/NativeOffer-Swift.cpp +35 -0
- package/nitrogen/generated/apple/c++/NativeOfferKind-Swift.cpp +55 -0
- package/nitrogen/generated/apple/c++/NativeOfferSelection-Swift.cpp +49 -0
- package/nitrogen/generated/apple/c++/NativePaymentMode-Swift.cpp +52 -0
- package/nitrogen/generated/apple/c++/NativePendingAnalytics-Swift.cpp +46 -0
- package/nitrogen/generated/apple/c++/NativePeriod-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativePeriodUnit-Swift.cpp +55 -0
- package/nitrogen/generated/apple/c++/NativePersonState-Swift.cpp +37 -0
- package/nitrogen/generated/apple/c++/NativePersonWriteResult-Swift.cpp +33 -0
- package/nitrogen/generated/apple/c++/NativePrice-Swift.cpp +35 -0
- package/nitrogen/generated/apple/c++/NativePricingPhase-Swift.cpp +35 -0
- package/nitrogen/generated/apple/c++/NativeProduct-Swift.cpp +44 -0
- package/nitrogen/generated/apple/c++/NativeProductType-Swift.cpp +55 -0
- package/nitrogen/generated/apple/c++/NativePurchaseIntent-Swift.cpp +33 -0
- package/nitrogen/generated/apple/c++/NativePurchaseIntents-Swift.cpp +46 -0
- package/nitrogen/generated/apple/c++/NativePurchaseOptions-Swift.cpp +38 -0
- package/nitrogen/generated/apple/c++/NativePurchaseOutcome-Swift.cpp +49 -0
- package/nitrogen/generated/apple/c++/NativePurchaseResult-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeRefundRequestStatus-Swift.cpp +46 -0
- package/nitrogen/generated/apple/c++/NativeReportedPurchaseState-Swift.cpp +49 -0
- package/nitrogen/generated/apple/c++/NativeReportedTransaction-Swift.cpp +36 -0
- package/nitrogen/generated/apple/c++/NativeStore-Swift.cpp +52 -0
- package/nitrogen/generated/apple/c++/NativeStorePlatform-Swift.cpp +46 -0
- package/nitrogen/generated/apple/c++/NativeStorefront-Swift.cpp +33 -0
- package/nitrogen/generated/apple/c++/NativeSubscriptionInfo-Swift.cpp +38 -0
- package/nitrogen/generated/apple/c++/NativeSubscriptionReplacement-Swift.cpp +33 -0
- package/nitrogen/generated/apple/c++/NativeSubscriptionReplacementMode-Swift.cpp +55 -0
- package/nitrogen/generated/apple/c++/NativeTransaction-Swift.cpp +44 -0
- package/nitrogen/generated/apple/c++/NativeTransactionOffer-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeTransactionOfferKind-Swift.cpp +58 -0
- package/nitrogen/generated/apple/c++/NativeTransactionUpdate-Swift.cpp +33 -0
- package/nitrogen/generated/apple/c++/NativeWriteStatus-Swift.cpp +49 -0
- package/nitrogen/generated/apple/c++/Record_swift__String_bool-Swift.cpp +26 -0
- package/nitrogen/generated/apple/c++/Record_swift__String_swift__String-Swift.cpp +26 -0
- package/nitrogen/generated/apple/c++/SwiftContainer_swift__Array___NitroVoidhash__NativeAppStoreSubscriptionStatus_-Swift.cpp +38 -0
- package/nitrogen/generated/apple/c++/SwiftContainer_swift__Array___NitroVoidhash__NativeProduct_-Swift.cpp +41 -0
- package/nitrogen/generated/apple/c++/SwiftContainer_swift__Array___NitroVoidhash__NativeTransaction_-Swift.cpp +36 -0
- package/nitrogen/generated/apple/c++/SwiftContainer_swift__Optional___NitroVoidhash__NativeStorefront_-Swift.cpp +30 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/NitroVoidhashAutolinking.hpp +13 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/HybridVoidhashNativeClientSpecSwift.hpp +121 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/HybridVoidhashNativeClientSpec_cxx-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeAnalyticsConsent-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeAppStoreMessages-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeAppStorePurchaseOptions-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeAppStoreSubscriptionState-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeAppStoreSubscriptionStatus-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeClientConfiguration-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeClientEvent-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeClientEventType-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeDiagnostic-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeDiagnosticKind-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeEnvironment-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeFeatureFlag-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeFeatureFlagsResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeFlowCapability-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeFlowLoading-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeFlowPresentation-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeFlowRevision-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeFlowRuntime-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeFlushStatus-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeFreshnessReason-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeGooglePlayPurchaseOptions-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeIdentifyResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeIdentityChange-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeInAppMessageResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeInAppMessageStatus-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeOffer-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeOfferKind-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeOfferSelection-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePaymentMode-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePendingAnalytics-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePeriod-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePeriodUnit-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePersonState-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePersonWriteResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePrice-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePricingPhase-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeProduct-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeProductType-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePurchaseIntent-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePurchaseIntents-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePurchaseOptions-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePurchaseOutcome-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativePurchaseResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeRefundRequestStatus-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeReportedPurchaseState-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeReportedTransaction-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeStore-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeStorePlatform-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeStorefront-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeSubscriptionInfo-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeSubscriptionReplacement-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeSubscriptionReplacementMode-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeTransaction-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeTransactionOffer-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeTransactionOfferKind-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeTransactionUpdate-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NativeWriteStatus-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/NitroVoidhash-Swift-Cxx-Umbrella.hpp +100 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/Record_swift__String_bool-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/Record_swift__String_swift__String-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/SwiftContainer_swift__Array___NitroVoidhash__NativeAppStoreSubscriptionStatus_-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/SwiftContainer_swift__Array___NitroVoidhash__NativeProduct_-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/SwiftContainer_swift__Array___NitroVoidhash__NativeTransaction_-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroVoidhash/private/SwiftContainer_swift__Optional___NitroVoidhash__NativeStorefront_-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/module.modulemap +12 -0
- package/nitrogen/generated/apple/swift/Callback_Promise_swift__String__swift__String_swift__String.swift +73 -0
- package/nitrogen/generated/apple/swift/Callback_void___NitroVoidhash__NativeClientEvent.swift +66 -0
- package/nitrogen/generated/apple/swift/HybridVoidhashNativeClientSpec.swift +113 -0
- package/nitrogen/generated/apple/swift/HybridVoidhashNativeClientSpec_cxx.swift +629 -0
- package/nitrogen/generated/apple/swift/NativeAnalyticsConsent.swift +59 -0
- package/nitrogen/generated/apple/swift/NativeAppStoreMessages.swift +54 -0
- package/nitrogen/generated/apple/swift/NativeAppStorePurchaseOptions.swift +28 -0
- package/nitrogen/generated/apple/swift/NativeAppStoreSubscriptionState.swift +74 -0
- package/nitrogen/generated/apple/swift/NativeAppStoreSubscriptionStatus.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeClientConfiguration.swift +203 -0
- package/nitrogen/generated/apple/swift/NativeClientEvent.swift +84 -0
- package/nitrogen/generated/apple/swift/NativeClientEventType.swift +84 -0
- package/nitrogen/generated/apple/swift/NativeDiagnostic.swift +63 -0
- package/nitrogen/generated/apple/swift/NativeDiagnosticKind.swift +79 -0
- package/nitrogen/generated/apple/swift/NativeEnvironment.swift +69 -0
- package/nitrogen/generated/apple/swift/NativeFeatureFlag.swift +49 -0
- package/nitrogen/generated/apple/swift/NativeFeatureFlagsResult.swift +56 -0
- package/nitrogen/generated/apple/swift/NativeFlowCapability.swift +64 -0
- package/nitrogen/generated/apple/swift/NativeFlowLoading.swift +54 -0
- package/nitrogen/generated/apple/swift/NativeFlowPresentation.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeFlowRevision.swift +35 -0
- package/nitrogen/generated/apple/swift/NativeFlowRuntime.swift +54 -0
- package/nitrogen/generated/apple/swift/NativeFlushStatus.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeFreshnessReason.swift +64 -0
- package/nitrogen/generated/apple/swift/NativeGooglePlayPurchaseOptions.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeIdentifyResult.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeIdentityChange.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeInAppMessageResult.swift +35 -0
- package/nitrogen/generated/apple/swift/NativeInAppMessageStatus.swift +54 -0
- package/nitrogen/generated/apple/swift/NativeOffer.swift +49 -0
- package/nitrogen/generated/apple/swift/NativeOfferKind.swift +69 -0
- package/nitrogen/generated/apple/swift/NativeOfferSelection.swift +59 -0
- package/nitrogen/generated/apple/swift/NativePaymentMode.swift +64 -0
- package/nitrogen/generated/apple/swift/NativePendingAnalytics.swift +54 -0
- package/nitrogen/generated/apple/swift/NativePeriod.swift +42 -0
- package/nitrogen/generated/apple/swift/NativePeriodUnit.swift +69 -0
- package/nitrogen/generated/apple/swift/NativePersonState.swift +63 -0
- package/nitrogen/generated/apple/swift/NativePersonWriteResult.swift +35 -0
- package/nitrogen/generated/apple/swift/NativePrice.swift +49 -0
- package/nitrogen/generated/apple/swift/NativePricingPhase.swift +49 -0
- package/nitrogen/generated/apple/swift/NativeProduct.swift +112 -0
- package/nitrogen/generated/apple/swift/NativeProductType.swift +69 -0
- package/nitrogen/generated/apple/swift/NativePurchaseIntent.swift +35 -0
- package/nitrogen/generated/apple/swift/NativePurchaseIntents.swift +54 -0
- package/nitrogen/generated/apple/swift/NativePurchaseOptions.swift +70 -0
- package/nitrogen/generated/apple/swift/NativePurchaseOutcome.swift +59 -0
- package/nitrogen/generated/apple/swift/NativePurchaseResult.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeRefundRequestStatus.swift +54 -0
- package/nitrogen/generated/apple/swift/NativeReportedPurchaseState.swift +59 -0
- package/nitrogen/generated/apple/swift/NativeReportedTransaction.swift +56 -0
- package/nitrogen/generated/apple/swift/NativeStore.swift +64 -0
- package/nitrogen/generated/apple/swift/NativeStorePlatform.swift +54 -0
- package/nitrogen/generated/apple/swift/NativeStorefront.swift +35 -0
- package/nitrogen/generated/apple/swift/NativeSubscriptionInfo.swift +70 -0
- package/nitrogen/generated/apple/swift/NativeSubscriptionReplacement.swift +35 -0
- package/nitrogen/generated/apple/swift/NativeSubscriptionReplacementMode.swift +69 -0
- package/nitrogen/generated/apple/swift/NativeTransaction.swift +112 -0
- package/nitrogen/generated/apple/swift/NativeTransactionOffer.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeTransactionOfferKind.swift +74 -0
- package/nitrogen/generated/apple/swift/NativeTransactionUpdate.swift +35 -0
- package/nitrogen/generated/apple/swift/NativeWriteStatus.swift +59 -0
- package/nitrogen/generated/apple/swift/Promise_Promise_swift__String_.swift +100 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__NativeFeatureFlagsResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__NativeFlushStatus.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__NativeIdentifyResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__NativeIdentityChange.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__NativeInAppMessageResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__NativePersonState.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__NativePersonWriteResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__NativePurchaseResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__NativeRefundRequestStatus.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__SwiftContainer_swift__Array___NitroVoidhash__NativeAppStoreSubscriptionStatus_.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__SwiftContainer_swift__Array___NitroVoidhash__NativeProduct_.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__SwiftContainer_swift__Array___NitroVoidhash__NativeTransaction_.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroVoidhash__SwiftContainer_swift__Optional___NitroVoidhash__NativeStorefront_.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise_bool.swift +100 -0
- package/nitrogen/generated/apple/swift/Promise_swift__String.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise_void.swift +100 -0
- package/nitrogen/generated/apple/swift/Record_swift__String_bool.swift +48 -0
- package/nitrogen/generated/apple/swift/Record_swift__String_swift__String.swift +48 -0
- package/nitrogen/generated/apple/swift/SwiftContainer_swift__Array___NitroVoidhash__NativeAppStoreSubscriptionStatus_.swift +21 -0
- package/nitrogen/generated/apple/swift/SwiftContainer_swift__Array___NitroVoidhash__NativeProduct_.swift +21 -0
- package/nitrogen/generated/apple/swift/SwiftContainer_swift__Array___NitroVoidhash__NativeTransaction_.swift +21 -0
- package/nitrogen/generated/apple/swift/SwiftContainer_swift__Optional___NitroVoidhash__NativeStorefront_.swift +21 -0
- package/nitrogen/generated/hybrid-classes.json +19 -0
- package/nitrogen/generated/shared/c++/NitroVoidhashCxxModule.cpp +2 -0
- package/nitrogen/generated/shared/c++/include/NitroVoidhash/NitroVoidhashCxxModule.hpp +2 -0
- package/nitrogen/generated/shared/javascript/VoidhashNativeClient.cjs +19 -0
- package/nitrogen/generated/shared/javascript/VoidhashNativeClient.d.cts +9 -0
- package/package.json +103 -3
- package/src/specs/VoidhashNativeClient.nitro.ts +1162 -0
|
@@ -0,0 +1,1162 @@
|
|
|
1
|
+
// Generated by `pnpm specs` from the React Native SDK's
|
|
2
|
+
// src/specs/VoidhashNativeClient.nitro.ts. Do not edit: change that spec and
|
|
3
|
+
// run `pnpm specs` again.
|
|
4
|
+
import { Android, iOS, type HybridObject } from "nitro-core";
|
|
5
|
+
|
|
6
|
+
export * from "#nitro/VoidhashNativeClient";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* The contract between the React Native facade and the native Voidhash client
|
|
10
|
+
* (the Swift `VoidhashClient` and the Kotlin `com.voidhash.sdk.VoidhashClient`)
|
|
11
|
+
* it is moving onto. The facade keeps its public surface: option validation,
|
|
12
|
+
* the `Result` and `VoidhashError` shapes, the provider and the hooks stay in
|
|
13
|
+
* TypeScript; identity, purchases, analytics, flags, the schema and paywalls
|
|
14
|
+
* are the native client's.
|
|
15
|
+
*
|
|
16
|
+
* Shapes the SDK defines are Nitro structs. Payloads the Voidhash API defines
|
|
17
|
+
* (a person snapshot, a paywall, a schema, a flag payload, event properties)
|
|
18
|
+
* cross as JSON strings, so a server that adds a field needs no new binary.
|
|
19
|
+
*
|
|
20
|
+
* Errors: every promise rejects with an error whose message is
|
|
21
|
+
* `"<CODE>: <detail>"`; the detail may be empty. On Android the message
|
|
22
|
+
* reaches JavaScript as the throwable's printed stack trace and on both
|
|
23
|
+
* platforms a synchronous throw gets the method's name in front; the facade
|
|
24
|
+
* reads the code through all of that. Use a facade `VoidhashErrorCode` where
|
|
25
|
+
* one fits (`AUTHENTICATION_FAILED`, `INVALID_ARGUMENT`, `OFFER_UNAVAILABLE`,
|
|
26
|
+
* `PAYWALL_UNAVAILABLE`, `PURCHASE_IN_PROGRESS`,
|
|
27
|
+
* `READ_ONLY_PURCHASE_NOT_ALLOWED`, `REPLACED_SUBSCRIPTION_NOT_OWNED`,
|
|
28
|
+
* `SUBSCRIPTION_REPLACEMENT_REFUSED`, `UNSUPPORTED_PLATFORM`, a `FLOW_*`
|
|
29
|
+
* code), `NOT_INITIALIZED` before `start()`, after `shutdown()` and from a
|
|
30
|
+
* native client the native SDK made inert (nothing was done), and
|
|
31
|
+
* `NOT_IMPLEMENTED` for a member a build does not support yet. A purchase the
|
|
32
|
+
* store refused for a reason it named rejects with that reason's code:
|
|
33
|
+
* `PAYMENT_DECLINED` (Android only: Play
|
|
34
|
+
* `PAYMENT_DECLINED_DUE_TO_INSUFFICIENT_FUNDS`; StoreKit 2 has no declined
|
|
35
|
+
* payment error) or `INELIGIBLE_FOR_OFFER` (Play `USER_INELIGIBLE`, StoreKit
|
|
36
|
+
* `Product.PurchaseError.ineligibleForOffer`); the facade reports both as
|
|
37
|
+
* `FAILED_TO_PURCHASE` with `reason` set. Each facade method keeps the codes it reports today: a code it
|
|
38
|
+
* does not report reaches the app under that method's `FAILED_TO_*` code, its
|
|
39
|
+
* native message kept.
|
|
40
|
+
*
|
|
41
|
+
* Store-specific members (`appStore*`, `googlePlay*`) exist on both
|
|
42
|
+
* platforms, as Nitro requires; on the other platform they reject
|
|
43
|
+
* `UNSUPPORTED_PLATFORM` without doing anything. The facade checks the
|
|
44
|
+
* platform first, so that path is a safety net.
|
|
45
|
+
*
|
|
46
|
+
* Products and transactions: the fields every store has are the structs
|
|
47
|
+
* below, filled from the native SDK's `VoidhashProduct` and
|
|
48
|
+
* `VoidhashTransaction` field for field. Their `appStore` and `googlePlay`
|
|
49
|
+
* parts cross as JSON (`appStoreJson`, `googlePlayJson`), shaped exactly as
|
|
50
|
+
* the facade's `AppStoreProductInfo`, `GooglePlayProductInfo`,
|
|
51
|
+
* `AppStoreTransactionInfo` and `GooglePlayTransactionInfo` types in
|
|
52
|
+
* `src/core/entities/app-store.ts` and `google-play.ts` declare them, with the
|
|
53
|
+
* stores' own field names: dates as milliseconds since the epoch, a `Price`
|
|
54
|
+
* as `{ amount, amountMicros, currencyCode, formatted }`, a `Period` as
|
|
55
|
+
* `{ unit, count, iso8601 }`, an absent value left out or `null`. Every enum
|
|
56
|
+
* here has an `unknown` case: send it for a native case this contract does
|
|
57
|
+
* not list.
|
|
58
|
+
*
|
|
59
|
+
* Rejected publishable key: while API requests are paused because the key
|
|
60
|
+
* was rejected (`401`/`403`), the first `getPersonState`, `getFeatureFlags`
|
|
61
|
+
* or `getPaywall` call that has nothing cached to answer with rejects
|
|
62
|
+
* `AUTHENTICATION_FAILED`. That happens once per pause, shared across the
|
|
63
|
+
* three reads; a request the pause lets through that succeeds, or a new
|
|
64
|
+
* `start()`, ends the pause. Every later read answers as it would offline:
|
|
65
|
+
* from its cache, with an empty answer marked stale, or for a paywall with
|
|
66
|
+
* nothing cached `PAYWALL_UNAVAILABLE`. A read that can answer from its cache
|
|
67
|
+
* never rejects with it. The rejection is reported through the `diagnostic`
|
|
68
|
+
* event either way.
|
|
69
|
+
*
|
|
70
|
+
* Threading and ordering: methods may be called from the JS thread at any
|
|
71
|
+
* time; promises and the event listener settle on the JS thread, in the order
|
|
72
|
+
* the native client produced them. A call that emits events returns a pending
|
|
73
|
+
* promise and settles it only after those events were dispatched to the
|
|
74
|
+
* listener: a promise already settled when it is returned resolves in the
|
|
75
|
+
* JavaScript microtask queue, ahead of any event the call emitted.
|
|
76
|
+
*
|
|
77
|
+
* Identity generations: every identity a client adopts gets the next
|
|
78
|
+
* number of one counter that only grows for the life of the process, across
|
|
79
|
+
* every instance and every `start()`/`shutdown()` (a re-init, another
|
|
80
|
+
* project). Person and flag answers carry the generation they were read
|
|
81
|
+
* under; the facade publishes only the current generation's, so a late answer
|
|
82
|
+
* from an identity switched away from (or from a previous run) is never
|
|
83
|
+
* published, even after a switch back to the same distinct id.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
/** The end user's analytics consent, as `setAnalyticsConsent()` takes it. */
|
|
87
|
+
export type NativeAnalyticsConsent = "granted" | "denied" | "pending";
|
|
88
|
+
|
|
89
|
+
/** What happens to events captured while analytics consent is `pending`. */
|
|
90
|
+
export type NativePendingAnalytics = "drop" | "buffer";
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Why a person answer has the freshness it has: confirmed by the server just
|
|
94
|
+
* now, served from cache while a refresh still runs, served from cache
|
|
95
|
+
* because the refresh failed, or nothing was ever cached for this identity.
|
|
96
|
+
*/
|
|
97
|
+
export type NativeFreshnessReason = "fresh" | "refreshInFlight" | "refreshFailed" | "noCache";
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* How a person write ended: the server confirmed it, it waits in the
|
|
101
|
+
* person-write outbox, or nothing was left to write (`skipped`). Person
|
|
102
|
+
* attributes are written whatever the analytics consent, so `skipped` means
|
|
103
|
+
* one thing only: the write held nothing but an agreement to ad data sharing
|
|
104
|
+
* (`$ad_data_sharing` other than `false`), which is left out while consent is
|
|
105
|
+
* not granted.
|
|
106
|
+
*/
|
|
107
|
+
export type NativeWriteStatus = "confirmed" | "deferred" | "skipped";
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* What Google Play charges when a purchase replaces a subscription; the
|
|
111
|
+
* native SDK's replacement mode and the facade's
|
|
112
|
+
* `SubscriptionReplacementMode`, value for value.
|
|
113
|
+
*/
|
|
114
|
+
export type NativeSubscriptionReplacementMode =
|
|
115
|
+
| "withTimeProration"
|
|
116
|
+
| "chargeProratedPrice"
|
|
117
|
+
| "chargeFullPrice"
|
|
118
|
+
| "withoutProration"
|
|
119
|
+
| "deferred";
|
|
120
|
+
|
|
121
|
+
/** The subscription a purchase replaces instead of adding a second one next to it. */
|
|
122
|
+
export interface NativeSubscriptionReplacement {
|
|
123
|
+
/** Slug of the subscription product the end user has now. */
|
|
124
|
+
readonly productSlug: string;
|
|
125
|
+
readonly mode: NativeSubscriptionReplacementMode;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** The store a reported transaction comes from. */
|
|
129
|
+
export type NativeStorePlatform = "appStore" | "googlePlay";
|
|
130
|
+
|
|
131
|
+
/** The state another billing integration reported a Google Play purchase in. */
|
|
132
|
+
export type NativeReportedPurchaseState = "purchased" | "pending" | "unspecified";
|
|
133
|
+
|
|
134
|
+
/** The interface revision an app was built against at one location. */
|
|
135
|
+
export interface NativeFlowRevision {
|
|
136
|
+
readonly location: string;
|
|
137
|
+
readonly revision: number;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** What the app passes to one presentation of a flow. */
|
|
141
|
+
export interface NativeFlowPresentation {
|
|
142
|
+
/**
|
|
143
|
+
* The interface revision the app was built against; absent to use the one
|
|
144
|
+
* configured for the location, or 0 when there is none.
|
|
145
|
+
*/
|
|
146
|
+
readonly revision?: number;
|
|
147
|
+
/** The flow's inputs by name, as a JSON object of strings, numbers and booleans. */
|
|
148
|
+
readonly inputJson: string;
|
|
149
|
+
/** Names of the app actions the app handles. */
|
|
150
|
+
readonly actions: string[];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Which flow runtime draws flows, process-wide: the one built into the SDK
|
|
155
|
+
* (`linked`) or the flow runtime modules the server offers (`module`).
|
|
156
|
+
*/
|
|
157
|
+
export type NativeFlowRuntime = "linked" | "module";
|
|
158
|
+
export type NativeFlowLoading = "standard" | "none";
|
|
159
|
+
|
|
160
|
+
/** What a flow may do beyond purchases, restores, closing and analytics. */
|
|
161
|
+
export type NativeFlowCapability = "links" | "notifications" | "tracking" | "attributes";
|
|
162
|
+
|
|
163
|
+
/** Which payload a {@link NativeClientEvent} carries. */
|
|
164
|
+
export type NativeClientEventType =
|
|
165
|
+
| "person"
|
|
166
|
+
| "identity"
|
|
167
|
+
| "flags"
|
|
168
|
+
| "schema"
|
|
169
|
+
| "consent"
|
|
170
|
+
| "diagnostic"
|
|
171
|
+
| "transaction"
|
|
172
|
+
| "purchaseIntent";
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* When StoreKit shows its messages (price increase consent, billing issues,
|
|
176
|
+
* win-back offers): at once (`automatic`), or held while a Voidhash flow is
|
|
177
|
+
* on screen and shown once it closes (`deferWhileFlowPresented`). Google Play
|
|
178
|
+
* ignores it.
|
|
179
|
+
*/
|
|
180
|
+
export type NativeAppStoreMessages = "automatic" | "deferWhileFlowPresented";
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* What happens to a purchase the end user started on the App Store (a
|
|
184
|
+
* promoted in-app purchase, a win-back offer): bought through the normal
|
|
185
|
+
* purchase path once `start()` has resolved its identity
|
|
186
|
+
* (`purchaseWhenReady`), never before; or handed to the app as a
|
|
187
|
+
* `purchaseIntent` event (`manual`). Google Play ignores it.
|
|
188
|
+
*/
|
|
189
|
+
export type NativePurchaseIntents = "purchaseWhenReady" | "manual";
|
|
190
|
+
|
|
191
|
+
/** Coarse category of a diagnostic, the facade's `VoidhashDiagnosticKind`. */
|
|
192
|
+
export type NativeDiagnosticKind =
|
|
193
|
+
| "transport"
|
|
194
|
+
| "eviction"
|
|
195
|
+
| "breaker"
|
|
196
|
+
| "auth"
|
|
197
|
+
| "cache"
|
|
198
|
+
| "configuration"
|
|
199
|
+
| "consent";
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The facade's options after validation, as `configure()` receives them.
|
|
203
|
+
* Native automatic screen tracking stays off under React Native: the facade's
|
|
204
|
+
* navigation integrations report screens through `screen()`.
|
|
205
|
+
*/
|
|
206
|
+
export interface NativeClientConfiguration {
|
|
207
|
+
readonly publishableKey: string;
|
|
208
|
+
/** Absolute `http(s)` origin of the API, already validated. */
|
|
209
|
+
readonly baseUrl: string;
|
|
210
|
+
/** Origin of analytics ingest; `baseUrl` when absent. */
|
|
211
|
+
readonly ingestUrl?: string;
|
|
212
|
+
readonly debug: boolean;
|
|
213
|
+
/** Development purchases: `dev: true` in a debug build. Always `false` in release builds. */
|
|
214
|
+
readonly developmentMode: boolean;
|
|
215
|
+
/** Adopted on the first `start()` of the process; later starts resume the stored identity. */
|
|
216
|
+
readonly distinctId?: string;
|
|
217
|
+
/** Observer mode at start; `setReadOnly()` changes it later. */
|
|
218
|
+
readonly readOnly: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* The `analyticsConsent` option: applies when no consent was chosen, in this
|
|
221
|
+
* process or by an earlier `setAnalyticsConsent()` stored on the device.
|
|
222
|
+
*/
|
|
223
|
+
readonly analyticsConsent: NativeAnalyticsConsent;
|
|
224
|
+
/**
|
|
225
|
+
* A consent the app chose with `setAnalyticsConsent()` in this process
|
|
226
|
+
* before the client started. It wins over the stored one, is stored in its
|
|
227
|
+
* place, and is in effect before `start()` captures or sends anything.
|
|
228
|
+
*/
|
|
229
|
+
readonly chosenAnalyticsConsent?: NativeAnalyticsConsent;
|
|
230
|
+
/**
|
|
231
|
+
* The `analyticsWhilePending` option: `buffer` holds events captured while
|
|
232
|
+
* consent is `pending` in memory and records them when it is granted.
|
|
233
|
+
*/
|
|
234
|
+
readonly analyticsWhilePending: NativePendingAnalytics;
|
|
235
|
+
/** The `grantConsentOnIdentify` option: `identify()` grants a `pending` consent. */
|
|
236
|
+
readonly grantConsentOnIdentify: boolean;
|
|
237
|
+
readonly automaticLifecycleEvents: boolean;
|
|
238
|
+
/** Reads which ad brought this install, once per install; see the facade's option. */
|
|
239
|
+
readonly installAttribution: boolean;
|
|
240
|
+
/** The Meta app id to ask Meta's apps about on Android; iOS ignores it. */
|
|
241
|
+
readonly metaAppId?: string;
|
|
242
|
+
/** Locations whose flows are downloaded at start. */
|
|
243
|
+
readonly preloadLocations: string[];
|
|
244
|
+
/**
|
|
245
|
+
* The interface revision the app was built against, per location. Used to
|
|
246
|
+
* preload and as the revision of a presentation that names none.
|
|
247
|
+
*/
|
|
248
|
+
readonly flowRevisions: NativeFlowRevision[];
|
|
249
|
+
readonly flowCapabilities: NativeFlowCapability[];
|
|
250
|
+
/**
|
|
251
|
+
* The `flowRuntime` option. `module` switches the linked native renderer to
|
|
252
|
+
* flow runtime modules before anything resolves a flow; set once per
|
|
253
|
+
* process, it stays for the process.
|
|
254
|
+
*/
|
|
255
|
+
readonly flowRuntime: NativeFlowRuntime;
|
|
256
|
+
/**
|
|
257
|
+
* The `flowLoading` option: `none` turns the linked native renderer's loading
|
|
258
|
+
* screen off.
|
|
259
|
+
*/
|
|
260
|
+
readonly flowLoading: NativeFlowLoading;
|
|
261
|
+
/** `false` turns every `screen()` into a no-op. */
|
|
262
|
+
readonly screenTrackingEnabled: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* The `featureFlags.maxWaitMs` option: how long a flag read with nothing
|
|
265
|
+
* cached waits for Voidhash, in milliseconds, a non-negative integer. The
|
|
266
|
+
* native client's own default (2000) when absent. A binary built before
|
|
267
|
+
* this field ignores it and waits its default.
|
|
268
|
+
*/
|
|
269
|
+
readonly featureFlagMaxWaitMs?: number;
|
|
270
|
+
/**
|
|
271
|
+
* The `featureFlags.defaults` option: what each flag reads as while it has
|
|
272
|
+
* no evaluated value. A binary built before this field ignores it; the
|
|
273
|
+
* facade's hooks apply the defaults either way.
|
|
274
|
+
*/
|
|
275
|
+
readonly featureFlagDefaults?: Record<string, boolean>;
|
|
276
|
+
/** A runtime schema to use instead of fetching one (tests and previews only). */
|
|
277
|
+
readonly internalSchemaJson?: string;
|
|
278
|
+
/** The `appStoreMessages` option; see {@link NativeAppStoreMessages}. */
|
|
279
|
+
readonly appStoreMessages: NativeAppStoreMessages;
|
|
280
|
+
/** The `purchaseIntents` option; see {@link NativePurchaseIntents}. */
|
|
281
|
+
readonly purchaseIntents: NativePurchaseIntents;
|
|
282
|
+
/** The facade's package version, sent with every request. */
|
|
283
|
+
readonly sdkVersion: string;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** The identity the client adopted, and the generation it adopted it under. */
|
|
287
|
+
export interface NativeIdentityChange {
|
|
288
|
+
readonly distinctId: string;
|
|
289
|
+
/** The identity before the change; empty for the identity `start()` loaded. */
|
|
290
|
+
readonly previousDistinctId: string;
|
|
291
|
+
/** The adoption's identity generation; greater than every earlier one. */
|
|
292
|
+
readonly generation: number;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** A person snapshot with how far it can be trusted. */
|
|
296
|
+
export interface NativePersonState {
|
|
297
|
+
/** The identity the snapshot belongs to. */
|
|
298
|
+
readonly distinctId: string;
|
|
299
|
+
/** The identity generation the snapshot was read under. */
|
|
300
|
+
readonly generation: number;
|
|
301
|
+
/** The server's person snapshot as JSON; absent when there is none. */
|
|
302
|
+
readonly personJson?: string;
|
|
303
|
+
/** Served from cache past its refresh window. */
|
|
304
|
+
readonly isStale: boolean;
|
|
305
|
+
/** Served from cache past its expiry. */
|
|
306
|
+
readonly isExpired: boolean;
|
|
307
|
+
readonly reason: NativeFreshnessReason;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** Outcome of `identify()`. */
|
|
311
|
+
export interface NativeIdentifyResult {
|
|
312
|
+
/** The identity in effect once the call settled: the one `identify()` switched to. */
|
|
313
|
+
readonly identity: NativeIdentityChange;
|
|
314
|
+
/** `confirmed` once the server linked the identities, `deferred` while the link is queued. */
|
|
315
|
+
readonly status: NativeWriteStatus;
|
|
316
|
+
/** The confirmed person, or the last known snapshot for a deferred switch, as JSON. */
|
|
317
|
+
readonly personJson?: string;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** Outcome of `setPersonAttributesState()`. */
|
|
321
|
+
export interface NativePersonWriteResult {
|
|
322
|
+
readonly status: NativeWriteStatus;
|
|
323
|
+
/** The confirmed person, or the last known snapshot for a deferred write, as JSON. */
|
|
324
|
+
readonly personJson?: string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/** One evaluated flag. */
|
|
328
|
+
export interface NativeFeatureFlag {
|
|
329
|
+
readonly key: string;
|
|
330
|
+
readonly enabled: boolean;
|
|
331
|
+
/** The selected variant's key; absent for a flag without variants. */
|
|
332
|
+
readonly variantKey?: string;
|
|
333
|
+
/** The selected variant's payload as JSON; absent when it has none. */
|
|
334
|
+
readonly payloadJson?: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/** A flag evaluation for one request: every flag, or the keys asked for. */
|
|
338
|
+
export interface NativeFeatureFlagsResult {
|
|
339
|
+
/** The identity the evaluation belongs to. */
|
|
340
|
+
readonly distinctId: string;
|
|
341
|
+
/** The identity generation the evaluation was read under. */
|
|
342
|
+
readonly generation: number;
|
|
343
|
+
/**
|
|
344
|
+
* The keys this evaluation answers; absent for every flag. A `flags` event
|
|
345
|
+
* is stored under these; a read's answer is stored under the keys the
|
|
346
|
+
* caller asked for, whatever comes back here.
|
|
347
|
+
*/
|
|
348
|
+
readonly flagKeys?: string[];
|
|
349
|
+
readonly flags: NativeFeatureFlag[];
|
|
350
|
+
/** Served from cache past its refresh window, or no evaluation has ever succeeded. */
|
|
351
|
+
readonly isStale: boolean;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** The store a product or transaction belongs to; `development` for development-mode purchases. */
|
|
355
|
+
export type NativeStore = "appStore" | "googlePlay" | "development" | "unknown";
|
|
356
|
+
|
|
357
|
+
/** The native SDK's product type. */
|
|
358
|
+
export type NativeProductType =
|
|
359
|
+
| "subscription"
|
|
360
|
+
| "consumable"
|
|
361
|
+
| "nonConsumable"
|
|
362
|
+
| "nonRenewingSubscription"
|
|
363
|
+
| "unknown";
|
|
364
|
+
|
|
365
|
+
/** The unit of a {@link NativePeriod}. */
|
|
366
|
+
export type NativePeriodUnit = "day" | "week" | "month" | "year" | "unknown";
|
|
367
|
+
|
|
368
|
+
/** How a pricing phase is paid. */
|
|
369
|
+
export type NativePaymentMode = "freeTrial" | "payAsYouGo" | "payUpFront" | "unknown";
|
|
370
|
+
|
|
371
|
+
/** The native SDK's offer kind. */
|
|
372
|
+
export type NativeOfferKind = "introductory" | "promotional" | "winBack" | "oneTime" | "unknown";
|
|
373
|
+
|
|
374
|
+
/** The native SDK's `Price`. */
|
|
375
|
+
export interface NativePrice {
|
|
376
|
+
/** The amount in the currency's units (the native `Decimal`/`BigDecimal` as a double). */
|
|
377
|
+
readonly amount: number;
|
|
378
|
+
/** The exact amount × 1,000,000. */
|
|
379
|
+
readonly amountMicros: number;
|
|
380
|
+
/** ISO 4217. */
|
|
381
|
+
readonly currencyCode: string;
|
|
382
|
+
/** The store's localized string, never re-formatted. */
|
|
383
|
+
readonly formatted: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** The native SDK's `Period`, already normalised (7 days are 1 week). */
|
|
387
|
+
export interface NativePeriod {
|
|
388
|
+
readonly unit: NativePeriodUnit;
|
|
389
|
+
/** At least 1. */
|
|
390
|
+
readonly count: number;
|
|
391
|
+
/** Generated from the normalised value: `P1W`, `P3M`, `P1Y`. */
|
|
392
|
+
readonly iso8601: string;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/** The native SDK's `PricingPhase`. */
|
|
396
|
+
export interface NativePricingPhase {
|
|
397
|
+
readonly paymentMode: NativePaymentMode;
|
|
398
|
+
/** Per cycle; zero for a free trial. */
|
|
399
|
+
readonly price: NativePrice;
|
|
400
|
+
/** The length of one cycle. */
|
|
401
|
+
readonly period: NativePeriod;
|
|
402
|
+
/** How many cycles the phase lasts, at least 1. */
|
|
403
|
+
readonly cycles: number;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/** The native SDK's `Offer`. */
|
|
407
|
+
export interface NativeOffer {
|
|
408
|
+
/**
|
|
409
|
+
* Google Play: the Studio offer id when the offer is configured in Studio,
|
|
410
|
+
* else Play's offer id. App Store: a promotional offer's Studio id (only
|
|
411
|
+
* Studio-configured ones are listed), a win-back offer's App Store id, `""`
|
|
412
|
+
* for the introductory offer.
|
|
413
|
+
*/
|
|
414
|
+
readonly id: string;
|
|
415
|
+
readonly kind: NativeOfferKind;
|
|
416
|
+
/** Subscription offers: the phases before the regular price, in order. Empty for `oneTime`. */
|
|
417
|
+
readonly phases: NativePricingPhase[];
|
|
418
|
+
/** `oneTime` offers: what the product costs with it. Absent for subscription offers. */
|
|
419
|
+
readonly price?: NativePrice;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* The native SDK's `SubscriptionInfo`. The four `pricePer*` prices are the
|
|
424
|
+
* native SDK's, computed natively (rounded half-up to the currency's minor
|
|
425
|
+
* units, formatted with the store's locale); never computed in JavaScript.
|
|
426
|
+
*/
|
|
427
|
+
export interface NativeSubscriptionInfo {
|
|
428
|
+
readonly period: NativePeriod;
|
|
429
|
+
/** The App Store subscription group id; on Google Play, the subscription's product id. */
|
|
430
|
+
readonly groupId: string;
|
|
431
|
+
/** The intro offer this end user is eligible for right now; absent otherwise. */
|
|
432
|
+
readonly introOffer?: NativeOffer;
|
|
433
|
+
readonly pricePerDay: NativePrice;
|
|
434
|
+
readonly pricePerWeek: NativePrice;
|
|
435
|
+
readonly pricePerMonth: NativePrice;
|
|
436
|
+
readonly pricePerYear: NativePrice;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/** The native SDK's `VoidhashProduct`, one per Studio product slug. */
|
|
440
|
+
export interface NativeProduct {
|
|
441
|
+
/** The Voidhash product id (the schema product's `id`). */
|
|
442
|
+
readonly productId: string;
|
|
443
|
+
readonly slug: string;
|
|
444
|
+
readonly store: NativeStore;
|
|
445
|
+
/** The App Store or Google Play product id. */
|
|
446
|
+
readonly storeProductId: string;
|
|
447
|
+
readonly type: NativeProductType;
|
|
448
|
+
/** The Studio name. */
|
|
449
|
+
readonly name: string;
|
|
450
|
+
/** The store's localized title. */
|
|
451
|
+
readonly displayName: string;
|
|
452
|
+
/** The store's localized description. */
|
|
453
|
+
readonly description: string;
|
|
454
|
+
/** The regular price (Google Play: the recurring phase of the pinned base plan). */
|
|
455
|
+
readonly price: NativePrice;
|
|
456
|
+
/** Present exactly when `type` is `subscription`. */
|
|
457
|
+
readonly subscription?: NativeSubscriptionInfo;
|
|
458
|
+
/** The purchasable non-introductory offers for this end user. */
|
|
459
|
+
readonly offers: NativeOffer[];
|
|
460
|
+
/** The product's `appStore` part as JSON (`AppStoreProductInfo`); present exactly when `store` is `appStore`. */
|
|
461
|
+
readonly appStoreJson?: string;
|
|
462
|
+
/** The product's `googlePlay` part as JSON (`GooglePlayProductInfo`); present exactly when `store` is `googlePlay`. */
|
|
463
|
+
readonly googlePlayJson?: string;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/** The kind of offer a transaction was bought with; `code` for a redeemed offer code. */
|
|
467
|
+
export type NativeTransactionOfferKind =
|
|
468
|
+
| "introductory"
|
|
469
|
+
| "promotional"
|
|
470
|
+
| "winBack"
|
|
471
|
+
| "oneTime"
|
|
472
|
+
| "code"
|
|
473
|
+
| "unknown";
|
|
474
|
+
|
|
475
|
+
/** Where a transaction was made. */
|
|
476
|
+
export type NativeEnvironment = "production" | "sandbox" | "xcode" | "development" | "unknown";
|
|
477
|
+
|
|
478
|
+
/** The offer of a transaction; every field absent when the store does not say. */
|
|
479
|
+
export interface NativeTransactionOffer {
|
|
480
|
+
readonly id?: string;
|
|
481
|
+
readonly kind?: NativeTransactionOfferKind;
|
|
482
|
+
readonly paymentMode?: NativePaymentMode;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/** The native SDK's `VoidhashTransaction`. */
|
|
486
|
+
export interface NativeTransaction {
|
|
487
|
+
/** Apple `transactionId` / Play `purchaseToken`: stable from pending to purchased. */
|
|
488
|
+
readonly id: string;
|
|
489
|
+
/** Apple `originalID`; absent on Google Play. */
|
|
490
|
+
readonly originalId?: string;
|
|
491
|
+
/** Resolved through the schema; absent when no product has the store product. */
|
|
492
|
+
readonly productSlug?: string;
|
|
493
|
+
readonly storeProductId: string;
|
|
494
|
+
readonly store: NativeStore;
|
|
495
|
+
/** Milliseconds since the epoch. */
|
|
496
|
+
readonly purchasedAt: number;
|
|
497
|
+
/** Milliseconds since the epoch. */
|
|
498
|
+
readonly expiresAt?: number;
|
|
499
|
+
/** What the store charged for (`Purchase.getQuantity()` on Google Play). */
|
|
500
|
+
readonly quantity: number;
|
|
501
|
+
/** Apple `reason == .renewal` (iOS 17 and later); absent where unknown (Google Play). */
|
|
502
|
+
readonly isRenewal?: boolean;
|
|
503
|
+
readonly offer?: NativeTransactionOffer;
|
|
504
|
+
readonly environment: NativeEnvironment;
|
|
505
|
+
/** The `appStore` part as JSON (`AppStoreTransactionInfo`); present exactly when `store` is `appStore`. */
|
|
506
|
+
readonly appStoreJson?: string;
|
|
507
|
+
/** The `googlePlay` part as JSON (`GooglePlayTransactionInfo`); present exactly when `store` is `googlePlay`. */
|
|
508
|
+
readonly googlePlayJson?: string;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Which offer `purchase()` buys:
|
|
513
|
+
*
|
|
514
|
+
* - `automatic`: a subscription's `introOffer` when it has one, else the
|
|
515
|
+
* regular price. On Google Play this passes the intro offer's token.
|
|
516
|
+
* - `regularPrice`: the regular price (Play: the base plan's token; the App
|
|
517
|
+
* Store may still apply an intro offer the user is eligible for).
|
|
518
|
+
* - `offer`: the offer `offerId` names, resolved against the product's
|
|
519
|
+
* current `offers` and `subscription.introOffer` (of kind `offerKind` when
|
|
520
|
+
* given). `offerKind: introductory` always means the product's current
|
|
521
|
+
* `subscription.introOffer`, whatever `offerId` says (the App Store's has
|
|
522
|
+
* no id of its own, so the app may pass an empty one). None matching
|
|
523
|
+
* rejects `OFFER_UNAVAILABLE`, never buying at the regular price instead.
|
|
524
|
+
*/
|
|
525
|
+
export type NativeOfferSelection = "automatic" | "regularPrice" | "offer";
|
|
526
|
+
|
|
527
|
+
/** App Store options of a purchase; Google Play ignores them. */
|
|
528
|
+
export interface NativeAppStorePurchaseOptions {
|
|
529
|
+
/** StoreKit's `simulatesAskToBuyInSandbox` purchase option. */
|
|
530
|
+
readonly simulatesAskToBuyInSandbox?: boolean;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/** Google Play options of a purchase; the App Store ignores them. */
|
|
534
|
+
export interface NativeGooglePlayPurchaseOptions {
|
|
535
|
+
/** `BillingFlowParams.setIsOfferPersonalized`. */
|
|
536
|
+
readonly isOfferPersonalized?: boolean;
|
|
537
|
+
/** `BillingFlowParams.setObfuscatedProfileId`. */
|
|
538
|
+
readonly obfuscatedProfileId?: string;
|
|
539
|
+
/** Buys exactly this offer token, whatever `offerSelection` says. */
|
|
540
|
+
readonly offerToken?: string;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/** What `purchase()` buys beyond the product. */
|
|
544
|
+
export interface NativePurchaseOptions {
|
|
545
|
+
readonly offerSelection: NativeOfferSelection;
|
|
546
|
+
/** With `offer`: the offer's id. */
|
|
547
|
+
readonly offerId?: string;
|
|
548
|
+
/** With `offer`: the offer's kind, when the app passed an offer rather than an id. */
|
|
549
|
+
readonly offerKind?: NativeOfferKind;
|
|
550
|
+
/**
|
|
551
|
+
* At least 1. Anything but 1 is honoured for App Store consumables only;
|
|
552
|
+
* elsewhere it rejects `INVALID_ARGUMENT` (the facade checks it first).
|
|
553
|
+
*/
|
|
554
|
+
readonly quantity: number;
|
|
555
|
+
readonly replacing?: NativeSubscriptionReplacement;
|
|
556
|
+
readonly appStore?: NativeAppStorePurchaseOptions;
|
|
557
|
+
readonly googlePlay?: NativeGooglePlayPurchaseOptions;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* How a purchase ended: the store charged (`purchased`), it needs outside
|
|
562
|
+
* action such as Ask to Buy or a pending payment first (`pending`), or the
|
|
563
|
+
* end user dismissed the sheet (`cancelled`).
|
|
564
|
+
*/
|
|
565
|
+
export type NativePurchaseOutcome = "purchased" | "pending" | "cancelled";
|
|
566
|
+
|
|
567
|
+
/** The native SDK's purchase result. */
|
|
568
|
+
export interface NativePurchaseResult {
|
|
569
|
+
readonly outcome: NativePurchaseOutcome;
|
|
570
|
+
/** With `purchased`: the transaction. With a Play `deferred` replacement it names the old product. */
|
|
571
|
+
readonly transaction?: NativeTransaction;
|
|
572
|
+
/** With `purchased`: `true` once Voidhash accepted the receipt, `false` while it waits on the device. */
|
|
573
|
+
readonly synced?: boolean;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/** A transaction the native SDK handled outside `purchase()`; its transaction update stream. */
|
|
577
|
+
export interface NativeTransactionUpdate {
|
|
578
|
+
readonly transaction: NativeTransaction;
|
|
579
|
+
/** `true` once Voidhash accepted the receipt, `false` while it waits on the device. */
|
|
580
|
+
readonly synced: boolean;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/** A purchase the end user started on the App Store, as `purchaseIntents: manual` hands it over. */
|
|
584
|
+
export interface NativePurchaseIntent {
|
|
585
|
+
readonly productSlug: string;
|
|
586
|
+
/** The offer the end user chose (a win-back offer, iOS 18 and later). */
|
|
587
|
+
readonly offer?: NativeOffer;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/** The storefront the end user buys from. */
|
|
591
|
+
export interface NativeStorefront {
|
|
592
|
+
/** ISO 3166-1 alpha-2 (StoreKit's alpha-3 converted). */
|
|
593
|
+
readonly countryCode: string;
|
|
594
|
+
/** ISO 4217, when the store says. */
|
|
595
|
+
readonly currencyCode?: string;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/** How a refund request ended. */
|
|
599
|
+
export type NativeRefundRequestStatus = "success" | "userCancelled";
|
|
600
|
+
|
|
601
|
+
/** StoreKit's `RenewalState`. */
|
|
602
|
+
export type NativeAppStoreSubscriptionState =
|
|
603
|
+
| "subscribed"
|
|
604
|
+
| "expired"
|
|
605
|
+
| "inBillingRetryPeriod"
|
|
606
|
+
| "inGracePeriod"
|
|
607
|
+
| "revoked"
|
|
608
|
+
| "unknown";
|
|
609
|
+
|
|
610
|
+
/** One StoreKit `Product.SubscriptionInfo.Status`. */
|
|
611
|
+
export interface NativeAppStoreSubscriptionStatus {
|
|
612
|
+
readonly state: NativeAppStoreSubscriptionState;
|
|
613
|
+
/** The status's verified transaction. */
|
|
614
|
+
readonly transaction: NativeTransaction;
|
|
615
|
+
/**
|
|
616
|
+
* The verified `RenewalInfo` as JSON, shaped as the facade's
|
|
617
|
+
* `AppStoreRenewalInfo`: `{ willAutoRenew, autoRenewProductId?,
|
|
618
|
+
* expirationReason?, gracePeriodExpiresAt?, isInBillingRetry,
|
|
619
|
+
* priceIncreaseStatus?, renewalPrice?, eligibleWinBackOfferIds }`.
|
|
620
|
+
*/
|
|
621
|
+
readonly renewalInfoJson: string;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/** Which Google Play in-app message outcome `googlePlayShowInAppMessages()` had. */
|
|
625
|
+
export type NativeInAppMessageStatus = "noActionNeeded" | "subscriptionStatusUpdated";
|
|
626
|
+
|
|
627
|
+
/** The outcome of Play's `showInAppMessages` (TRANSACTIONAL category). */
|
|
628
|
+
export interface NativeInAppMessageResult {
|
|
629
|
+
readonly status: NativeInAppMessageStatus;
|
|
630
|
+
/** With `subscriptionStatusUpdated`: the purchase token whose status changed. */
|
|
631
|
+
readonly purchaseToken?: string;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/** A purchase another billing integration completed, by its store identifier only. */
|
|
635
|
+
export interface NativeReportedTransaction {
|
|
636
|
+
readonly platform: NativeStorePlatform;
|
|
637
|
+
/** App Store transaction id; required for `appStore`. */
|
|
638
|
+
readonly transactionId?: string;
|
|
639
|
+
/** Google Play purchase token; required for `googlePlay`. */
|
|
640
|
+
readonly purchaseToken?: string;
|
|
641
|
+
/**
|
|
642
|
+
* Google Play: the state the integration reported. A `pending` or
|
|
643
|
+
* `unspecified` purchase is ignored, as the facade does today; report it
|
|
644
|
+
* again once it is purchased. Absent counts as purchased.
|
|
645
|
+
*/
|
|
646
|
+
readonly purchaseState?: NativeReportedPurchaseState;
|
|
647
|
+
/**
|
|
648
|
+
* App Store: the transaction's JWS when the integration handed it over.
|
|
649
|
+
* Sent as the proof a purchase or restore claim needs; without it the
|
|
650
|
+
* native SDK reads it from the device's purchase history.
|
|
651
|
+
*/
|
|
652
|
+
readonly signedTransaction?: string;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/** Outcome of a flush or a shutdown. */
|
|
656
|
+
export interface NativeFlushStatus {
|
|
657
|
+
/** Events the server accepted. */
|
|
658
|
+
readonly flushed: number;
|
|
659
|
+
/** Events still queued. */
|
|
660
|
+
readonly pending: number;
|
|
661
|
+
/** Why delivery stopped, when it did. */
|
|
662
|
+
readonly lastErrorMessage?: string;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/** A non-fatal event the native client handled on its own; the facade's `VoidhashDiagnostic`. */
|
|
666
|
+
export interface NativeDiagnostic {
|
|
667
|
+
readonly kind: NativeDiagnosticKind;
|
|
668
|
+
/** Stable code, for example `ANALYTICS_EVENT_DROPPED`. */
|
|
669
|
+
readonly code: string;
|
|
670
|
+
readonly operation: string;
|
|
671
|
+
readonly retryable: boolean;
|
|
672
|
+
readonly httpStatus?: number;
|
|
673
|
+
readonly message?: string;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* One state change, delivered to the listener. `type` names the one payload
|
|
678
|
+
* field that is set:
|
|
679
|
+
*
|
|
680
|
+
* - `identity` → `identity`: the identity `start()` loaded, and every later
|
|
681
|
+
* switch (`identify`, `reset`, `signOut`, and the switch back when the
|
|
682
|
+
* server refused an `identify`), each under a new generation. A switch's
|
|
683
|
+
* event is dispatched before the promise of the call that caused it
|
|
684
|
+
* settles, and before any `person` or `flags` event or read answer of the
|
|
685
|
+
* new generation.
|
|
686
|
+
* - `person` → `person`: the current person or its freshness changed (a
|
|
687
|
+
* refresh, a purchase, a restore, a delivered identity link or attribute
|
|
688
|
+
* write).
|
|
689
|
+
* - `flags` → `flags`: an evaluation was refreshed, keyed by its `flagKeys`.
|
|
690
|
+
* - `schema` → `schemaJson`: a runtime schema was loaded or fetched.
|
|
691
|
+
* - `consent` → `consent`: the analytics consent in effect changed, including
|
|
692
|
+
* the one `start()` settled on.
|
|
693
|
+
* - `diagnostic` → `diagnostic`. Includes `PRODUCT_NOT_FOUND` and
|
|
694
|
+
* `PRODUCT_TYPE_MISMATCH` (kind `configuration`, operation `getProducts`
|
|
695
|
+
* on both platforms), once per slug per products load, its message naming
|
|
696
|
+
* the slug and the store's reason or both types. A product Studio does not
|
|
697
|
+
* sell in this store is not reported by a load of every product.
|
|
698
|
+
* - `transaction` → `transaction`: every element of the native transaction
|
|
699
|
+
* update stream (purchases completed outside `purchase()`: Ask to Buy
|
|
700
|
+
* approvals, pending payments, offer codes, promoted purchases, and on the
|
|
701
|
+
* App Store renewals seen on the device; Google Play reports no renewals),
|
|
702
|
+
* after the native SDK handled it. Never one that `purchase()` itself
|
|
703
|
+
* answers with.
|
|
704
|
+
* - `purchaseIntent` → `purchaseIntent`: with `purchaseIntents: manual`, each
|
|
705
|
+
* App Store purchase intent for a product the schema has; an intent for
|
|
706
|
+
* another product is dropped and reported as `PRODUCT_NOT_FOUND`. Sent
|
|
707
|
+
* from `start()` on, maybe before the app added a listener to the facade,
|
|
708
|
+
* which holds them until it does.
|
|
709
|
+
*/
|
|
710
|
+
export interface NativeClientEvent {
|
|
711
|
+
readonly type: NativeClientEventType;
|
|
712
|
+
readonly identity?: NativeIdentityChange;
|
|
713
|
+
readonly person?: NativePersonState;
|
|
714
|
+
readonly flags?: NativeFeatureFlagsResult;
|
|
715
|
+
readonly schemaJson?: string;
|
|
716
|
+
readonly consent?: NativeAnalyticsConsent;
|
|
717
|
+
readonly diagnostic?: NativeDiagnostic;
|
|
718
|
+
readonly transaction?: NativeTransactionUpdate;
|
|
719
|
+
readonly purchaseIntent?: NativePurchaseIntent;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* The native Voidhash client behind one React Native `VoidhashClient`: one
|
|
724
|
+
* hybrid object per client, owning the storage namespace of its publishable
|
|
725
|
+
* key and base URL.
|
|
726
|
+
*/
|
|
727
|
+
@iOS({ language: "swift", implementation: { className: "HybridVoidhashNativeClient" } })
|
|
728
|
+
@Android({ language: "kotlin", implementation: { className: "HybridVoidhashNativeClient" } })
|
|
729
|
+
export declare class VoidhashNativeClient extends HybridObject {
|
|
730
|
+
public constructor();
|
|
731
|
+
|
|
732
|
+
// ---- Lifecycle ----
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* The version of this contract the binary implements, the facade's
|
|
736
|
+
* `NATIVE_CONTRACT_VERSION` (`src/core/native/native-client.ts`). The
|
|
737
|
+
* facade reads it before anything else and starts no native client of
|
|
738
|
+
* another version: a JavaScript bundle updated over the air onto a build
|
|
739
|
+
* made for another version fails `init()`, asking for a new build, instead
|
|
740
|
+
* of misreading the answers. A binary whose hybrid has no such member
|
|
741
|
+
* implements version 0. Raise it with every change to this file that a
|
|
742
|
+
* binary built before the change cannot honour. Synchronous; callable
|
|
743
|
+
* before `configure()`.
|
|
744
|
+
*/
|
|
745
|
+
contractVersion(): number;
|
|
746
|
+
/**
|
|
747
|
+
* Applies the configuration; touches neither storage nor the network.
|
|
748
|
+
* Called before the first `start()`, and again after `shutdown()` resolved
|
|
749
|
+
* to start once more (a re-init), possibly with other options.
|
|
750
|
+
*/
|
|
751
|
+
configure(configuration: NativeClientConfiguration): void;
|
|
752
|
+
/**
|
|
753
|
+
* Starts the client from local state: identity, caches and queues are
|
|
754
|
+
* loaded, store observation and background delivery begin, and the boot
|
|
755
|
+
* refresh starts behind the call. Resolves without waiting for the network
|
|
756
|
+
* (after the device's first unlock).
|
|
757
|
+
*
|
|
758
|
+
* Before it loads anything, it imports what earlier releases of this
|
|
759
|
+
* package (its TypeScript core) stored on the device for this namespace:
|
|
760
|
+
* the identity, the analytics consent and session, queued events, identity
|
|
761
|
+
* links and store receipts, and the cached person, flags, schema and
|
|
762
|
+
* paywalls. A queued receipt is never lost: a store is deleted only once
|
|
763
|
+
* its records are in the native stores, and an import that fails is retried
|
|
764
|
+
* at the next `start()`. The importers live in this module's native code
|
|
765
|
+
* (`ios/` and `android/`), not in the SDKs.
|
|
766
|
+
*
|
|
767
|
+
* The analytics consent it settles on is the one chosen in this process
|
|
768
|
+
* (`chosenAnalyticsConsent`), else the stored one, else the
|
|
769
|
+
* `analyticsConsent` option. Events captured before `start()` are handed to
|
|
770
|
+
* the native SDK, which records them when that consent is `granted`, holds
|
|
771
|
+
* them when it is `pending` and pending events are buffered, and discards
|
|
772
|
+
* them otherwise.
|
|
773
|
+
*
|
|
774
|
+
* Before resolving it dispatches, in this order: the loaded `identity`, the
|
|
775
|
+
* `consent` in effect, the cached or injected `schema` (when there is one),
|
|
776
|
+
* and the cached `person` (when there is one).
|
|
777
|
+
*
|
|
778
|
+
* Another instance that still owns the same storage namespace (a JavaScript
|
|
779
|
+
* reload leaves the previous one running, never shut down) is retired first:
|
|
780
|
+
* it persists its queues as `shutdown()` would, without waiting on the
|
|
781
|
+
* network, and rejects every later call with `NOT_INITIALIZED`. A purchase
|
|
782
|
+
* the retired instance had started is still recorded by it (its receipt in
|
|
783
|
+
* the outbox, its SDK-started marker, on Google Play its unfinished-purchase
|
|
784
|
+
* record), and this instance syncs and finishes it as its own.
|
|
785
|
+
*
|
|
786
|
+
* Android allows one live client per process: configuring a new instance
|
|
787
|
+
* retires the previous one as above, whatever its storage namespace.
|
|
788
|
+
*
|
|
789
|
+
* A `start()` while another is in flight joins it and settles with it; a
|
|
790
|
+
* `start()` on a started client resolves at once and changes nothing. A
|
|
791
|
+
* `shutdown()` that overtakes a start waits for it: the start shuts down
|
|
792
|
+
* whatever it built and rejects with `NOT_INITIALIZED` before `shutdown()`
|
|
793
|
+
* resolves, so nothing it started keeps running.
|
|
794
|
+
*/
|
|
795
|
+
start(): Promise<void>;
|
|
796
|
+
/**
|
|
797
|
+
* Flushes for at most about two seconds, persists what is still queued and
|
|
798
|
+
* stops every observer, timer and listener. Every call still pending settles
|
|
799
|
+
* (or rejects with `NOT_INITIALIZED`) before this resolves. Whatever was not
|
|
800
|
+
* delivered goes out after the next `start()`.
|
|
801
|
+
*/
|
|
802
|
+
shutdown(): Promise<NativeFlushStatus>;
|
|
803
|
+
/** Registers the one listener for {@link NativeClientEvent}s, replacing any earlier one. */
|
|
804
|
+
setEventListener(listener: (event: NativeClientEvent) => void): void;
|
|
805
|
+
/** Removes the listener; nothing is delivered until the next `setEventListener()`. */
|
|
806
|
+
removeEventListener(): void;
|
|
807
|
+
|
|
808
|
+
// ---- Identity and person ----
|
|
809
|
+
|
|
810
|
+
/** The current distinct id. */
|
|
811
|
+
getDistinctId(): Promise<string>;
|
|
812
|
+
/**
|
|
813
|
+
* Switches to `externalUserId` and links the previous anonymous identity
|
|
814
|
+
* onto it. Resolves `confirmed` with the person, or `deferred` with the last
|
|
815
|
+
* known snapshot when the link is queued, together with the identity it
|
|
816
|
+
* switched to. Rejects for an invalid id (`INVALID_ARGUMENT`) without
|
|
817
|
+
* switching, or for a verdict of the API: the client then switches back to
|
|
818
|
+
* the previous identity (a new generation, its `identity` dispatched before
|
|
819
|
+
* the rejection), keeping what it cached for it. The facade puts back the
|
|
820
|
+
* person and flag evaluations it held before the call, so nothing needs to
|
|
821
|
+
* be re-sent for them.
|
|
822
|
+
*
|
|
823
|
+
* Identifying the current identity again adopts nothing: it resolves with
|
|
824
|
+
* the current `NativeIdentityChange` and dispatches no `identity` event. A
|
|
825
|
+
* profile that differs from the one last sent goes out as an identify
|
|
826
|
+
* request, whatever the analytics consent; the same profile sends nothing.
|
|
827
|
+
* Backs both `identify()` and `identifySync()`.
|
|
828
|
+
*/
|
|
829
|
+
identify(externalUserId: string, email?: string, name?: string): Promise<NativeIdentifyResult>;
|
|
830
|
+
/**
|
|
831
|
+
* Starts a fresh visitor: a new anonymous identity and analytics session,
|
|
832
|
+
* with what was cached for the previous identity dropped. When someone is
|
|
833
|
+
* signed in this is `signOut()`, `$sign_out` and flush included; for an
|
|
834
|
+
* anonymous identity nothing is captured or sent. Resolves with the
|
|
835
|
+
* identity it switched to.
|
|
836
|
+
*/
|
|
837
|
+
reset(): Promise<NativeIdentityChange>;
|
|
838
|
+
/**
|
|
839
|
+
* Signs the user out: captures `$sign_out` under the signing-out identity
|
|
840
|
+
* (with automatic lifecycle events on and consent granted), switches to a
|
|
841
|
+
* fresh anonymous identity, starts a new analytics
|
|
842
|
+
* session, then flushes for at most about two seconds. Resolves with the
|
|
843
|
+
* identity it switched to. Does nothing, and sends nothing, when nobody is
|
|
844
|
+
* signed in: it resolves with the identity in effect.
|
|
845
|
+
*/
|
|
846
|
+
signOut(): Promise<NativeIdentityChange>;
|
|
847
|
+
/**
|
|
848
|
+
* Puts the end user in group `groupKey` of `groupType`, which every event
|
|
849
|
+
* captured after it resolves carries in `$groups`, and stores it with the
|
|
850
|
+
* identity. `propertiesJson`, a JSON object of strings, numbers and
|
|
851
|
+
* booleans, sets the group's properties; they go out as a `$groupidentify`
|
|
852
|
+
* event, which is also sent when the group of that type changed. Rejects
|
|
853
|
+
* `INVALID_ARGUMENT` for a type or key the native SDK would refuse. Runs in
|
|
854
|
+
* call order with identity changes.
|
|
855
|
+
*/
|
|
856
|
+
group(groupType: string, groupKey: string, propertiesJson?: string): Promise<void>;
|
|
857
|
+
/**
|
|
858
|
+
* Replaces every group the end user is in with the ones in `groupsJson`: an
|
|
859
|
+
* object from group type to `{ id, properties? }`. A type it leaves out is
|
|
860
|
+
* dropped. A `$groupidentify` is sent only for a group whose id or
|
|
861
|
+
* properties changed since they were last sent. A type or id the native
|
|
862
|
+
* SDK finds invalid is left out with a warning. Runs in call order with
|
|
863
|
+
* identity changes; rejects `INVALID_ARGUMENT`, changing nothing, when
|
|
864
|
+
* `groupsJson` is not such an object or an entry has no string `id`.
|
|
865
|
+
*/
|
|
866
|
+
setGroups(groupsJson: string): Promise<void>;
|
|
867
|
+
/** Takes the end user out of every group. Runs in call order with identity changes. */
|
|
868
|
+
resetGroups(): Promise<void>;
|
|
869
|
+
/** The groups the end user belongs to, by group type; empty before `start()`. Synchronous. */
|
|
870
|
+
getGroups(): Record<string, string>;
|
|
871
|
+
/**
|
|
872
|
+
* Queues person attributes (`{ email?, name?, …traits }` as JSON, flat
|
|
873
|
+
* values only) without waiting on the network, whatever the analytics
|
|
874
|
+
* consent and in observer mode too. Only an agreement to ad data sharing is
|
|
875
|
+
* left out while consent is not granted.
|
|
876
|
+
*/
|
|
877
|
+
setPersonAttributes(attributesJson: string): Promise<void>;
|
|
878
|
+
/**
|
|
879
|
+
* Writes person attributes and reports whether the server confirmed them,
|
|
880
|
+
* whatever the analytics consent and in observer mode too; see
|
|
881
|
+
* {@link NativeWriteStatus} for `skipped`. A confirmed write's `person`
|
|
882
|
+
* event is dispatched before the promise settles.
|
|
883
|
+
*/
|
|
884
|
+
setPersonAttributesState(attributesJson: string): Promise<NativePersonWriteResult>;
|
|
885
|
+
/**
|
|
886
|
+
* The current person, cache-first: a fresh entry at once, a stale one after
|
|
887
|
+
* at most 500 ms of waiting for its refresh. `forceFetch` prefers the server.
|
|
888
|
+
* An answer read under an earlier generation still reaches the caller that
|
|
889
|
+
* asked, but the facade does not publish it to the hooks.
|
|
890
|
+
*/
|
|
891
|
+
getPersonState(forceFetch: boolean): Promise<NativePersonState>;
|
|
892
|
+
/**
|
|
893
|
+
* Drops the cached person snapshot; the next read asks the server. On both
|
|
894
|
+
* platforms a `person` event with no person (stale, expired, `noCache`) is
|
|
895
|
+
* dispatched before the promise settles.
|
|
896
|
+
*/
|
|
897
|
+
resetPersonCache(): Promise<void>;
|
|
898
|
+
|
|
899
|
+
// ---- Flags, paywalls and products ----
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Evaluates `flagKeys` (every flag when absent), cache-first. With nothing
|
|
903
|
+
* cached it waits at most `featureFlagMaxWaitMs` (2 s by default), then
|
|
904
|
+
* answers with no flags; the evaluation goes on and lands as a `flags`
|
|
905
|
+
* event. A requested key without an evaluated value is answered with its
|
|
906
|
+
* `featureFlagDefaults` entry, enabled or not and without a variant, when
|
|
907
|
+
* it has one.
|
|
908
|
+
*/
|
|
909
|
+
getFeatureFlags(flagKeys?: string[]): Promise<NativeFeatureFlagsResult>;
|
|
910
|
+
/**
|
|
911
|
+
* The paywall assigned to `location` as JSON, `"null"` when none is.
|
|
912
|
+
* Rejects `PAYWALL_UNAVAILABLE` when nothing is cached and the server
|
|
913
|
+
* cannot be reached.
|
|
914
|
+
*/
|
|
915
|
+
getPaywall(location: string): Promise<string>;
|
|
916
|
+
/**
|
|
917
|
+
* Every product the store returned, one per Studio product slug, sorted by
|
|
918
|
+
* slug: the native SDK's `getProducts()`, one store query per call. A
|
|
919
|
+
* product the store did not return is left out and reported once per load
|
|
920
|
+
* as the `PRODUCT_NOT_FOUND` diagnostic, one it sells as another type than
|
|
921
|
+
* Studio's as `PRODUCT_TYPE_MISMATCH`. Offers and intro eligibility are
|
|
922
|
+
* this end user's: the facade calls it again after an identity change, a
|
|
923
|
+
* completed purchase or restore (a flow's included) and a transaction
|
|
924
|
+
* update other than a renewal. The products it answers are the ones
|
|
925
|
+
* `purchase()` buys until the next call, a completed purchase or a restore.
|
|
926
|
+
*/
|
|
927
|
+
getProducts(): Promise<NativeProduct[]>;
|
|
928
|
+
|
|
929
|
+
// ---- Purchases ----
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Buys the product with slug `productSlug` through the native SDK's
|
|
933
|
+
* `purchase(product, options)`, with the product the last `getProducts()`
|
|
934
|
+
* answered for that slug; one it does not hold (none loaded yet, or a
|
|
935
|
+
* purchase or restore since) is asked of the store first (an unknown slug
|
|
936
|
+
* rejects `INVALID_ARGUMENT`). Resolves
|
|
937
|
+
* `purchased` with the transaction and whether Voidhash accepted the
|
|
938
|
+
* receipt, `pending`, or `cancelled`: a cancelled sheet and a pending
|
|
939
|
+
* payment are results, not rejections. A purchase in observer mode rejects
|
|
940
|
+
* `READ_ONLY_PURCHASE_NOT_ALLOWED`; a second purchase while one is in
|
|
941
|
+
* flight (including one a flow started) `PURCHASE_IN_PROGRESS`; an offer
|
|
942
|
+
* that cannot be bought `OFFER_UNAVAILABLE`; a store refusal with a reason
|
|
943
|
+
* `PAYMENT_DECLINED` (Android only) or `INELIGIBLE_FOR_OFFER` (both; the
|
|
944
|
+
* products held are dropped then, and nothing is retried at the regular
|
|
945
|
+
* price).
|
|
946
|
+
*
|
|
947
|
+
* When the purchase changed the person, its `person` event is dispatched
|
|
948
|
+
* before the promise settles. A `pending` purchase stays this client's to
|
|
949
|
+
* sync and finish when it completes, also after a relaunch; it later
|
|
950
|
+
* arrives as a `transaction` event.
|
|
951
|
+
*
|
|
952
|
+
* With `replacing`, Google Play replaces that subscription and buys nothing
|
|
953
|
+
* when it cannot: `REPLACED_SUBSCRIPTION_NOT_OWNED` when the account does
|
|
954
|
+
* not own it, `INVALID_ARGUMENT` when either product is not a subscription
|
|
955
|
+
* or both are the same, `SUBSCRIPTION_REPLACEMENT_REFUSED` when Google Play
|
|
956
|
+
* refuses before its sheet opens. A `deferred` replacement resolves
|
|
957
|
+
* `purchased` with the old product's transaction. The App Store ignores
|
|
958
|
+
* `replacing`.
|
|
959
|
+
*/
|
|
960
|
+
purchase(productSlug: string, options: NativePurchaseOptions): Promise<NativePurchaseResult>;
|
|
961
|
+
/**
|
|
962
|
+
* Revalidates the store's purchase history for the current identity and
|
|
963
|
+
* resolves with the person the restore refreshed, read from the cache as
|
|
964
|
+
* `getPersonState(false)` reads it: under the current generation, with
|
|
965
|
+
* its real freshness (`fresh` only when the refresh after the restore
|
|
966
|
+
* succeeded); with no person to answer, `personJson` absent. The person's
|
|
967
|
+
* `person` event is dispatched before the promise settles.
|
|
968
|
+
*/
|
|
969
|
+
restorePurchases(): Promise<NativePersonState>;
|
|
970
|
+
/** Reports pending purchases and current store entitlements. */
|
|
971
|
+
syncPurchases(): Promise<void>;
|
|
972
|
+
/**
|
|
973
|
+
* Reports a purchase another billing integration completed. Resolves once
|
|
974
|
+
* the receipt is stored; delivery goes on in the background. `isRestore`
|
|
975
|
+
* sends it as an explicit restore for the current identity.
|
|
976
|
+
*/
|
|
977
|
+
reportTransaction(transaction: NativeReportedTransaction, isRestore: boolean): Promise<void>;
|
|
978
|
+
|
|
979
|
+
// ---- Store actions, both stores ----
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Opens the store's subscription management. App Store:
|
|
983
|
+
* `AppStore.showManageSubscriptions(in:subscriptionGroupID:)` with the
|
|
984
|
+
* group of the product `productSlug` names (iOS 17 and later), else without
|
|
985
|
+
* a group. Google Play: opens
|
|
986
|
+
* `https://play.google.com/store/account/subscriptions?sku=<storeProductId>&package=<package>`,
|
|
987
|
+
* without `sku` when no product is named. Resolves once it was shown.
|
|
988
|
+
*/
|
|
989
|
+
showManageSubscriptions(productSlug?: string): Promise<void>;
|
|
990
|
+
/**
|
|
991
|
+
* Opens offer-code redemption. App Store: the newest offer-code sheet the
|
|
992
|
+
* SDK builds against (`presentOfferCodeRedeemSheet(in:)` on iOS 16 and
|
|
993
|
+
* later), `code` ignored; a transaction it returns goes through the normal
|
|
994
|
+
* receipt path and arrives as a `transaction` event. Google Play: opens
|
|
995
|
+
* `https://play.google.com/redeem?code=<code>` (no `code` parameter without one).
|
|
996
|
+
*/
|
|
997
|
+
presentCodeRedemption(code?: string): Promise<void>;
|
|
998
|
+
/**
|
|
999
|
+
* The storefront the end user buys from: StoreKit's `Storefront.current`
|
|
1000
|
+
* (country converted to alpha-2) or Play's `getBillingConfigAsync`.
|
|
1001
|
+
* Resolves `undefined` when the store has none to give; rejects when asking failed.
|
|
1002
|
+
*/
|
|
1003
|
+
// oxlint-disable-next-line effect/prefer-option-over-null -- mirrors the Nitro contract, where an optional is `undefined`.
|
|
1004
|
+
getStorefront(): Promise<NativeStorefront | undefined>;
|
|
1005
|
+
/**
|
|
1006
|
+
* App Store: `AppStore.canMakePayments`. Google Play: the billing
|
|
1007
|
+
* connection is ready and billing is not unavailable.
|
|
1008
|
+
*/
|
|
1009
|
+
canMakePayments(): Promise<boolean>;
|
|
1010
|
+
|
|
1011
|
+
// ---- App Store (Google Play rejects UNSUPPORTED_PLATFORM) ----
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* StoreKit's refund request sheet for the transaction `transactionId`
|
|
1015
|
+
* (`Transaction.beginRefundRequest(for:in:)`). Rejects `INVALID_ARGUMENT`
|
|
1016
|
+
* for a transaction StoreKit does not know.
|
|
1017
|
+
*/
|
|
1018
|
+
appStoreBeginRefundRequest(transactionId: string): Promise<NativeRefundRequestStatus>;
|
|
1019
|
+
/**
|
|
1020
|
+
* Every status of subscription group `groupId` the Apple account has
|
|
1021
|
+
* (`Product.SubscriptionInfo.status(for:)`), the current end user's first
|
|
1022
|
+
* (the one whose transaction carries their app account token), then the
|
|
1023
|
+
* others, Family Sharing ones included; verified ones only.
|
|
1024
|
+
*/
|
|
1025
|
+
appStoreSubscriptionStatus(groupId: string): Promise<NativeAppStoreSubscriptionStatus[]>;
|
|
1026
|
+
/** The verified transactions of `Transaction.currentEntitlements`. */
|
|
1027
|
+
appStoreCurrentEntitlements(): Promise<NativeTransaction[]>;
|
|
1028
|
+
/**
|
|
1029
|
+
* The verified `AppTransaction.shared` as JSON, shaped as the facade's
|
|
1030
|
+
* `AppTransaction`: `{ originalAppVersion, originalPurchaseDate,
|
|
1031
|
+
* environment, appTransactionId?, originalPlatform?, jwsRepresentation }`,
|
|
1032
|
+
* the date in milliseconds since the epoch, `environment` one of
|
|
1033
|
+
* `production`, `sandbox`, `xcode`, `originalPlatform` one of `iOS`,
|
|
1034
|
+
* `macOS`, `tvOS`, `visionOS`.
|
|
1035
|
+
*/
|
|
1036
|
+
appStoreAppTransaction(): Promise<string>;
|
|
1037
|
+
|
|
1038
|
+
// ---- Google Play (the App Store rejects UNSUPPORTED_PLATFORM) ----
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Play's `showInAppMessages` for the TRANSACTIONAL category, on the current
|
|
1042
|
+
* activity. On `subscriptionStatusUpdated` the native SDK syncs purchases
|
|
1043
|
+
* and refreshes the person (its `person` event before the promise settles).
|
|
1044
|
+
*/
|
|
1045
|
+
googlePlayShowInAppMessages(): Promise<NativeInAppMessageResult>;
|
|
1046
|
+
/**
|
|
1047
|
+
* The account's purchases (subscriptions and one-time), suspended
|
|
1048
|
+
* subscriptions included when `includeSuspended`. A suspended purchase is
|
|
1049
|
+
* never submitted, acknowledged or consumed.
|
|
1050
|
+
*/
|
|
1051
|
+
googlePlayQueryPurchases(includeSuspended: boolean): Promise<NativeTransaction[]>;
|
|
1052
|
+
/**
|
|
1053
|
+
* `BillingClient.isFeatureSupported` for the feature `feature` names:
|
|
1054
|
+
* `subscriptions`, `subscriptionsUpdate`, `inAppMessaging`,
|
|
1055
|
+
* `productDetails`, `billingConfig`, `alternativeBillingOnly`,
|
|
1056
|
+
* `externalOffer` (the `FeatureType` constants). Another name rejects
|
|
1057
|
+
* `INVALID_ARGUMENT`.
|
|
1058
|
+
*/
|
|
1059
|
+
googlePlayIsFeatureSupported(feature: string): Promise<boolean>;
|
|
1060
|
+
|
|
1061
|
+
// ---- Configuration at runtime ----
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Records analytics consent; it applies at once. Resolves whether it was
|
|
1065
|
+
* also stored for later launches.
|
|
1066
|
+
*
|
|
1067
|
+
* Also accepted before `start()`: a consent other than `granted` then
|
|
1068
|
+
* discards the events captured so far, and the consent is stored by
|
|
1069
|
+
* `start()` (the facade also passes it as `chosenAnalyticsConsent`). It
|
|
1070
|
+
* resolves `false` then, as nothing is stored yet.
|
|
1071
|
+
*/
|
|
1072
|
+
setAnalyticsConsent(consent: NativeAnalyticsConsent): Promise<boolean>;
|
|
1073
|
+
/**
|
|
1074
|
+
* The analytics consent in effect. Before `start()` the stored consent is
|
|
1075
|
+
* not loaded yet, so it answers the consent chosen through
|
|
1076
|
+
* `setAnalyticsConsent` or, without one, the configured
|
|
1077
|
+
* `analyticsConsent` option.
|
|
1078
|
+
*/
|
|
1079
|
+
getAnalyticsConsent(): NativeAnalyticsConsent;
|
|
1080
|
+
/** Switches observer mode; a purchase already in flight keeps its mode. */
|
|
1081
|
+
setReadOnly(readOnly: boolean): void;
|
|
1082
|
+
isReadOnly(): boolean;
|
|
1083
|
+
|
|
1084
|
+
// ---- Analytics ----
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* Queues an event. Synchronous and never throws: the call itself stamps the
|
|
1088
|
+
* event with the current identity, session and time and takes its place in
|
|
1089
|
+
* the queue, so events keep call order and the identity they were captured
|
|
1090
|
+
* under. On iOS this needs an intake outside the client's actor, called
|
|
1091
|
+
* synchronously from the bridge. `propertiesJson` is a JSON object the
|
|
1092
|
+
* facade already made safe.
|
|
1093
|
+
*
|
|
1094
|
+
* Allowed before `start()`: such events are kept in memory with their call
|
|
1095
|
+
* time and attributed to the identity `start()` loads; past 100 of them the
|
|
1096
|
+
* oldest is dropped, reported as `ANALYTICS_EVENT_DROPPED` once the listener
|
|
1097
|
+
* is set. What becomes of them depends on the consent `start()` settles on
|
|
1098
|
+
* (see `start()`); a `setAnalyticsConsent("denied")` discards them at once.
|
|
1099
|
+
*/
|
|
1100
|
+
capture(eventName: string, propertiesJson: string): void;
|
|
1101
|
+
/**
|
|
1102
|
+
* Queues a `$screen` event for the screen `name`, stamped and ordered like
|
|
1103
|
+
* `capture`. The facade's screen tracker has already applied the app's
|
|
1104
|
+
* screen-tracking settings (`mapScreen`, whether route params are kept):
|
|
1105
|
+
* `propertiesJson` holds the `$screen_*` properties to record as they are,
|
|
1106
|
+
* with nothing stripped again.
|
|
1107
|
+
*/
|
|
1108
|
+
screen(name: string, propertiesJson: string): void;
|
|
1109
|
+
/**
|
|
1110
|
+
* `capture` for an event the facade held back, which it does while an
|
|
1111
|
+
* identity change the app called before the event has not switched the
|
|
1112
|
+
* identity yet: recorded under the identity and session now in effect, at
|
|
1113
|
+
* `capturedAt` (milliseconds since the epoch), the time the app captured it.
|
|
1114
|
+
* A binary built before this member has none; the facade then calls
|
|
1115
|
+
* `capture`, and the event takes the time of that call.
|
|
1116
|
+
*/
|
|
1117
|
+
captureAt(eventName: string, propertiesJson: string, capturedAt: number): void;
|
|
1118
|
+
/** `screen` for a screen the facade held back; see `captureAt`. */
|
|
1119
|
+
screenAt(name: string, propertiesJson: string, capturedAt: number): void;
|
|
1120
|
+
/** Sends person writes, receipts and events, waiting at most about two seconds. */
|
|
1121
|
+
flush(): Promise<NativeFlushStatus>;
|
|
1122
|
+
/** The active analytics session id; empty when there is none. Synchronous. */
|
|
1123
|
+
getSessionId(): string;
|
|
1124
|
+
|
|
1125
|
+
// ---- Flows ----
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Presents the flow assigned to `location` and resolves once it ends, as
|
|
1129
|
+
* JSON, one of:
|
|
1130
|
+
*
|
|
1131
|
+
* - `{"outcome":"<outcome>","output":{…}}`, with `"productId":"<product
|
|
1132
|
+
* slug>"` when the outcome is `purchased`. `purchased`, `restored`
|
|
1133
|
+
* and `dismissed` are built in (the last also when the app closed the
|
|
1134
|
+
* flow or another replaced it); any other outcome is the one the flow
|
|
1135
|
+
* finished with. `output` holds the flow's outputs by name.
|
|
1136
|
+
* - `{"failure":{"code":"<FLOW_* code>","message":"<FLOW_* code>: <detail>"}}`
|
|
1137
|
+
* for a flow that could not be presented, where the code is one of
|
|
1138
|
+
* `FLOW_DISABLED`, `FLOW_NOT_ASSIGNED`, `FLOW_UNAVAILABLE`,
|
|
1139
|
+
* `FLOW_RENDERER_MISSING`, `FLOW_UNSUPPORTED_PACKAGE`,
|
|
1140
|
+
* `FLOW_PRODUCTS_UNAVAILABLE` and `FLOW_PRESENTATION_FAILED`.
|
|
1141
|
+
*
|
|
1142
|
+
* `onAction` runs an app action the flow calls: it receives the action's
|
|
1143
|
+
* name and its arguments as a JSON object, and resolves with the reply as
|
|
1144
|
+
* a JSON object or rejects. It is called only for the names in
|
|
1145
|
+
* `presentation.actions`; the native side answers every other call itself.
|
|
1146
|
+
*
|
|
1147
|
+
* Purchases and restores the flow starts go through this client. Never
|
|
1148
|
+
* rejects for a flow that cannot be shown: that is a `failure`.
|
|
1149
|
+
*/
|
|
1150
|
+
presentFlow(
|
|
1151
|
+
location: string,
|
|
1152
|
+
presentation: NativeFlowPresentation,
|
|
1153
|
+
onAction: (name: string, argsJson: string) => Promise<string>,
|
|
1154
|
+
): Promise<string>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Changes inputs of the flow on screen; `valuesJson` is a JSON object of
|
|
1157
|
+
* values by input name. Does nothing when no flow is shown.
|
|
1158
|
+
*/
|
|
1159
|
+
updateFlowInput(valuesJson: string): Promise<void>;
|
|
1160
|
+
/** Closes the flow on screen, if any; its presentation resolves as dismissed. */
|
|
1161
|
+
dismissFlow(): Promise<void>;
|
|
1162
|
+
}
|