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

Commit

Permalink
Release v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarbo committed Mar 16, 2022
1 parent d096957 commit 0984d74
Show file tree
Hide file tree
Showing 25 changed files with 1,011 additions and 32 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.1.8"
s.version = "1.2.0"
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
36 changes: 33 additions & 3 deletions Glassfy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
817A1D00258CF7EE00D1BA10 /* GYStoreRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 817A1CFE258CF7EE00D1BA10 /* GYStoreRequest.m */; };
817C95692678F79200DB4945 /* GYAPISkuResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 817C95682678F78400DB4945 /* GYAPISkuResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
817C956B2678F7D300DB4945 /* GYAPISkuResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 817C956A2678F7D300DB4945 /* GYAPISkuResponse.m */; };
818880B52717153A00128A10 /* GYAPIPaywallResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 818880B32717153A00128A10 /* GYAPIPaywallResponse.h */; };
818880B62717153A00128A10 /* GYAPIPaywallResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 818880B42717153A00128A10 /* GYAPIPaywallResponse.m */; };
818880BA27171D7A00128A10 /* GYPaywallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 818880B827171D7A00128A10 /* GYPaywallViewController.m */; };
818880BC27171DA900128A10 /* GYPaywallViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 818880BB27171DA900128A10 /* GYPaywallViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
818880BE27171E1F00128A10 /* GYPaywallViewController+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 818880BD27171E1F00128A10 /* GYPaywallViewController+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
8191E86B26690C850077BDD7 /* GYUserProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 8191E86A26690C850077BDD7 /* GYUserProperties.h */; settings = {ATTRIBUTES = (Public, ); }; };
81951CD126443F65003901F1 /* Glassfy.h in Headers */ = {isa = PBXBuildFile; fileRef = 81951CD026443F65003901F1 /* Glassfy.h */; settings = {ATTRIBUTES = (Public, ); }; };
81951CD326443F82003901F1 /* GYTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 81951CD226443F82003901F1 /* GYTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand All @@ -67,6 +72,8 @@
81951CDE26443FB8003901F1 /* GYPermissions.h in Headers */ = {isa = PBXBuildFile; fileRef = 81951CDC26443FB8003901F1 /* GYPermissions.h */; settings = {ATTRIBUTES = (Public, ); }; };
81951CDF26443FB8003901F1 /* GYPermission.h in Headers */ = {isa = PBXBuildFile; fileRef = 81951CDD26443FB8003901F1 /* GYPermission.h */; settings = {ATTRIBUTES = (Public, ); }; };
81951CE12644400B003901F1 /* GYError.h in Headers */ = {isa = PBXBuildFile; fileRef = 81951CE02644400B003901F1 /* GYError.h */; settings = {ATTRIBUTES = (Public, ); }; };
81B49B552729A31C000BDDA1 /* GYFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 81B49B532729A31C000BDDA1 /* GYFormatter.h */; settings = {ATTRIBUTES = (Private, ); }; };
81B49B562729A31C000BDDA1 /* GYFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 81B49B542729A31C000BDDA1 /* GYFormatter.m */; };
81C2816325E3F58C0048189D /* GYPermissions.m in Sources */ = {isa = PBXBuildFile; fileRef = 81C2816125E3F58C0048189D /* GYPermissions.m */; };
81C684652602633500223D3E /* GYAPISignatureResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 81C684632602633500223D3E /* GYAPISignatureResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
81C684662602633500223D3E /* GYAPISignatureResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 81C684642602633500223D3E /* GYAPISignatureResponse.m */; };
Expand Down Expand Up @@ -141,6 +148,11 @@
817A1CFE258CF7EE00D1BA10 /* GYStoreRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GYStoreRequest.m; sourceTree = "<group>"; };
817C95682678F78400DB4945 /* GYAPISkuResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GYAPISkuResponse.h; sourceTree = "<group>"; };
817C956A2678F7D300DB4945 /* GYAPISkuResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GYAPISkuResponse.m; sourceTree = "<group>"; };
818880B32717153A00128A10 /* GYAPIPaywallResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GYAPIPaywallResponse.h; sourceTree = "<group>"; };
818880B42717153A00128A10 /* GYAPIPaywallResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GYAPIPaywallResponse.m; sourceTree = "<group>"; };
818880B827171D7A00128A10 /* GYPaywallViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GYPaywallViewController.m; sourceTree = "<group>"; };
818880BB27171DA900128A10 /* GYPaywallViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GYPaywallViewController.h; path = Public/GYPaywallViewController.h; sourceTree = "<group>"; };
818880BD27171E1F00128A10 /* GYPaywallViewController+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GYPaywallViewController+Private.h"; sourceTree = "<group>"; };
8191E86A26690C850077BDD7 /* GYUserProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GYUserProperties.h; path = Public/GYUserProperties.h; sourceTree = "<group>"; };
81951CD026443F65003901F1 /* Glassfy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Glassfy.h; path = Public/Glassfy.h; sourceTree = "<group>"; };
81951CD226443F82003901F1 /* GYTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GYTypes.h; path = Public/GYTypes.h; sourceTree = "<group>"; };
Expand All @@ -152,6 +164,8 @@
81951CDD26443FB8003901F1 /* GYPermission.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GYPermission.h; path = Public/GYPermission.h; sourceTree = "<group>"; };
81951CE02644400B003901F1 /* GYError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GYError.h; path = Public/GYError.h; sourceTree = "<group>"; };
81A7064425ACADB200169564 /* GYSku+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GYSku+Private.h"; sourceTree = "<group>"; };
81B49B532729A31C000BDDA1 /* GYFormatter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GYFormatter.h; sourceTree = "<group>"; };
81B49B542729A31C000BDDA1 /* GYFormatter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GYFormatter.m; sourceTree = "<group>"; };
81C2816125E3F58C0048189D /* GYPermissions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GYPermissions.m; sourceTree = "<group>"; };
81C2816825E3F6AC0048189D /* GYPermissions+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GYPermissions+Private.h"; sourceTree = "<group>"; };
81C684632602633500223D3E /* GYAPISignatureResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GYAPISignatureResponse.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -200,6 +214,8 @@
81EFB54325A772D900706FCB /* GYAPIPermissionsResponse.m */,
81C684632602633500223D3E /* GYAPISignatureResponse.h */,
81C684642602633500223D3E /* GYAPISignatureResponse.m */,
818880B32717153A00128A10 /* GYAPIPaywallResponse.h */,
818880B42717153A00128A10 /* GYAPIPaywallResponse.m */,
816EF28B26611C5900513FB1 /* GYAPIPropertiesResponse.h */,
816EF28C26611C5900513FB1 /* GYAPIPropertiesResponse.m */,
817C95682678F78400DB4945 /* GYAPISkuResponse.h */,
Expand Down Expand Up @@ -266,6 +282,8 @@
81EFB54925A772F200706FCB /* GYPermission.m */,
8191E86A26690C850077BDD7 /* GYUserProperties.h */,
816EF2882661161200513FB1 /* GYUserProperties.m */,
818880BB27171DA900128A10 /* GYPaywallViewController.h */,
818880B827171D7A00128A10 /* GYPaywallViewController.m */,
81951CD226443F82003901F1 /* GYTypes.h */,
81FCCE8527C3CE0A00DF3D1A /* GYPurchaseDelegate.h */,
816830B3258B6EA100565968 /* Core */,
Expand All @@ -287,6 +305,7 @@
817A1CF4258CF63600D1BA10 /* GYAPIManager.m */,
817A1CFD258CF7EE00D1BA10 /* GYStoreRequest.h */,
817A1CFE258CF7EE00D1BA10 /* GYStoreRequest.m */,
818880BD27171E1F00128A10 /* GYPaywallViewController+Private.h */,
811F322D2631CC6C00777020 /* Glassfy+Private.h */,
81A7064425ACADB200169564 /* GYSku+Private.h */,
8161C49E2594DF87009CA563 /* GYTransaction+Private.h */,
Expand Down Expand Up @@ -319,6 +338,8 @@
811BCDDE2608DA90007742D9 /* GYSysInfo.m */,
8179458E26565E32000EAA47 /* GYUtils.h */,
8179458F26565E32000EAA47 /* GYUtils.m */,
81B49B532729A31C000BDDA1 /* GYFormatter.h */,
81B49B542729A31C000BDDA1 /* GYFormatter.m */,
);
name = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -351,10 +372,13 @@
817A1CF5258CF63600D1BA10 /* GYAPIManager.h in Headers */,
817A1CE7258CF46600D1BA10 /* GYCacheManager.h in Headers */,
81E1DC3225933FC7003B5EBD /* SKPayment+GYEncode.h in Headers */,
818880BC27171DA900128A10 /* GYPaywallViewController.h in Headers */,
8138BA9B25924C8F005CB44E /* SKProductDiscount+GYEncode.h in Headers */,
81C684652602633500223D3E /* GYAPISignatureResponse.h in Headers */,
811F31B726317ECD00777020 /* GYPermission+Private.h in Headers */,
811F31A826317EBB00777020 /* GYOfferings+Private.h in Headers */,
818880B52717153A00128A10 /* GYAPIPaywallResponse.h in Headers */,
81B49B552729A31C000BDDA1 /* GYFormatter.h in Headers */,
811F31BC26317ED300777020 /* GYTransaction+Private.h in Headers */,
816EF29026611CF700513FB1 /* GYUserProperties+Private.h in Headers */,
811F31B226317EC800777020 /* GYOffering+Private.h in Headers */,
Expand All @@ -378,6 +402,7 @@
81951CDE26443FB8003901F1 /* GYPermissions.h in Headers */,
8138BAA225924CB4005CB44E /* SKPaymentTransaction+GYEncode.h in Headers */,
8138BA5F25923E78005CB44E /* GYCodableProtocol.h in Headers */,
818880BE27171E1F00128A10 /* GYPaywallViewController+Private.h in Headers */,
81951CDB26443FAA003901F1 /* GYSku.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -428,7 +453,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1240;
LastUpgradeCheck = 1310;
LastUpgradeCheck = 1320;
TargetAttributes = {
8168309E258B6D9C00565968 = {
CreatedOnToolsVersion = 12.3;
Expand Down Expand Up @@ -499,12 +524,15 @@
817A1CE8258CF46600D1BA10 /* GYCacheManager.m in Sources */,
810F6FB425E50CFF00D3009E /* GYOfferings.m in Sources */,
817A1D00258CF7EE00D1BA10 /* GYStoreRequest.m in Sources */,
818880BA27171D7A00128A10 /* GYPaywallViewController.m in Sources */,
818880B62717153A00128A10 /* GYAPIPaywallResponse.m in Sources */,
817A1CF6258CF63600D1BA10 /* GYAPIManager.m in Sources */,
81EFB54525A772D900706FCB /* GYAPIPermissionsResponse.m in Sources */,
8138BAA925924CDF005CB44E /* SKPaymentDiscount+GYEncode.m in Sources */,
816EF28A2661161200513FB1 /* GYUserProperties.m in Sources */,
8138BAB325924D0A005CB44E /* SKProductSubscriptionPeriod+GYEncode.m in Sources */,
817A1C76258CE0A200D1BA10 /* Glassfy.m in Sources */,
81B49B562729A31C000BDDA1 /* GYFormatter.m in Sources */,
816EF28E26611C5900513FB1 /* GYAPIPropertiesResponse.m in Sources */,
81EFB54B25A772F200706FCB /* GYPermission.m in Sources */,
81010F2A2590C1AB00B07DE4 /* GYAPIOfferingsResponse.m in Sources */,
Expand Down Expand Up @@ -657,6 +685,7 @@
816830A8258B6D9C00565968 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -672,7 +701,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.1.8;
MARKETING_VERSION = 1.2.0;
PRODUCT_BUNDLE_IDENTIFIER = net.glassfy.sdk;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -684,6 +713,7 @@
816830A9258B6D9C00565968 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -699,7 +729,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.1.8;
MARKETING_VERSION = 1.2.0;
PRODUCT_BUNDLE_IDENTIFIER = net.glassfy.sdk;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion Glassfy.xcodeproj/xcshareddata/xcschemes/Glassfy.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 4 additions & 0 deletions Source/GYAPIManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import "GYAPISignatureResponse.h"
#import "GYAPIPropertiesResponse.h"
#import "GYAPISkuResponse.h"
#import "GYAPIPaywallResponse.h"
@class SKProduct;
@class SKPaymentTransaction;
@class GYCacheManager;
Expand All @@ -23,6 +24,7 @@ typedef void(^GYGetPermissionsCompletion)(GYAPIPermissionsResponse* _Nullable, N
typedef void(^GYGetOfferingsCompletion)(GYAPIOfferingsResponse* _Nullable, NSError* _Nullable);
typedef void(^GYGetSignatureCompletion)(GYAPISignatureResponse* _Nullable, NSError* _Nullable);
typedef void(^GYGetPropertiesCompletion)(GYAPIPropertiesResponse* _Nullable, NSError* _Nullable);
typedef void(^GYGetPaywallCompletion)(GYAPIPaywallResponse* _Nullable, NSError* _Nullable);
typedef void(^GYGetSkuCompletion)(GYAPISkuResponse* _Nullable, NSError* _Nullable);
typedef void(^GYBaseCompletion)(GYAPIBaseResponse* _Nullable, NSError* _Nullable);

Expand Down Expand Up @@ -62,6 +64,8 @@ NS_ASSUME_NONNULL_BEGIN

- (void)getSignatureForProductId:(NSString *)productId offerId:(NSString *)offerId completion:(GYGetSignatureCompletion _Nullable)block;

- (void)getPaywall:(NSString *)paywallId locale:(NSString *_Nullable)locale completion:(GYGetPaywallCompletion _Nullable)block;

- (void)putLastSeen;
@end

Expand Down
16 changes: 16 additions & 0 deletions Source/GYAPIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,22 @@ - (void)getPropertiesWithCompletion:(GYGetPropertiesCompletion _Nullable)block
[self callApiWithRequest:req response:GYAPIPropertiesResponse.class completion:block];
}

- (void)getPaywall:(NSString *)paywallId locale:(NSString *)locale completion:(GYGetPaywallCompletion _Nullable)block
{
NSURLComponents *url = [self baseURLV0];
url.path = [url.path stringByAppendingPathComponent:@"paywall"];

NSMutableArray<NSURLQueryItem*> *queryItems = [(url.queryItems ?: @[]) mutableCopy];
[queryItems addObject:[NSURLQueryItem queryItemWithName:@"identifier" value:paywallId]];
if (locale) {
[queryItems addObject:[NSURLQueryItem queryItemWithName:@"locale" value:locale]];
}
url.queryItems = queryItems;

NSURLRequest *req = [self authorizedRequestWithComponents:url];
[self callApiWithRequest:req response:GYAPIPaywallResponse.class completion:block];
}

#pragma mark - private

- (NSMutableURLRequest *_Nullable)authorizedRequestWithComponents:(NSURLComponents *)urlComponents
Expand Down
21 changes: 21 additions & 0 deletions Source/GYAPIPaywallResponse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// GYAPIPaywallResponse.h
// Glassfy
//
// Created by Luca Garbolino on 13/10/21.
//

#import <Foundation/Foundation.h>
#import "GYAPIBaseResponse.h"
@class GYSku;

NS_ASSUME_NONNULL_BEGIN

@interface GYAPIPaywallResponse: GYAPIBaseResponse
@property(nonatomic, strong) NSString *content;
@property(nullable, nonatomic, strong) NSString *locale;
@property(nullable, nonatomic, strong) NSString *pwid;
@property(nonatomic, strong) NSArray<GYSku*> *skus;
@end

NS_ASSUME_NONNULL_END
65 changes: 65 additions & 0 deletions Source/GYAPIPaywallResponse.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//
// GYAPIPaywallResponse.m
// Glassfy
//
// Created by Luca Garbolino on 13/10/21.
//

#import "GYAPIPaywallResponse.h"
#import "GYAPIBaseResponse.h"
#import "GYError.h"
#import "GYSku+Private.h"

@implementation GYAPIPaywallResponse
- (instancetype _Nullable)initWithObject:(NSDictionary *)obj error:(NSError **)error
{
self = [super initWithObject:obj error:error];
if (error && *error) {
return self;
}

if (self) {
NSDictionary *paywall = obj[@"paywall"];
if ([paywall isKindOfClass:NSDictionary.class]) {
NSString *content = paywall[@"content"];
if ([content isKindOfClass:NSString.class]) {
self.content = content;
}

NSString *locale = paywall[@"locale"];
if ([locale isKindOfClass:NSString.class]) {
self.locale = locale;
}

NSString *pwid = paywall[@"pwid"];
if ([pwid isKindOfClass:NSString.class]) {
self.pwid = pwid;
}
}

NSMutableArray *skus = [NSMutableArray array];
NSArray *skusJSON = obj[@"skus"];
if ([skusJSON isKindOfClass:NSArray.class]) {
for (NSDictionary *skuJSON in skusJSON) {
if (![skuJSON isKindOfClass:NSDictionary.class] || skuJSON.allKeys.count == 0) {
continue;
}

//ToDo manage error
GYSku *s = [[GYSku alloc] initWithObject:skuJSON error:error];
if (s) {
[skus addObject:s];
}
}
}
self.skus = skus;


// verify
if (!self.content) {
*error = [GYError serverError:GYErrorCodeUnknow description:@"Unexpected data format"];
}
}
return self;
}
@end
5 changes: 5 additions & 0 deletions Source/GYError.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,9 @@ + (NSError *)serverError:(GYErrorCode)code description:(nullable NSString *)desc
return [NSError errorWithDomain:GYErrorDomain code:code userInfo:description ? @{NSLocalizedDescriptionKey:description} : nil];
}

+ (NSError *)notSupported
{
return [NSError errorWithDomain:GYErrorDomain code:GYErrorCodeAPINotSupported userInfo:@{NSLocalizedDescriptionKey:@"API not supported on this platform"}];
}

@end
25 changes: 25 additions & 0 deletions Source/GYFormatter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// GYFormatter.h
// Glassfy
//
// Created by Luca Garbolino on 27/10/21.
//

#import <Foundation/Foundation.h>

API_AVAILABLE(ios(11.2), macos(10.13.2), watchos(6.2))
typedef NS_OPTIONS(NSUInteger, SKProductPeriodUnit);

NS_ASSUME_NONNULL_BEGIN

@interface GYFormatter : NSObject
+ (NSString *)formatPrice:(NSNumber *)price locale:(NSLocale *)locale;
+ (NSString *)formatPercentage:(NSNumber *)price locale:(NSLocale *)locale;

+ (NSString *)formatPeriod:(NSInteger)perdiod unit:(SKProductPeriodUnit)unit locale:(NSLocale *)locale API_AVAILABLE(ios(11.2), macos(10.13.2), watchos(6.2));
+ (NSString *)formatUnit:(SKProductPeriodUnit)unit locale:(NSLocale *)locale API_AVAILABLE(ios(11.2), macos(10.13.2), watchos(6.2));


@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 0984d74

Please sign in to comment.