diff --git a/android/build.gradle b/android/build.gradle index 73af9c8..cc0c4d4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -80,7 +80,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion") dependencies { implementation "com.facebook.react:react-android" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation "io.qonversion:sandwich:6.0.11" + implementation "io.qonversion:sandwich:7.1.0" } if (isNewArchitectureEnabled()) { diff --git a/android/src/main/java/com/qonversion/reactnativesdk/NoCodesModule.kt b/android/src/main/java/com/qonversion/reactnativesdk/NoCodesModule.kt index 5993fb2..5e9df0b 100644 --- a/android/src/main/java/com/qonversion/reactnativesdk/NoCodesModule.kt +++ b/android/src/main/java/com/qonversion/reactnativesdk/NoCodesModule.kt @@ -32,9 +32,9 @@ class NoCodesModule(private val reactContext: ReactApplicationContext) : NativeN } @ReactMethod - override fun initialize(projectKey: String, source: String, version: String) { + override fun initialize(projectKey: String, source: String, version: String, proxyUrl: String?) { noCodesSandwich.storeSdkInfo(reactContext, source, version) - noCodesSandwich.initialize(reactContext, projectKey, null, null, null) + noCodesSandwich.initialize(reactContext, projectKey, null, null, proxyUrl) noCodesSandwich.setDelegate(noCodesEventListener) noCodesSandwich.setScreenCustomizationDelegate() } diff --git a/example/android/build.gradle b/example/android/build.gradle index 9766946..f00d7ce 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -5,16 +5,16 @@ buildscript { compileSdkVersion = 35 targetSdkVersion = 35 ndkVersion = "27.1.12297006" - kotlinVersion = "2.0.21" + kotlinVersion = "2.1.20" } repositories { google() mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle") + classpath("com.android.tools.build:gradle:8.9.2") classpath("com.facebook.react:react-native-gradle-plugin") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") } } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index efc22b4..5b083c6 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -8,18 +8,16 @@ PODS: - hermes-engine (0.80.1): - hermes-engine/Pre-built (= 0.80.1) - hermes-engine/Pre-built (0.80.1) - - NoCodes (0.1.3): - - Qonversion (= 5.13.3) - - Qonversion (5.13.3): - - Qonversion/Main (= 5.13.3) - - qonversion-react-native-sdk (9.0.2): + - Qonversion (6.0.0): + - Qonversion/Main (= 6.0.0) + - qonversion-react-native-sdk (10.0.0): - boost - DoubleConversion - fast_float - fmt - glog - hermes-engine - - QonversionSandwich (= 6.0.10) + - QonversionSandwich (= 7.0.0) - RCT-Folly - RCT-Folly/Fabric - RCTRequired @@ -42,10 +40,9 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - Qonversion/Main (5.13.3) - - QonversionSandwich (6.0.10): - - NoCodes (= 0.1.3) - - Qonversion (= 5.13.3) + - Qonversion/Main (6.0.0) + - QonversionSandwich (7.0.0): + - Qonversion (= 6.0.0) - RCT-Folly (2024.11.18.00): - boost - DoubleConversion @@ -2275,7 +2272,6 @@ DEPENDENCIES: SPEC REPOS: trunk: - - NoCodes - Qonversion - QonversionSandwich - SocketRocket @@ -2441,11 +2437,10 @@ SPEC CHECKSUMS: fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 hermes-engine: 4f07404533b808de66cf48ac4200463068d0e95a - NoCodes: 21b87d320a16758c6eb79167ff98010d81b4894e - Qonversion: 2b32ae8681de3ba02db5b5ed69c8f213ac4a28fa - qonversion-react-native-sdk: 908023a6c5440ddc45b861a8b1547140c031d3a6 - QonversionSandwich: 6a8c8704a57bc97393ec1684c8932402aa0b7ba9 - RCT-Folly: 59ec0ac1f2f39672a0c6e6cecdd39383b764646f + Qonversion: 694b88c4bfc06d827c189908e73ea955a1ddde6c + qonversion-react-native-sdk: 262513c36e2c4ebd3718ff31af1c2cde4e52eb81 + QonversionSandwich: 1795bd19b40c129e76e976d2e5b88d7a7c9174ef + RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669 RCTDeprecation: efa5010912100e944a7ac9a93a157e1def1988fe RCTRequired: bbc4cf999ddc4a4b076e076c74dd1d39d0254630 RCTTypeSafety: d877728097547d0a37786cc9130c43ad71739ac3 @@ -2512,8 +2507,8 @@ SPEC CHECKSUMS: RNCClipboard: b228d492733d66e0126e18ce66c6d2f90bacc7e5 RNSnackbar: c1b235eb606b03938c693ce769ed3059c31dff9b SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 - Yoga: 703055a9f39562521cdb8657162dfd80f8c174c3 + Yoga: daa1e4de4b971b977b23bc842aaa3e135324f1f3 PODFILE CHECKSUM: 05782888d88e3a4a4bbc945c42df54704269e6ea -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/example/ios/QonversionExample.xcodeproj/project.pbxproj b/example/ios/QonversionExample.xcodeproj/project.pbxproj index 19eca25..dd571ea 100644 --- a/example/ios/QonversionExample.xcodeproj/project.pbxproj +++ b/example/ios/QonversionExample.xcodeproj/project.pbxproj @@ -195,14 +195,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-QonversionExample/Pods-QonversionExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-QonversionExample/Pods-QonversionExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-QonversionExample/Pods-QonversionExample-frameworks.sh\"\n"; @@ -238,14 +234,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-QonversionExample/Pods-QonversionExample-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-QonversionExample/Pods-QonversionExample-resources-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-QonversionExample/Pods-QonversionExample-resources.sh\"\n"; @@ -392,7 +384,10 @@ "-DFOLLY_CFG_NO_COROUTINES=1", "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; @@ -461,7 +456,10 @@ "-DFOLLY_CFG_NO_COROUTINES=1", "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/ios/RNNoCodes.mm b/ios/RNNoCodes.mm index 919002c..4a1f825 100644 --- a/ios/RNNoCodes.mm +++ b/ios/RNNoCodes.mm @@ -20,8 +20,9 @@ - (instancetype)init { - (void)initialize:(NSString *)projectKey source:(NSString *)source - version:(NSString *)version { - [self.impl initializeWithProjectKey:projectKey source:source version:version]; + version:(NSString *)version + proxyUrl:(NSString *)proxyUrl { + [self.impl initializeWithProjectKey:projectKey source:source version:version proxyUrl:proxyUrl]; } - (void)setScreenPresentationConfig:(NSDictionary *)configData diff --git a/ios/RNNoCodesImpl.swift b/ios/RNNoCodesImpl.swift index ff8a8af..ff0dbda 100644 --- a/ios/RNNoCodesImpl.swift +++ b/ios/RNNoCodesImpl.swift @@ -42,9 +42,9 @@ public class RNNoCodesImpl: NSObject { } @objc - public func initialize(projectKey: String, source: String, version: String) { + public func initialize(projectKey: String, source: String, version: String, proxyUrl: String?) { // Ignore source and version, because it's taken from the Qonversion SDK. - noCodesSandwich?.initialize(projectKey: projectKey) + noCodesSandwich?.initialize(projectKey: projectKey, proxyUrl: proxyUrl) } @MainActor @objc diff --git a/ios/RNQonversion.mm b/ios/RNQonversion.mm index f9c8cbb..bebd7f9 100644 --- a/ios/RNQonversion.mm +++ b/ios/RNQonversion.mm @@ -91,7 +91,7 @@ - (void)userInfo:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)r [self.impl userInfo:resolve reject:reject]; } -- (void)remoteConfig:(NSString *)contextKey resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject { +- (void)remoteConfig:(NSString * _Nullable)contextKey resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject { [self.impl remoteConfig:contextKey resolve:resolve reject:reject]; } diff --git a/ios/RNQonversionImpl.swift b/ios/RNQonversionImpl.swift index c2b6578..14cd8c1 100644 --- a/ios/RNQonversionImpl.swift +++ b/ios/RNQonversionImpl.swift @@ -157,7 +157,7 @@ public class RNQonversionImpl: NSObject { } @objc - public func remoteConfig(_ contextKey: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + public func remoteConfig(_ contextKey: String?, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { qonversionSandwich?.remoteConfig(contextKey) { result, error in self.handleResult(result: result, error: error, resolve: resolve, reject: reject) } diff --git a/package.json b/package.json index df912f3..55b2678 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@qonversion/react-native-sdk", "title": "React Native Qonversion", - "version": "10.0.0-RC2", + "version": "10.0.0", "description": "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 content using our StoreKit wrapper and Google Play Billing wrapper.", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/qonversion-react-native-sdk.podspec b/qonversion-react-native-sdk.podspec index 6cd1e49..3a56b2f 100644 --- a/qonversion-react-native-sdk.podspec +++ b/qonversion-react-native-sdk.podspec @@ -16,6 +16,6 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm,cpp,swift}" s.private_header_files = "ios/**/*.h" - s.dependency "QonversionSandwich", "6.0.10" + s.dependency "QonversionSandwich", "7.1.0" install_modules_dependencies(s) end diff --git a/src/NoCodesConfig.ts b/src/NoCodesConfig.ts index a40ddb7..5372189 100644 --- a/src/NoCodesConfig.ts +++ b/src/NoCodesConfig.ts @@ -3,13 +3,16 @@ import type { NoCodesListener } from './dto/NoCodesListener'; class NoCodesConfig { readonly projectKey: string; readonly noCodesListener: NoCodesListener | undefined; + readonly proxyUrl: string | undefined; constructor( projectKey: string, - noCodesListener: NoCodesListener | undefined = undefined + noCodesListener: NoCodesListener | undefined = undefined, + proxyUrl: string | undefined = undefined ) { this.projectKey = projectKey; this.noCodesListener = noCodesListener; + this.proxyUrl = proxyUrl; } } diff --git a/src/NoCodesConfigBuilder.ts b/src/NoCodesConfigBuilder.ts index 8d07fed..65bffc0 100644 --- a/src/NoCodesConfigBuilder.ts +++ b/src/NoCodesConfigBuilder.ts @@ -4,6 +4,7 @@ import NoCodesConfig from './NoCodesConfig'; class NoCodesConfigBuilder { private readonly projectKey: string; private noCodesListener: NoCodesListener | undefined = undefined; + private proxyUrl: string | undefined = undefined; constructor(projectKey: string) { this.projectKey = projectKey; @@ -24,6 +25,17 @@ class NoCodesConfigBuilder { return this; } + /** + * Set proxy URL for NoCodes SDK. + * + * @param proxyUrl proxy URL to use for API requests. + * @return builder instance for chain calls. + */ + setProxyURL(proxyUrl: string): NoCodesConfigBuilder { + this.proxyUrl = proxyUrl; + return this; + } + /** * Generate {@link NoCodesConfig} instance with all the provided configurations. * @@ -32,7 +44,8 @@ class NoCodesConfigBuilder { build(): NoCodesConfig { return new NoCodesConfig( this.projectKey, - this.noCodesListener + this.noCodesListener, + this.proxyUrl ); } } diff --git a/src/dto/Product.ts b/src/dto/Product.ts index b7f0d80..7cd4503 100644 --- a/src/dto/Product.ts +++ b/src/dto/Product.ts @@ -1,6 +1,5 @@ import {ProductType, PurchaseUpdatePolicy} from "./enums"; import SKProduct from "./storeProducts/SKProduct"; -import SkuDetails from "./storeProducts/SkuDetails"; import ProductStoreDetails from "./storeProducts/ProductStoreDetails"; import ProductOfferDetails from './storeProducts/ProductOfferDetails'; import PurchaseModel from './PurchaseModel'; @@ -16,14 +15,6 @@ class Product { */ basePlanId: string | null; - /** - * Google Play Store details of this product. - * Android only. Null for iOS, or if the product was not found. - * Doesn't take into account {@link basePlanId}. - * @deprecated Consider using {@link storeDetails} instead. - */ - skuDetails: SkuDetails | null; - /** * Google Play Store details of this product. * Android only. Null for iOS, or if the product was not found. @@ -39,8 +30,7 @@ class Product { offeringId?: string | null; /** - * For Android - the subscription base plan duration. If the {@link basePlanId} is not specified, - * the duration is calculated using the deprecated {@link skuDetails}. + * For Android - the subscription base plan duration from {@link storeDetails}. * For iOS - the duration of the {@link skProduct}. * Null, if it's not a subscription product or the product was not found in the store. */ @@ -56,8 +46,7 @@ class Product { /** * The calculated type of this product based on the store information. - * On Android uses deprecated {@link skuDetails} for the old subscription products - * where {@link basePlanId} is not specified, and {@link storeDetails} for all the other products. + * On Android uses {@link storeDetails} for all products. * On iOS uses {@link skProduct} information. */ type: ProductType; @@ -77,7 +66,6 @@ class Product { qonversionId: string, storeId: string, basePlanId: string | null, - skuDetails: SkuDetails | null, storeDetails: ProductStoreDetails | null, skProduct: SKProduct | null, offeringId: string | null, @@ -94,7 +82,6 @@ class Product { this.qonversionId = qonversionId; this.storeId = storeId; this.basePlanId = basePlanId; - this.skuDetails = skuDetails; this.storeDetails = storeDetails; this.skProduct = skProduct; this.offeringId = offeringId; diff --git a/src/dto/enums.ts b/src/dto/enums.ts index 9cd67f8..88cefe3 100644 --- a/src/dto/enums.ts +++ b/src/dto/enums.ts @@ -345,6 +345,7 @@ export enum QonversionErrorCode { LAUNCH_ERROR = "LaunchError", // There was an error while launching Qonversion SDK NETWORK_CONNECTION_FAILED = "NetworkConnectionFailed", // There was a network issue. Make sure that the Internet connection is available on the device OFFERINGS_NOT_FOUND = "OfferingsNotFound", // No offerings found + OFFERINGS_NOT_AVAILABLE = "OfferingsNotAvailable", PAYMENT_INVALID = "PaymentInvalid", // Purchase identifier was invalid, etc. PAYMENT_NOT_ALLOWED = "PaymentNotAllowed", // This device is not allowed to make the payment PLAY_STORE_ERROR = "PlayStoreError", // There was an issue with the Play Store service diff --git a/src/dto/storeProducts/SkuDetails.ts b/src/dto/storeProducts/SkuDetails.ts deleted file mode 100644 index 97329ce..0000000 --- a/src/dto/storeProducts/SkuDetails.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @deprecated - */ -class SkuDetails { - description: string; - freeTrialPeriod: string; - iconUrl: string; - introductoryPrice: string; - introductoryPriceAmountMicros: number; - introductoryPriceCycles: number; - introductoryPricePeriod: string; - originalJson: string; - originalPrice: string; - originalPriceAmountMicros: number; - price: string; - priceAmountMicros: number; - priceCurrencyCode: string; - sku: string; - subscriptionPeriod: string; - title: string; - type: string; - hashCode: number; - toString: string; - - constructor( - description: string, - freeTrialPeriod: string, - iconUrl: string, - introductoryPrice: string, - introductoryPriceAmountMicros: number, - introductoryPriceCycles: number, - introductoryPricePeriod: string, - originalJson: string, - originalPrice: string, - originalPriceAmountMicros: number, - price: string, - priceAmountMicros: number, - priceCurrencyCode: string, - sku: string, - subscriptionPeriod: string, - title: string, - type: string, - hashCode: number, - toString: string - ) { - this.description = description; - this.freeTrialPeriod = freeTrialPeriod; - this.iconUrl = iconUrl; - this.introductoryPrice = introductoryPrice; - this.introductoryPriceAmountMicros = introductoryPriceAmountMicros; - this.introductoryPriceCycles = introductoryPriceCycles; - this.introductoryPricePeriod = introductoryPricePeriod; - this.originalJson = originalJson; - this.originalPrice = originalPrice; - this.originalPriceAmountMicros = originalPriceAmountMicros; - this.price = price; - this.priceAmountMicros = priceAmountMicros; - this.priceCurrencyCode = priceCurrencyCode; - this.sku = sku; - this.subscriptionPeriod = subscriptionPeriod; - this.title = title; - this.type = type; - this.hashCode = hashCode; - this.toString = toString; - } -} - -export default SkuDetails; diff --git a/src/index.ts b/src/index.ts index ec17cec..4ff944f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,7 +29,6 @@ export { default as ProductStoreDetails } from './dto/storeProducts/ProductStore export { default as SKProduct } from './dto/storeProducts/SKProduct'; export { default as SKProductDiscount } from './dto/storeProducts/SKProductDiscount'; export { default as SKSubscriptionPeriod } from './dto/storeProducts/SKSubscriptionPeriod'; -export { default as SkuDetails } from './dto/storeProducts/SkuDetails'; export { default as PurchaseOptionsBuilder } from './dto/PurchaseOptionsBuilder'; export { default as PurchaseOptions } from './dto/PurchaseOptionsBuilder'; diff --git a/src/internal/Mapper.ts b/src/internal/Mapper.ts index 43a57b6..a057f3a 100644 --- a/src/internal/Mapper.ts +++ b/src/internal/Mapper.ts @@ -30,7 +30,6 @@ import Product from "../dto/Product"; import SKProduct from "../dto/storeProducts/SKProduct"; import SKProductDiscount from "../dto/storeProducts/SKProductDiscount"; import SKSubscriptionPeriod from "../dto/storeProducts/SKSubscriptionPeriod"; -import SkuDetails from "../dto/storeProducts/SkuDetails"; import User from '../dto/User'; import ScreenPresentationConfig from '../dto/ScreenPresentationConfig'; import Experiment from "../dto/Experiment"; @@ -61,7 +60,6 @@ export type QProduct = { type: string; subscriptionPeriod?: QSubscriptionPeriod | null; trialPeriod?: QSubscriptionPeriod | null; - skuDetails?: QSkuDetails | null; // android storeDetails?: QProductStoreDetails // android skProduct?: QSKProduct | null // iOS prettyPrice?: string | null; @@ -142,28 +140,6 @@ type QProductInAppDetails = { price: QProductPrice, } -type QSkuDetails = { - description: string; - freeTrialPeriod: string; - iconUrl: string; - introductoryPrice: string; - introductoryPriceAmountMicros: number; - introductoryPriceCycles: number; - introductoryPricePeriod: string; - originalJson: string; - originalPrice: string; - originalPriceAmountMicros: number; - price: string; - priceAmountMicros: number; - priceCurrencyCode: string; - sku: string; - subscriptionPeriod: string; - title: string; - type: string; - hashCode: number; - toString: string; -}; - type QSKProduct = { subscriptionPeriod: null | QSKSubscriptionPeriod; introductoryPrice: QProductDiscount | null; @@ -559,7 +535,6 @@ class Mapper { const offeringId: string | null = product.offeringId ?? null; let skProduct: SKProduct | null = null; - let skuDetails: SkuDetails | null = null; let storeDetails: ProductStoreDetails | null = null; let price: number | undefined; let currencyCode: string | undefined; @@ -579,17 +554,6 @@ class Mapper { } } else { let priceMicros = null - if (!!product.skuDetails) { - skuDetails = Mapper.convertSkuDetails(product.skuDetails as QSkuDetails); - storeTitle = skuDetails.title; - storeDescription = skuDetails.description; - - priceMicros = skuDetails.priceAmountMicros; - currencyCode = skuDetails.priceCurrencyCode; - if (skuDetails.introductoryPrice.length > 0) { - prettyIntroductoryPrice = skuDetails.introductoryPrice; - } - } if (!!product.storeDetails) { storeDetails = Mapper.convertProductStoreDetails(product.storeDetails); @@ -616,7 +580,6 @@ class Mapper { product.id, product.storeId, product.basePlanId ?? null, - skuDetails, storeDetails, skProduct, offeringId, @@ -675,30 +638,6 @@ class Mapper { return new Offering(offering.id, tag, products); } - static convertSkuDetails(skuDetails: QSkuDetails): SkuDetails { - return new SkuDetails( - skuDetails.description, - skuDetails.freeTrialPeriod, - skuDetails.iconUrl, - skuDetails.introductoryPrice, - skuDetails.introductoryPriceAmountMicros, - skuDetails.introductoryPriceCycles, - skuDetails.introductoryPricePeriod, - skuDetails.originalJson, - skuDetails.originalPrice, - skuDetails.originalPriceAmountMicros, - skuDetails.price, - skuDetails.priceAmountMicros, - skuDetails.priceCurrencyCode, - skuDetails.sku, - skuDetails.subscriptionPeriod, - skuDetails.title, - skuDetails.type, - skuDetails.hashCode, - skuDetails.toString - ); - } - static convertProductType(productType: string): ProductType { let type = ProductType.UNKNOWN switch (productType) { @@ -1194,6 +1133,7 @@ class Mapper { case QonversionErrorCode.LAUNCH_ERROR: return QonversionErrorCode.LAUNCH_ERROR; case QonversionErrorCode.NETWORK_CONNECTION_FAILED: return QonversionErrorCode.NETWORK_CONNECTION_FAILED; case QonversionErrorCode.OFFERINGS_NOT_FOUND: return QonversionErrorCode.OFFERINGS_NOT_FOUND; + case QonversionErrorCode.OFFERINGS_NOT_AVAILABLE: return QonversionErrorCode.OFFERINGS_NOT_AVAILABLE; case QonversionErrorCode.PAYMENT_INVALID: return QonversionErrorCode.PAYMENT_INVALID; case QonversionErrorCode.PAYMENT_NOT_ALLOWED: return QonversionErrorCode.PAYMENT_NOT_ALLOWED; case QonversionErrorCode.PLAY_STORE_ERROR: return QonversionErrorCode.PLAY_STORE_ERROR; diff --git a/src/internal/NoCodesInternal.ts b/src/internal/NoCodesInternal.ts index 6e4a56d..9ee0863 100644 --- a/src/internal/NoCodesInternal.ts +++ b/src/internal/NoCodesInternal.ts @@ -19,7 +19,7 @@ export default class NoCodesInternal implements NoCodesApi { private noCodesListener: NoCodesListener | null = null; constructor(config: NoCodesConfig) { - RNNoCodes.initialize(config.projectKey, sdkSource, sdkVersion); + RNNoCodes.initialize(config.projectKey, sdkSource, sdkVersion, config.proxyUrl); if (config.noCodesListener) { this.setNoCodesListener(config.noCodesListener); diff --git a/src/internal/specs/NativeNoCodesModule.ts b/src/internal/specs/NativeNoCodesModule.ts index e883704..00c2395 100644 --- a/src/internal/specs/NativeNoCodesModule.ts +++ b/src/internal/specs/NativeNoCodesModule.ts @@ -9,7 +9,7 @@ export type NoCodeEvent = { }; export interface Spec extends TurboModule { - initialize(projectKey: string, source: string, version: string): void; + initialize(projectKey: string, source: string, version: string, proxyUrl?: string): void; setScreenPresentationConfig(configData: Object, contextKey?: string): Promise; showScreen(contextKey: string): Promise; close(): Promise;