From a27b395d8251cc0d085959123c25b2f9d80c80cf Mon Sep 17 00:00:00 2001 From: vlad Date: Fri, 15 Mar 2024 16:54:10 +0400 Subject: [PATCH 1/3] removed 'storeKit2Usage' parameter --- lib/ios/RNAConstants.swift | 1 - lib/ios/RNAdapty.swift | 14 +------------- lib/src/adapty-handler.ts | 3 --- lib/src/types/inputs.ts | 26 -------------------------- react-native-adapty-sdk.podspec | 2 +- 5 files changed, 2 insertions(+), 44 deletions(-) diff --git a/lib/ios/RNAConstants.swift b/lib/ios/RNAConstants.swift index d14a0ab..b5efdf6 100644 --- a/lib/ios/RNAConstants.swift +++ b/lib/ios/RNAConstants.swift @@ -23,7 +23,6 @@ public enum ParamKey: String { case placementId = "placement_id" case loadTimeout = "load_timeout" case idfaDisabled = "idfa_collection_disabled" - case storekit2Usage = "storekit2_usage" case bridgeVersion = "PLIST Bridge version" case prefetch_products = "prefetch_products" case custom_tags = "custom_tags" diff --git a/lib/ios/RNAdapty.swift b/lib/ios/RNAdapty.swift index d5b6f88..a311099 100644 --- a/lib/ios/RNAdapty.swift +++ b/lib/ios/RNAdapty.swift @@ -215,17 +215,6 @@ class RNAdapty: RCTEventEmitter, AdaptyDelegate { let logLevel: String? = ctx.params.getOptionalValue(for: .logLevel) let observerMode: Bool? = ctx.params.getOptionalValue(for: .observerMode) let idfaCollectionDisabled: Bool? = ctx.params.getOptionalValue(for: .idfaDisabled) - let storeKit2UsageString: String? = ctx.params.getOptionalValue(for: .storekit2Usage) - - let storeKit2Usage: StoreKit2Usage - switch storeKit2UsageString { - case "enabled_for_introductory_offer_eligibility": - storeKit2Usage = .forIntroEligibilityCheck - case "disabled": - storeKit2Usage = .disabled - default: - storeKit2Usage = .default - } // Memoize activation args MEMO_ACTIVATION_ARGS[ParamKey.sdkKey.rawValue] = apiKey @@ -243,8 +232,7 @@ class RNAdapty: RCTEventEmitter, AdaptyDelegate { Adapty.activate( apiKey, observerMode: observerMode ?? false, - customerUserId: customerUserId, - storeKit2Usage: storeKit2Usage + customerUserId: customerUserId ) { maybeErr in ctx.okOrForwardError(maybeErr) } diff --git a/lib/src/adapty-handler.ts b/lib/src/adapty-handler.ts index edff948..281c67a 100644 --- a/lib/src/adapty-handler.ts +++ b/lib/src/adapty-handler.ts @@ -134,9 +134,6 @@ export class Adapty { } if (Platform.OS === 'ios') { - if (params.ios?.storeKit2Usage) { - body.set('storekit2_usage', params.ios.storeKit2Usage); - } if (params.ios?.idfaCollectionDisabled) { body.set('idfa_collection_disabled', params.ios.idfaCollectionDisabled); } diff --git a/lib/src/types/inputs.ts b/lib/src/types/inputs.ts index fa1c107..ea06638 100644 --- a/lib/src/types/inputs.ts +++ b/lib/src/types/inputs.ts @@ -145,13 +145,6 @@ export interface ActivateParamsInput { */ __debugDeferActivation?: boolean; ios?: { - /** - * Controls what APIs from StoreKit 2 would be used - * - * Read more: {@link https://docs.adapty.io/docs/displaying-products#adapty-sdk-version-250-and-higher} - * @default 'disabled' - */ - storeKit2Usage?: IosStorekit2Usage; /** * Disables IDFA collection * @default false @@ -186,22 +179,3 @@ export interface AdaptyAndroidSubscriptionUpdateParameters { export interface MakePurchaseParamsInput { android?: AdaptyAndroidSubscriptionUpdateParameters; } -export const IosStorekit2Usage = Object.freeze({ - /** - * Adapty will use the legacy logic, based on receipt analysis and validation. - * However, in rare situations (and in Sandbox mode - always) - * the reecipt is not present on the device at the first startup, - * therefore this option will return an error. - */ - Disabled: 'disabled', - /** - * Adapty will utilise StoreKit 2 logic to determine introductory offer eligibility. - * @requires iOS 15.0+ - * @remarks - * StoreKit 2 is available since iOS 15.0. Adapty will implement the legacy logic for older versions. - */ - EnabledForIntroductoryOfferEligibility: - 'enabled_for_introductory_offer_eligibility', -}); -export type IosStorekit2Usage = - (typeof IosStorekit2Usage)[keyof typeof IosStorekit2Usage]; diff --git a/react-native-adapty-sdk.podspec b/react-native-adapty-sdk.podspec index 4f13611..c763fd1 100644 --- a/react-native-adapty-sdk.podspec +++ b/react-native-adapty-sdk.podspec @@ -19,7 +19,7 @@ Pod::Spec.new do |s| s.resources = "lib/ios/**/*.{plist}" s.requires_arc = true - s.dependency "Adapty", "2.9.6" + s.dependency "Adapty", "2.10.1" s.dependency "React" end From 1bf934e5efef84348806842b4708c6594e70e6a1 Mon Sep 17 00:00:00 2001 From: vlad Date: Fri, 15 Mar 2024 19:33:02 +0400 Subject: [PATCH 2/3] changed ios min version --- react-native-adapty-sdk.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native-adapty-sdk.podspec b/react-native-adapty-sdk.podspec index c763fd1..238a5b5 100644 --- a/react-native-adapty-sdk.podspec +++ b/react-native-adapty-sdk.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/adaptyteam/AdaptySDK-React-Native" s.license = { :type => "MIT", :file => "LICENSE" } s.authors = { "Ivan Dorofeyev" => "divandoesapps@gmail.com" } - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.2" } s.source = { :git => "https://github.com/adaptyteam/AdaptySDK-React-Native.git", :tag => "#{s.version}" } s.source_files = "lib/ios/**/*.{h,c,m,swift}" From 4b5acc40bbff0554139612e7d6c80271944a8d5d Mon Sep 17 00:00:00 2001 From: vlad Date: Fri, 15 Mar 2024 19:33:02 +0400 Subject: [PATCH 3/3] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d8b9882..4a5ce2f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package", "name": "react-native-adapty", - "version": "2.9.8", + "version": "2.10.0", "description": "Adapty React Native SDK", "license": "MIT", "author": "Vanya Dorofeyev (https://github.com/divanc)",