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

Commit

Permalink
Release v1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarbo committed Nov 26, 2021
1 parent 4ec2f6a commit 4607a45
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 30 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.5"
s.version = "1.1.6"
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
6 changes: 3 additions & 3 deletions Glassfy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1240;
LastUpgradeCheck = 1240;
LastUpgradeCheck = 1310;
TargetAttributes = {
8168309E258B6D9C00565968 = {
CreatedOnToolsVersion = 12.3;
Expand Down Expand Up @@ -668,7 +668,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.1.5;
MARKETING_VERSION = 1.1.6;
PRODUCT_BUNDLE_IDENTIFIER = net.glassfy.sdk;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -695,7 +695,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.1.5;
MARKETING_VERSION = 1.1.6;
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 = "1240"
LastUpgradeVersion = "1310"
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 = "1240"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Glassfy iOS SDK

Is the client for Glassfy a subscription revenue optimisation infrastructure for mobile applications.
Is the client for Glassfy: a subscription revenue optimisation infrastructure for mobile applications.

### Getting Started

Check the documentation at [docs.glassfy.net](https://docs.glassfy.net/sdk/installation) to learn details on implementing and using Glassfy SDK.
Check the documentation at [docs.glassfy.io](https://docs.glassfy.io/get-started/quick-start) to learn details on implementing and using Glassfy SDK.

### License

Expand Down
2 changes: 1 addition & 1 deletion Source/GYAPIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#import "GYCacheManager.h"
#import "GYUtils.h"

#define BASE_URL @"https://api.glassfy.net/v0"
#define BASE_URL @"https://api.glassfy.io/v0"

typedef void(^GYBaseAPICompletion)(id<GYDecodeProtocol>, NSError *);

Expand Down
19 changes: 16 additions & 3 deletions Source/GYAPIPermissionsResponse.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ - (instancetype _Nullable)initWithObject:(NSDictionary *)obj error:(NSError **)e
}

if (self) {
NSMutableArray<GYPermission *> *permissions = [NSMutableArray array];
NSMutableArray<GYPermission*> *permissions = [NSMutableArray array];
if ([obj[@"permissions"] isKindOfClass:NSArray.class]) {
NSArray *permissionsJSON = obj[@"permissions"];
for (NSDictionary *permissionJSON in permissionsJSON) {
if (![permissionJSON isKindOfClass:[NSDictionary class]]) {
if (![permissionJSON isKindOfClass:NSDictionary.class]) {
continue;
}

Expand All @@ -36,9 +36,22 @@ - (instancetype _Nullable)initWithObject:(NSDictionary *)obj error:(NSError **)e
if ([dateJSON isKindOfClass:NSNumber.class] && dateJSON.integerValue > 0) {
expireDate = [NSDate dateWithTimeIntervalSince1970:dateJSON.integerValue];
}

NSMutableSet<NSString*> *skuIds = [NSMutableSet set];
NSArray *skuidsJSON = permissionJSON[@"skuarray"];
if ([skuidsJSON isKindOfClass:NSArray.class]) {
for (NSString *skuId in skuidsJSON) {
if (![skuId isKindOfClass:NSString.class]) {
continue;
}
[skuIds addObject:skuId];
}
}

GYPermission *permission = [GYPermission permissionWithIdentifier:identifier
entitlement:entitlementJSON.integerValue
expire:expireDate];
expire:expireDate
accountableSkus:skuIds];
[permissions addObject:permission];
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/GYOffering+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
NS_ASSUME_NONNULL_BEGIN

@interface GYOffering (Private) <GYDecodeProtocol>
@property(nonatomic, nullable, strong) NSString *name;
//@property(nonatomic, nullable, strong) NSString *name;
@property(nonatomic, strong) NSString *identifier;
@property(nonatomic, strong) NSArray<GYSku*> *skus;
@end
Expand Down
12 changes: 6 additions & 6 deletions Source/GYOffering.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "GYError.h"

@interface GYOffering()
@property(nonatomic, nullable, strong) NSString *name;
//@property(nonatomic, nullable, strong) NSString *name;
@property(nonatomic, strong) NSString *identifier;
@property(nonatomic, strong) NSArray<GYSku*> *skus;
@end
Expand All @@ -23,10 +23,10 @@ - (instancetype)initWithObject:(nonnull NSDictionary *)obj error:(NSError **)err
if ([obj[@"identifier"] isKindOfClass:NSString.class]) {
identifier = obj[@"identifier"];
}
NSString *name;
if ([obj[@"name"] isKindOfClass:NSString.class]) {
name = obj[@"name"];
}
// NSString *name;
// if ([obj[@"name"] isKindOfClass:NSString.class]) {
// name = obj[@"name"];
// }

NSMutableArray<GYSku*> *skus = [NSMutableArray array];
if ([obj[@"skus"] isKindOfClass:NSArray.class]) {
Expand Down Expand Up @@ -54,7 +54,7 @@ - (instancetype)initWithObject:(nonnull NSDictionary *)obj error:(NSError **)err

self = [super init];
if (self) {
self.name = name;
// self.name = name;
self.identifier = identifier;
self.skus = skus;
}
Expand Down
5 changes: 4 additions & 1 deletion Source/GYPermission+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
NS_ASSUME_NONNULL_BEGIN

@interface GYPermission (Private)
+ (instancetype)permissionWithIdentifier:(NSString *)identifier entitlement:(GYEntitlement)entitlement expire:(nullable NSDate *)date;
+ (instancetype)permissionWithIdentifier:(NSString *)identifier
entitlement:(GYEntitlement)entitlement
expire:(nullable NSDate *)date
accountableSkus:(NSSet<NSString*> *)skuIds;
@end

NS_ASSUME_NONNULL_END
7 changes: 6 additions & 1 deletion Source/GYPermission.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ @interface GYPermission()
@property(nonatomic, readwrite, strong) NSString *permissionIdentifier;
@property(nonatomic, assign) GYEntitlement entitlement;
@property(nonatomic, readwrite, strong) NSDate *expireDate;
@property(nonatomic, readwrite, strong) NSSet<NSString*> *accountableSkus;
@end

@implementation GYPermission (Private)

+ (instancetype)permissionWithIdentifier:(NSString *)identifier entitlement:(GYEntitlement)entitlement expire:(NSDate *)date
+ (instancetype)permissionWithIdentifier:(NSString *)identifier
entitlement:(GYEntitlement)entitlement
expire:(NSDate *)date
accountableSkus:(NSSet<NSString*> *)skuIds
{
GYPermission *permission = [[self alloc] init];
permission.permissionIdentifier = identifier;
permission.entitlement = entitlement;
permission.expireDate = date;
permission.accountableSkus = skuIds;
return permission;
}

Expand Down
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.1.5";
return @"1.1.6";
}

+ (void)initializeWithAPIKey:(NSString *)apiKey
Expand Down
2 changes: 1 addition & 1 deletion Source/Public/GYOffering.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(Glassfy.Offering)
@interface GYOffering : NSObject
@property(nullable, readonly, strong) NSString *name;
//@property(nullable, readonly, strong) NSString *name;
@property(readonly, strong) NSString *identifier;
@property(readonly, strong) NSArray<GYSku*> *skus;
@end
Expand Down
1 change: 1 addition & 0 deletions Source/Public/GYPermission.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ NS_SWIFT_NAME(Glassfy.Permission)
@property(nonatomic, readonly, assign) GYEntitlement entitlement;
@property(nonatomic, readonly, assign) BOOL isValid;
@property(nonatomic, readonly, strong, nullable) NSDate *expireDate;
@property(nonatomic, readonly, strong) NSSet<NSString*> *accountableSkus;
@end

NS_ASSUME_NONNULL_END
12 changes: 6 additions & 6 deletions Source/Public/Glassfy.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Initialize the SDK
@note For more details, follow instruction at https://docs.glassfy.net/get-started/configuration
@note For more details, follow instruction at https://docs.glassfy.io/get-started/configuration
@param apiKey API Key
*/
Expand All @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Initialize the SDK
@note For more details, follow instruction at https://docs.glassfy.net/get-started/configuration
@note For more details, follow instruction at https://docs.glassfy.io/get-started/configuration
@param apiKey API Key
@param watcherMode Take advantage of our charts and stats without change your existing code
Expand All @@ -85,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Chek permissions status of the user
@note For more details, check the documentation https://docs.glassfy.net/dashboard/configure-permissions.html
@note For more details, check the documentation https://docs.glassfy.io/dashboard/configure-permissions.html
@param block Completion block with results
*/
Expand All @@ -94,7 +94,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Fetch offerings
@note For more details, check the documentation https://docs.glassfy.net/dashboard/configure-offerings
@note For more details, check the documentation https://docs.glassfy.io/dashboard/configure-offerings
@param block Completion block with results
*/
Expand All @@ -103,7 +103,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Fetch Sku
@note For more details, check the documentation https://docs.glassfy.net/dashboard/configure-products
@note For more details, check the documentation https://docs.glassfy.io/dashboard/configure-products
@param skuid Sku's identifier
@param block Completion block with result
Expand All @@ -121,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Make a purchase applying a Promotional Offers. Introductory offers are automatically applied to the purchase if user is eligible (new subscriber) while, Promotional Offers can be applied to lapsed/current subscribers
@note Be sure to load Subscription p8 Key File/ID on https://dashboard.glassfy.net so we that we can sign the purchase on your behalf
@note Be sure to load Subscription p8 Key File/ID on https://dashboard.glassfy.io so we that we can sign the purchase on your behalf
@param sku Reference to the sku to buy. To get a reference call our offering API
@param discount The discount to apply
Expand Down
3 changes: 2 additions & 1 deletion Source/SKProductDiscount+GYEncode.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@implementation SKProductDiscount (GYEncode)

API_AVAILABLE(ios(11.2), macos(10.13.2), watchos(6.2))
NSString *GYProductDiscountPaymentMode(SKProductDiscountPaymentMode type) {
NSString *discountPaymentMode;
switch (type) {
Expand All @@ -23,7 +24,7 @@ @implementation SKProductDiscount (GYEncode)
discountPaymentMode = @"freetrial";
break;
default:
discountPaymentMode = @ "unknow";
discountPaymentMode = @"unknow";
}
return discountPaymentMode;
}
Expand Down

0 comments on commit 4607a45

Please sign in to comment.