UNPKG

react-native-qonversion

Version:

Qonversion provides full in-app purchases infrastructure, so you do not need to build your own server for receipt validation. Implement in-app subscriptions, validate user receipts, check subscription status, and provide access to your app features and co

366 lines 18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NoCodesErrorCode = exports.QonversionErrorCode = exports.ScreenPresentationStyle = exports.RemoteConfigurationAssignmentType = exports.ActionType = exports.RemoteConfigurationSourceType = exports.ExperimentGroupType = exports.IntroEligibilityStatus = exports.OfferingTag = exports.SKProductDiscountPaymentMode = exports.SKProductDiscountType = exports.SKPeriodUnit = exports.EntitlementsCacheLifetime = exports.PurchaseUpdatePolicy = exports.AttributionProvider = exports.UserPropertyKey = exports.TransactionType = exports.EntitlementGrantType = exports.TransactionOwnershipType = exports.TransactionEnvironment = exports.EntitlementSource = exports.EntitlementRenewState = exports.PricingPhaseType = exports.PricingPhaseRecurrenceMode = exports.SubscriptionPeriodUnit = exports.ProductType = exports.Environment = exports.LaunchMode = void 0; var LaunchMode; (function (LaunchMode) { LaunchMode["ANALYTICS"] = "Analytics"; LaunchMode["SUBSCRIPTION_MANAGEMENT"] = "SubscriptionManagement"; })(LaunchMode = exports.LaunchMode || (exports.LaunchMode = {})); var Environment; (function (Environment) { Environment["SANDBOX"] = "Sandbox"; Environment["PRODUCTION"] = "Production"; })(Environment = exports.Environment || (exports.Environment = {})); var ProductType; (function (ProductType) { ProductType["TRIAL"] = "Trial"; ProductType["INTRO"] = "Intro"; ProductType["SUBSCRIPTION"] = "Subscription"; ProductType["IN_APP"] = "InApp"; ProductType["UNKNOWN"] = "Unknown"; })(ProductType = exports.ProductType || (exports.ProductType = {})); var SubscriptionPeriodUnit; (function (SubscriptionPeriodUnit) { SubscriptionPeriodUnit["DAY"] = "Day"; SubscriptionPeriodUnit["WEEK"] = "Week"; SubscriptionPeriodUnit["MONTH"] = "Month"; SubscriptionPeriodUnit["YEAR"] = "Year"; SubscriptionPeriodUnit["UNKNOWN"] = "Unknown"; })(SubscriptionPeriodUnit = exports.SubscriptionPeriodUnit || (exports.SubscriptionPeriodUnit = {})); /** * Recurrence mode of the pricing phase. */ var PricingPhaseRecurrenceMode; (function (PricingPhaseRecurrenceMode) { /** * The billing plan payment recurs for infinite billing periods unless canceled. */ PricingPhaseRecurrenceMode["INFINITE_RECURRING"] = "InfiniteRecurring"; /** * The billing plan payment recurs for a fixed number of billing periods * set in {@link ProductPricingPhase.billingCycleCount}. */ PricingPhaseRecurrenceMode["FINITE_RECURRING"] = "FiniteRecurring"; /** * The billing plan payment is a one-time charge that does not repeat. */ PricingPhaseRecurrenceMode["NON_RECURRING"] = "NonRecurring"; /** * Unknown recurrence mode. */ PricingPhaseRecurrenceMode["UNKNOWN"] = "Unknown"; })(PricingPhaseRecurrenceMode = exports.PricingPhaseRecurrenceMode || (exports.PricingPhaseRecurrenceMode = {})); /** * Type of the pricing phase. */ var PricingPhaseType; (function (PricingPhaseType) { /** * Regular subscription without any discounts like trial or intro offers. */ PricingPhaseType["REGULAR"] = "Regular"; /** * A free phase. */ PricingPhaseType["FREE_TRIAL"] = "FreeTrial"; /** * A phase with a discounted payment for a single period. */ PricingPhaseType["DISCOUNTED_SINGLE_PAYMENT"] = "DiscountedSinglePayment"; /** * A phase with a discounted payment for several periods, described in {@link ProductPricingPhase.billingCycleCount}. */ PricingPhaseType["DISCOUNTED_RECURRING_PAYMENT"] = "DiscountedRecurringPayment"; /** * Unknown pricing phase type. */ PricingPhaseType["UNKNOWN"] = "Unknown"; })(PricingPhaseType = exports.PricingPhaseType || (exports.PricingPhaseType = {})); var EntitlementRenewState; (function (EntitlementRenewState) { EntitlementRenewState["NON_RENEWABLE"] = "non_renewable"; EntitlementRenewState["UNKNOWN"] = "unknown"; EntitlementRenewState["WILL_RENEW"] = "will_renew"; EntitlementRenewState["CANCELED"] = "canceled"; EntitlementRenewState["BILLING_ISSUE"] = "billing_issue"; })(EntitlementRenewState = exports.EntitlementRenewState || (exports.EntitlementRenewState = {})); var EntitlementSource; (function (EntitlementSource) { EntitlementSource["UNKNOWN"] = "Unknown"; EntitlementSource["APP_STORE"] = "AppStore"; EntitlementSource["PLAY_STORE"] = "PlayStore"; EntitlementSource["STRIPE"] = "Stripe"; EntitlementSource["MANUAL"] = "Manual"; })(EntitlementSource = exports.EntitlementSource || (exports.EntitlementSource = {})); var TransactionEnvironment; (function (TransactionEnvironment) { TransactionEnvironment["PRODUCTION"] = "Production"; TransactionEnvironment["SANDBOX"] = "Sandbox"; })(TransactionEnvironment = exports.TransactionEnvironment || (exports.TransactionEnvironment = {})); var TransactionOwnershipType; (function (TransactionOwnershipType) { TransactionOwnershipType["OWNER"] = "Owner"; TransactionOwnershipType["FAMILY_SHARING"] = "FamilySharing"; })(TransactionOwnershipType = exports.TransactionOwnershipType || (exports.TransactionOwnershipType = {})); var EntitlementGrantType; (function (EntitlementGrantType) { EntitlementGrantType["PURCHASE"] = "Purchase"; EntitlementGrantType["FAMILY_SHARING"] = "FamilySharing"; EntitlementGrantType["OFFER_CODE"] = "OfferCode"; EntitlementGrantType["MANUAL"] = "Manual"; })(EntitlementGrantType = exports.EntitlementGrantType || (exports.EntitlementGrantType = {})); var TransactionType; (function (TransactionType) { TransactionType["UNKNOWN"] = "Unknown"; TransactionType["SUBSCRIPTION_STARTED"] = "SubscriptionStarted"; TransactionType["SUBSCRIPTION_RENEWED"] = "SubscriptionRenewed"; TransactionType["TRIAL_STARTED"] = "TrialStarted"; TransactionType["INTRO_STARTED"] = "IntroStarted"; TransactionType["INTRO_RENEWED"] = "IntroRenewed"; TransactionType["NON_CONSUMABLE_PURCHASE"] = "NonConsumablePurchase"; })(TransactionType = exports.TransactionType || (exports.TransactionType = {})); var UserPropertyKey; (function (UserPropertyKey) { UserPropertyKey["EMAIL"] = "Email"; UserPropertyKey["NAME"] = "Name"; UserPropertyKey["KOCHAVA_DEVICE_ID"] = "KochavaDeviceId"; UserPropertyKey["APPS_FLYER_USER_ID"] = "AppsFlyerUserId"; UserPropertyKey["ADJUST_AD_ID"] = "AdjustAdId"; UserPropertyKey["CUSTOM_USER_ID"] = "CustomUserId"; UserPropertyKey["FACEBOOK_ATTRIBUTION"] = "FacebookAttribution"; UserPropertyKey["FIREBASE_APP_INSTANCE_ID"] = "FirebaseAppInstanceId"; UserPropertyKey["APP_SET_ID"] = "AppSetId"; UserPropertyKey["ADVERTISING_ID"] = "AdvertisingId"; UserPropertyKey["APP_METRICA_DEVICE_ID"] = "AppMetricaDeviceId"; UserPropertyKey["APP_METRICA_USER_PROFILE_ID"] = "AppMetricaUserProfileId"; UserPropertyKey["PUSH_WOOSH_HW_ID"] = "PushWooshHwId"; UserPropertyKey["PUSH_WOOSH_USER_ID"] = "PushWooshUserId"; UserPropertyKey["TENJIN_ANALYTICS_INSTALLATION_ID"] = "TenjinAnalyticsInstallationId"; UserPropertyKey["CUSTOM"] = "Custom"; })(UserPropertyKey = exports.UserPropertyKey || (exports.UserPropertyKey = {})); var AttributionProvider; (function (AttributionProvider) { AttributionProvider["APPSFLYER"] = "AppsFlyer"; AttributionProvider["BRANCH"] = "Branch"; AttributionProvider["ADJUST"] = "Adjust"; AttributionProvider["APPLE_SEARCH_ADS"] = "AppleSearchAds"; AttributionProvider["APPLE_AD_SERVICES"] = "AppleAdServices"; })(AttributionProvider = exports.AttributionProvider || (exports.AttributionProvider = {})); /** * A policy used for purchase updates on Android, which describes * how to migrate from purchased plan to a new one. * * Used in {@link PurchaseOptions} class for purchase updates. */ var PurchaseUpdatePolicy; (function (PurchaseUpdatePolicy) { /** * The new plan takes effect immediately, and the user is charged full price of new plan * and is given a full billing cycle of subscription, plus remaining prorated time * from the old plan. */ PurchaseUpdatePolicy["CHARGE_FULL_PRICE"] = "ChargeFullPrice"; /** * The new plan takes effect immediately, and the billing cycle remains the same. */ PurchaseUpdatePolicy["CHARGE_PRORATED_PRICE"] = "ChargeProratedPrice"; /** * The new plan takes effect immediately, and the remaining time will be prorated * and credited to the user. */ PurchaseUpdatePolicy["WITH_TIME_PRORATION"] = "WithTimeProration"; /** * The new purchase takes effect immediately, the new plan will take effect * when the old item expires. */ PurchaseUpdatePolicy["DEFERRED"] = "Deferred"; /** * The new plan takes effect immediately, and the new price will be charged * on next recurrence time. */ PurchaseUpdatePolicy["WITHOUT_PRORATION"] = "WithoutProration"; /** * Unknown police. */ PurchaseUpdatePolicy["UNKNOWN"] = "Unknown"; })(PurchaseUpdatePolicy = exports.PurchaseUpdatePolicy || (exports.PurchaseUpdatePolicy = {})); var EntitlementsCacheLifetime; (function (EntitlementsCacheLifetime) { EntitlementsCacheLifetime["WEEK"] = "Week"; EntitlementsCacheLifetime["TWO_WEEKS"] = "TwoWeeks"; EntitlementsCacheLifetime["MONTH"] = "Month"; EntitlementsCacheLifetime["TWO_MONTHS"] = "TwoMonths"; EntitlementsCacheLifetime["THREE_MONTHS"] = "ThreeMonths"; EntitlementsCacheLifetime["SIX_MONTHS"] = "SixMonths"; EntitlementsCacheLifetime["YEAR"] = "Year"; EntitlementsCacheLifetime["UNLIMITED"] = "Unlimited"; })(EntitlementsCacheLifetime = exports.EntitlementsCacheLifetime || (exports.EntitlementsCacheLifetime = {})); exports.SKPeriodUnit = { 0: "DAY", 1: "WEEK", 2: "MONTH", 3: "YEAR", }; exports.SKProductDiscountType = { 0: "INTRODUCTORY", 1: "SUBSCRIPTION", }; exports.SKProductDiscountPaymentMode = { 0: "PAY_AS_YOU_GO", 1: "PAY_UP_FRONT", 2: "FREE_TRIAL", }; exports.OfferingTag = { "-1": "UNKNOWN", "0": "NONE", "1": "MAIN", }; var IntroEligibilityStatus; (function (IntroEligibilityStatus) { IntroEligibilityStatus["UNKNOWN"] = "unknown"; IntroEligibilityStatus["NON_INTRO_OR_TRIAL_PRODUCT"] = "non_intro_or_trial_product"; IntroEligibilityStatus["ELIGIBLE"] = "intro_or_trial_eligible"; IntroEligibilityStatus["INELIGIBLE"] = "intro_or_trial_ineligible"; })(IntroEligibilityStatus = exports.IntroEligibilityStatus || (exports.IntroEligibilityStatus = {})); var ExperimentGroupType; (function (ExperimentGroupType) { ExperimentGroupType["UNKNOWN"] = "unknown"; ExperimentGroupType["CONTROL"] = "control"; ExperimentGroupType["TREATMENT"] = "treatment"; })(ExperimentGroupType = exports.ExperimentGroupType || (exports.ExperimentGroupType = {})); var RemoteConfigurationSourceType; (function (RemoteConfigurationSourceType) { RemoteConfigurationSourceType["UNKNOWN"] = "unknown"; RemoteConfigurationSourceType["EXPERIMENT_CONTROL_GROUP"] = "experiment_control_group"; RemoteConfigurationSourceType["EXPERIMENT_TREATMENT_GROUP"] = "experiment_treatment_group"; RemoteConfigurationSourceType["REMOTE_CONFIGURATION"] = "remote_configuration"; })(RemoteConfigurationSourceType = exports.RemoteConfigurationSourceType || (exports.RemoteConfigurationSourceType = {})); var ActionType; (function (ActionType) { /** * Unspecified action type */ ActionType["UNKNOWN"] = "unknown"; /** * URL action that opens the URL using SafariViewController */ ActionType["URL"] = "url"; /** * Deeplink action that opens if Application can open specified deeplink */ ActionType["DEEPLINK"] = "deeplink"; /** * Navigation to another No-Codes screen */ ActionType["NAVIGATION"] = "navigation"; /** * Purchase the product */ ActionType["PURCHASE"] = "purchase"; /** * Restore all purchases */ ActionType["RESTORE"] = "restore"; /** * Close current screen */ ActionType["CLOSE"] = "close"; /** * Close all No-Code screens */ ActionType["CLOSE_ALL"] = "closeAll"; })(ActionType = exports.ActionType || (exports.ActionType = {})); var RemoteConfigurationAssignmentType; (function (RemoteConfigurationAssignmentType) { RemoteConfigurationAssignmentType["UNKNOWN"] = "unknown"; RemoteConfigurationAssignmentType["AUTO"] = "auto"; RemoteConfigurationAssignmentType["MANUAL"] = "manual"; })(RemoteConfigurationAssignmentType = exports.RemoteConfigurationAssignmentType || (exports.RemoteConfigurationAssignmentType = {})); var ScreenPresentationStyle; (function (ScreenPresentationStyle) { /** * on Android - default screen transaction animation will be used. * on iOS - not a modal presentation. This style pushes a controller to a current navigation stack. * For iOS NavigationController on the top of the stack is required. */ ScreenPresentationStyle["PUSH"] = "Push"; /** * on Android - screen will move from bottom to top. * on iOS - UIModalPresentationFullScreen analog. */ ScreenPresentationStyle["FULL_SCREEN"] = "FullScreen"; /** * iOS only - UIModalPresentationPopover analog */ ScreenPresentationStyle["POPOVER"] = "Popover"; /** * Android only - screen will appear/disappear without any animation. * For iOS consider providing the {@link ScreenPresentationConfig.animated} flag. */ ScreenPresentationStyle["NO_ANIMATION"] = "NoAnimation"; })(ScreenPresentationStyle = exports.ScreenPresentationStyle || (exports.ScreenPresentationStyle = {})); var QonversionErrorCode; (function (QonversionErrorCode) { QonversionErrorCode["UNKNOWN"] = "Unknown"; QonversionErrorCode["API_RATE_LIMIT_EXCEEDED"] = "ApiRateLimitExceeded"; QonversionErrorCode["APPLE_STORE_ERROR"] = "AppleStoreError"; QonversionErrorCode["BACKEND_ERROR"] = "BackendError"; QonversionErrorCode["BILLING_UNAVAILABLE"] = "BillingUnavailable"; QonversionErrorCode["CLIENT_INVALID"] = "ClientInvalid"; QonversionErrorCode["CLOUD_SERVICE_NETWORK_CONNECTION_FAILED"] = "CloudServiceNetworkConnectionFailed"; QonversionErrorCode["CLOUD_SERVICE_PERMISSION_DENIED"] = "CloudServicePermissionDenied"; QonversionErrorCode["CLOUD_SERVICE_REVOKED"] = "CloudServiceRevoked"; QonversionErrorCode["FAILED_TO_RECEIVE_DATA"] = "FailedToReceiveData"; QonversionErrorCode["FEATURE_NOT_SUPPORTED"] = "FeatureNotSupported"; QonversionErrorCode["FRAUD_PURCHASE"] = "FraudPurchase"; QonversionErrorCode["INCORRECT_REQUEST"] = "IncorrectRequest"; QonversionErrorCode["INTERNAL_ERROR"] = "InternalError"; QonversionErrorCode["INVALID_CLIENT_UID"] = "InvalidClientUid"; QonversionErrorCode["INVALID_CREDENTIALS"] = "InvalidCredentials"; QonversionErrorCode["INVALID_STORE_CREDENTIALS"] = "InvalidStoreCredentials"; QonversionErrorCode["LAUNCH_ERROR"] = "LaunchError"; QonversionErrorCode["NETWORK_CONNECTION_FAILED"] = "NetworkConnectionFailed"; QonversionErrorCode["OFFERINGS_NOT_FOUND"] = "OfferingsNotFound"; QonversionErrorCode["PAYMENT_INVALID"] = "PaymentInvalid"; QonversionErrorCode["PAYMENT_NOT_ALLOWED"] = "PaymentNotAllowed"; QonversionErrorCode["PLAY_STORE_ERROR"] = "PlayStoreError"; QonversionErrorCode["PRIVACY_ACKNOWLEDGEMENT_REQUIRED"] = "PrivacyAcknowledgementRequired"; QonversionErrorCode["PRODUCT_ALREADY_OWNED"] = "ProductAlreadyOwned"; QonversionErrorCode["PRODUCT_NOT_FOUND"] = "ProductNotFound"; QonversionErrorCode["PRODUCT_NOT_OWNED"] = "ProductNotOwned"; QonversionErrorCode["PROJECT_CONFIG_ERROR"] = "ProjectConfigError"; QonversionErrorCode["PURCHASE_CANCELED"] = "PurchaseCanceled"; QonversionErrorCode["PURCHASE_INVALID"] = "PurchaseInvalid"; QonversionErrorCode["PURCHASE_PENDING"] = "PurchasePending"; QonversionErrorCode["PURCHASE_UNSPECIFIED"] = "PurchaseUnspecified"; QonversionErrorCode["RECEIPT_VALIDATION_ERROR"] = "ReceiptValidationError"; QonversionErrorCode["REMOTE_CONFIGURATION_NOT_AVAILABLE"] = "RemoteConfigurationNotAvailable"; QonversionErrorCode["RESPONSE_PARSING_FAILED"] = "ResponseParsingFailed"; QonversionErrorCode["STORE_PRODUCT_NOT_AVAILABLE"] = "StoreProductNotAvailable"; QonversionErrorCode["UNAUTHORIZED_REQUEST_DATA"] = "UnauthorizedRequestData"; QonversionErrorCode["UNKNOWN_CLIENT_PLATFORM"] = "UnknownClientPlatform"; })(QonversionErrorCode = exports.QonversionErrorCode || (exports.QonversionErrorCode = {})); var NoCodesErrorCode; (function (NoCodesErrorCode) { NoCodesErrorCode["UNKNOWN"] = "Unknown"; NoCodesErrorCode["BAD_NETWORK_REQUEST"] = "BadNetworkRequest"; NoCodesErrorCode["BAD_RESPONSE"] = "BadResponse"; NoCodesErrorCode["ACTIVITY_START"] = "ActivityStart"; NoCodesErrorCode["NETWORK_REQUEST_EXECUTION"] = "NetworkRequestExecution"; NoCodesErrorCode["SERIALIZATION"] = "Serialization"; NoCodesErrorCode["DESERIALIZATION"] = "Deserialization"; NoCodesErrorCode["REQUEST_DENIED"] = "RequestDenied"; NoCodesErrorCode["MAPPING"] = "Mapping"; NoCodesErrorCode["BACKEND_ERROR"] = "BackendError"; NoCodesErrorCode["SCREEN_NOT_FOUND"] = "ScreenNotFound"; NoCodesErrorCode["QONVERSION_ERROR"] = "QonversionError"; NoCodesErrorCode["INTERNAL"] = "Internal"; NoCodesErrorCode["AUTHORIZATION_FAILED"] = "AuthorizationFailed"; NoCodesErrorCode["CRITICAL"] = "Critical"; NoCodesErrorCode["PRODUCT_NOT_FOUND"] = "ProductNotFound"; NoCodesErrorCode["PRODUCTS_LOADING_FAILED"] = "ProductsLoadingFailed"; NoCodesErrorCode["RATE_LIMIT_EXCEEDED"] = "RateLimitExceeded"; NoCodesErrorCode["SCREEN_LOADING_FAILED"] = "ScreenLoadingFailed"; NoCodesErrorCode["SDK_INITIALIZATION_ERROR"] = "SDKInitializationError"; // iOS })(NoCodesErrorCode = exports.NoCodesErrorCode || (exports.NoCodesErrorCode = {})); //# sourceMappingURL=enums.js.map