Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.0"
}

if (isNewArchitectureEnabled()) {
Expand Down
31 changes: 13 additions & 18 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -2275,7 +2272,6 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- NoCodes
- Qonversion
- QonversionSandwich
- SocketRocket
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
18 changes: 8 additions & 10 deletions example/ios/QonversionExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions ios/RNNoCodes.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ios/RNNoCodesImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ios/RNQonversion.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
2 changes: 1 addition & 1 deletion ios/RNQonversionImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion qonversion-react-native-sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.0"
install_modules_dependencies(s)
end
5 changes: 4 additions & 1 deletion src/NoCodesConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
16 changes: 15 additions & 1 deletion src/NoCodesConfigBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,6 +25,18 @@ class NoCodesConfigBuilder {
return this;
}

/**
* Set proxy URL for NoCodes SDK.
* iOS only.
*
* @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.
*
Expand All @@ -32,7 +45,8 @@ class NoCodesConfigBuilder {
build(): NoCodesConfig {
return new NoCodesConfig(
this.projectKey,
this.noCodesListener
this.noCodesListener,
this.proxyUrl
);
}
}
Expand Down
17 changes: 2 additions & 15 deletions src/dto/Product.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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.
Expand All @@ -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.
*/
Expand All @@ -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;
Expand All @@ -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,
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/dto/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
68 changes: 0 additions & 68 deletions src/dto/storeProducts/SkuDetails.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Loading