Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Release v1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarbo committed May 24, 2022
1 parent 568a51a commit aa8fc89
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Glassfy.podspec
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions Glassfy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
9 changes: 8 additions & 1 deletion Source/GYSku.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString*, NSString*>* extravars;
@end

@implementation GYSku (Private)
Expand Down Expand Up @@ -49,11 +50,17 @@ - (instancetype)initWithObject:(nonnull NSDictionary *)obj error:(NSError **)err
promotionalEligibility = GYSkuEligibilityNonEligible;
}
}


NSDictionary<NSString*, NSString*>* extravars = @{};
if ([obj[@"extravars"] isKindOfClass:NSDictionary.class]) {
extravars = obj[@"extravars"];
}


self.promotionalId = promotionalId;
self.introductoryEligibility = introductoryEligibility;
self.promotionalEligibility = promotionalEligibility;
self.extravars = extravars;
}
return self;
}
Expand Down
2 changes: 0 additions & 2 deletions Source/GYSkuBase+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString*, NSString*>* extravars;
@end

NS_ASSUME_NONNULL_END
7 changes: 0 additions & 7 deletions Source/GYSkuBase.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString*, NSString*>* extravars;
@end

@implementation GYSkuBase (Private)
Expand All @@ -36,12 +35,6 @@ - (instancetype)initWithObject:(NSDictionary *)obj error:(NSError ** _Nullable)e
if ([store isKindOfClass:NSString.class]) {
self.store = store.integerValue;
}

NSDictionary<NSString*, NSString*>* extravars = @{};
if ([obj[@"extravars"] isKindOfClass:NSDictionary.class]) {
extravars = obj[@"extravars"];
}
self.extravars = extravars;
}

if (!self.skuId || !self.productId || self.store == 0) {
Expand Down
25 changes: 11 additions & 14 deletions Source/GYSkuPaddle.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString*, NSString*>* extravars;
@end

@implementation GYSkuPaddle (Private)
Expand All @@ -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"];
Expand All @@ -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"];
Expand All @@ -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<NSString*, NSString*>* 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;
}
Expand Down
1 change: 0 additions & 1 deletion Source/GYUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 0 additions & 28 deletions Source/GYUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Source/Glassfy.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ + (Glassfy *)shared

+ (NSString *)sdkVersion
{
return @"1.3.0";
return @"1.3.1";
}

+ (void)initializeWithAPIKey:(NSString *)apiKey
Expand Down
2 changes: 0 additions & 2 deletions Source/Public/GYSkuPaddle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString*, NSString*>* extravars;
Expand Down

0 comments on commit aa8fc89

Please sign in to comment.