From aa8fc89e53f1db6787fc07eaad29c90bb59bc7ba Mon Sep 17 00:00:00 2001 From: lgarbo <387293+lgarbo@users.noreply.github.com> Date: Tue, 24 May 2022 09:44:36 +0200 Subject: [PATCH] Release v1.3.1 --- Glassfy.podspec | 2 +- Glassfy.xcodeproj/project.pbxproj | 4 ++-- README.md | 2 +- Source/GYSku.m | 9 ++++++++- Source/GYSkuBase+Private.h | 2 -- Source/GYSkuBase.m | 7 ------- Source/GYSkuPaddle.m | 25 +++++++++++-------------- Source/GYUtils.h | 1 - Source/GYUtils.m | 28 ---------------------------- Source/Glassfy.m | 2 +- Source/Public/GYSkuPaddle.h | 2 -- 11 files changed, 24 insertions(+), 60 deletions(-) diff --git a/Glassfy.podspec b/Glassfy.podspec index bccb966..8a40952 100644 --- a/Glassfy.podspec +++ b/Glassfy.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Glassfy" - s.version = "1.3.0" + s.version = "1.3.1" s.summary = "Subscription and in-app-purchase service." s.license = { :type => 'MIT', :file => 'LICENSE' } s.source = { :git => "https://github.com/glassfy/ios-sdk.git", :tag => s.version.to_s } diff --git a/Glassfy.xcodeproj/project.pbxproj b/Glassfy.xcodeproj/project.pbxproj index d14b4f9..66550df 100644 --- a/Glassfy.xcodeproj/project.pbxproj +++ b/Glassfy.xcodeproj/project.pbxproj @@ -765,7 +765,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = net.glassfy.sdk; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -793,7 +793,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = net.glassfy.sdk; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/README.md b/README.md index e480187..fb4e0c8 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Our SDK can be easly integrated through Cocoapods or Swift Package Manager #### Integrate using Cocoapods Add the pod to your Podfile: -```pod 'Glassfy', '~> 1.3.0'``` +```pod 'Glassfy', '~> 1.3.1'``` Then, run the following command: diff --git a/Source/GYSku.m b/Source/GYSku.m index 83aa251..6ebb659 100644 --- a/Source/GYSku.m +++ b/Source/GYSku.m @@ -16,6 +16,7 @@ @interface GYSku() @property(nonatomic, assign) GYSkuEligibility introductoryEligibility; @property(nonatomic, assign) GYSkuEligibility promotionalEligibility; @property(nonatomic, nullable, strong) SKProduct *product; +@property(nonatomic, strong) NSDictionary* extravars; @end @implementation GYSku (Private) @@ -49,11 +50,17 @@ - (instancetype)initWithObject:(nonnull NSDictionary *)obj error:(NSError **)err promotionalEligibility = GYSkuEligibilityNonEligible; } } - + + NSDictionary* extravars = @{}; + if ([obj[@"extravars"] isKindOfClass:NSDictionary.class]) { + extravars = obj[@"extravars"]; + } + self.promotionalId = promotionalId; self.introductoryEligibility = introductoryEligibility; self.promotionalEligibility = promotionalEligibility; + self.extravars = extravars; } return self; } diff --git a/Source/GYSkuBase+Private.h b/Source/GYSkuBase+Private.h index 671bdb8..b865b99 100644 --- a/Source/GYSkuBase+Private.h +++ b/Source/GYSkuBase+Private.h @@ -14,8 +14,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, strong) NSString *skuId; @property(nonatomic, strong) NSString *productId; @property(nonatomic, assign) GYStore store; - -@property(nonatomic, strong) NSDictionary* extravars; @end NS_ASSUME_NONNULL_END diff --git a/Source/GYSkuBase.m b/Source/GYSkuBase.m index e8790e8..9b80f32 100644 --- a/Source/GYSkuBase.m +++ b/Source/GYSkuBase.m @@ -13,7 +13,6 @@ @interface GYSkuBase() @property(nonatomic, strong) NSString *skuId; @property(nonatomic, strong) NSString *productId; @property(nonatomic, assign) GYStore store; -@property(nonatomic, strong) NSDictionary* extravars; @end @implementation GYSkuBase (Private) @@ -36,12 +35,6 @@ - (instancetype)initWithObject:(NSDictionary *)obj error:(NSError ** _Nullable)e if ([store isKindOfClass:NSString.class]) { self.store = store.integerValue; } - - NSDictionary* extravars = @{}; - if ([obj[@"extravars"] isKindOfClass:NSDictionary.class]) { - extravars = obj[@"extravars"]; - } - self.extravars = extravars; } if (!self.skuId || !self.productId || self.store == 0) { diff --git a/Source/GYSkuPaddle.m b/Source/GYSkuPaddle.m index 9e3a22c..747c452 100644 --- a/Source/GYSkuPaddle.m +++ b/Source/GYSkuPaddle.m @@ -13,14 +13,11 @@ @interface GYSkuPaddle() @property(nonatomic, strong) NSString *name; - -@property(nonatomic, strong) NSDecimalNumber *initialPrice; -@property(nonatomic, strong) NSLocale *initialPriceLocale; -@property(nonatomic, strong) NSString *initialPriceCode; // three-letter ISO currency code - -@property(nonatomic, strong) NSDecimalNumber *recurringPrice; -@property(nonatomic, strong) NSLocale *recurringPriceLocale; -@property(nonatomic, strong) NSString *recurringPriceCode; // three-letter ISO currency code +@property(nonatomic, nullable, strong) NSDecimalNumber *initialPrice; +@property(nonatomic, nullable, strong) NSString *initialPriceCode; // three-letter ISO currency code +@property(nonatomic, nullable, strong) NSDecimalNumber *recurringPrice; +@property(nonatomic, nullable, strong) NSString *recurringPriceCode; // three-letter ISO currency code +@property(nonatomic, strong) NSDictionary* extravars; @end @implementation GYSkuPaddle (Private) @@ -33,7 +30,6 @@ - (instancetype)initWithObject:(nonnull NSDictionary *)obj error:(NSError **)err name = obj[@"name"]; } - NSLocale *initialPriceLocale; NSString *initialPriceCode; NSDecimalNumber *initialPrice; NSDictionary *initialPriceJSON = obj[@"initialprice"]; @@ -45,11 +41,9 @@ - (instancetype)initWithObject:(nonnull NSDictionary *)obj error:(NSError **)err if ([initialPriceJSON[@"locale"] isKindOfClass:NSString.class]) { initialPriceCode = initialPriceJSON[@"locale"]; - initialPriceLocale = [GYUtils localeFromCurrencyCode:initialPriceCode]; } } - NSLocale *recurringPriceLocale; NSString *recurringPriceCode; NSDecimalNumber *recurringPrice; NSDictionary *recurringPriceJSON = obj[@"recurringprice"]; @@ -61,23 +55,26 @@ - (instancetype)initWithObject:(nonnull NSDictionary *)obj error:(NSError **)err if ([recurringPriceJSON[@"locale"] isKindOfClass:NSString.class]) { recurringPriceCode = recurringPriceJSON[@"locale"]; - recurringPriceLocale = [GYUtils localeFromCurrencyCode:recurringPriceCode]; } } + NSDictionary* extravars = @{}; + if ([obj[@"extravars"] isKindOfClass:NSDictionary.class]) { + extravars = obj[@"extravars"]; + } + if (initialPriceCode && initialPriceCode.length) { self.initialPrice = initialPrice; self.initialPriceCode = initialPriceCode; - self.initialPriceLocale = initialPriceLocale; } if (recurringPriceCode && recurringPriceCode.length) { self.recurringPrice = recurringPrice; self.recurringPriceCode = recurringPriceCode; - self.recurringPriceLocale = recurringPriceLocale; } self.name = name; + self.extravars = extravars; } return self; } diff --git a/Source/GYUtils.h b/Source/GYUtils.h index 1818829..d0a4787 100644 --- a/Source/GYUtils.h +++ b/Source/GYUtils.h @@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN @interface GYUtils : NSObject + (NSString *)requestSignature:(NSURLRequest *)req; -+ (NSLocale *_Nullable)localeFromCurrencyCode:(NSString *)code; @end NS_ASSUME_NONNULL_END diff --git a/Source/GYUtils.m b/Source/GYUtils.m index d5bce20..b29d3fc 100644 --- a/Source/GYUtils.m +++ b/Source/GYUtils.m @@ -42,32 +42,4 @@ + (NSString *)requestSignature:(NSURLRequest *)req return @""; } -+ (NSLocale *)localeFromCurrencyCode:(NSString *)code -{ - if (!code || code.length == 0) { - return nil; - } - - NSString *localeIdentifier; - NSString *preferredLang = [[[NSBundle mainBundle] preferredLocalizations] firstObject]; - if (preferredLang) { - NSDictionary *components = @{ - NSLocaleCurrencyCode: code, - NSLocaleLanguageCode: preferredLang - }; - localeIdentifier = [NSLocale localeIdentifierFromComponents:components]; - } - - if (!localeIdentifier) { - NSDictionary *components = @{NSLocaleCurrencyCode: code}; - localeIdentifier = [NSLocale localeIdentifierFromComponents:components]; - } - - NSLocale *locale; - if (localeIdentifier && localeIdentifier.length) { - locale = [NSLocale localeWithLocaleIdentifier:localeIdentifier]; - } - return locale; -} - @end diff --git a/Source/Glassfy.m b/Source/Glassfy.m index 9838856..aece039 100644 --- a/Source/Glassfy.m +++ b/Source/Glassfy.m @@ -40,7 +40,7 @@ + (Glassfy *)shared + (NSString *)sdkVersion { - return @"1.3.0"; + return @"1.3.1"; } + (void)initializeWithAPIKey:(NSString *)apiKey diff --git a/Source/Public/GYSkuPaddle.h b/Source/Public/GYSkuPaddle.h index 50cda7d..81431a9 100644 --- a/Source/Public/GYSkuPaddle.h +++ b/Source/Public/GYSkuPaddle.h @@ -19,11 +19,9 @@ NS_SWIFT_NAME(Glassfy.SkuPaddle) @property(nonatomic, readonly) NSString *name; @property(nonatomic, nullable, readonly) NSDecimalNumber *initialPrice; -@property(nonatomic, nullable, readonly) NSLocale *initialPriceLocale; @property(nonatomic, nullable, readonly) NSString *initialPriceCode; // three-letter ISO currency code @property(nonatomic, nullable, readonly) NSDecimalNumber *recurringPrice; -@property(nonatomic, nullable, readonly) NSLocale *recurringPriceLocale; @property(nonatomic, nullable, readonly) NSString *recurringPriceCode; // three-letter ISO currency code @property(nonatomic, readonly) NSDictionary* extravars;