Skip to content

Commit

Permalink
Merge pull request #119 from qonversion/release/2.8.0
Browse files Browse the repository at this point in the history
Release/2.8.0
  • Loading branch information
suriksarkisyan authored Jan 19, 2021
2 parents b73a120 + c2f6b3c commit 767330c
Show file tree
Hide file tree
Showing 32 changed files with 651 additions and 31 deletions.
3 changes: 3 additions & 0 deletions Framework/QonversionFramework.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
#import <Qonversion/QNErrors.h>
#import <Qonversion/QNOfferings.h>
#import <Qonversion/QNOffering.h>
#import <Qonversion/QNIntroEligibility.h>
#import <Qonversion/QNExperimentInfo.h>
#import <Qonversion/QNExperimentGroup.h>
2 changes: 1 addition & 1 deletion Qonversion.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Qonversion'
s.version = '2.7.0'
s.version = '2.8.0'
s.summary = 'qonversion.io'
s.description = <<-DESC
Deep Analytics for iOS Subscriptions
Expand Down
40 changes: 38 additions & 2 deletions Qonversion.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@
8911823925222C2300EBCDFA /* QNAPIConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 8911823725222C2300EBCDFA /* QNAPIConstants.h */; };
8911823A25222C2300EBCDFA /* QNAPIConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 8911823825222C2300EBCDFA /* QNAPIConstants.m */; };
893045EC252DE8B500E22F75 /* QNPromoPurchasesDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 893045EB252DE8B500E22F75 /* QNPromoPurchasesDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
896D2D6025B0585B009905A0 /* QNIntroEligibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 896D2D5E25B0585B009905A0 /* QNIntroEligibility.h */; settings = {ATTRIBUTES = (Public, ); }; };
896D2D6125B0585B009905A0 /* QNIntroEligibility.m in Sources */ = {isa = PBXBuildFile; fileRef = 896D2D5F25B0585B009905A0 /* QNIntroEligibility.m */; };
896D2D6625B06447009905A0 /* QNIntroEligibility+Protected.h in Headers */ = {isa = PBXBuildFile; fileRef = 896D2D6425B06447009905A0 /* QNIntroEligibility+Protected.h */; };
896D2D7D25B1A82B009905A0 /* QNExperimentInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 896D2D7B25B1A82B009905A0 /* QNExperimentInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
896D2D7E25B1A82B009905A0 /* QNExperimentInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 896D2D7C25B1A82B009905A0 /* QNExperimentInfo.m */; };
896D2D8925B1AF05009905A0 /* QNExperimentGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 896D2D8725B1AF05009905A0 /* QNExperimentGroup.h */; settings = {ATTRIBUTES = (Public, ); }; };
896D2D8A25B1AF05009905A0 /* QNExperimentGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 896D2D8825B1AF05009905A0 /* QNExperimentGroup.m */; };
896D2D8F25B1B41A009905A0 /* QNExperimentGroup+Protected.h in Headers */ = {isa = PBXBuildFile; fileRef = 896D2D8D25B1B41A009905A0 /* QNExperimentGroup+Protected.h */; };
896D2D9525B1B42E009905A0 /* QNExperimentInfo+Protected.h in Headers */ = {isa = PBXBuildFile; fileRef = 896D2D9325B1B42E009905A0 /* QNExperimentInfo+Protected.h */; };
89861D2C2501563B00E5D36B /* Qonversion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 459DAB69243E329F0011ECF3 /* Qonversion.framework */; };
89861D2D2501563B00E5D36B /* Qonversion.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 459DAB69243E329F0011ECF3 /* Qonversion.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
89ADA76C250696A400EB2E54 /* ActivePermissionsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89ADA76B250696A400EB2E54 /* ActivePermissionsTableViewCell.swift */; };
Expand Down Expand Up @@ -248,6 +257,15 @@
8911823725222C2300EBCDFA /* QNAPIConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QNAPIConstants.h; sourceTree = "<group>"; };
8911823825222C2300EBCDFA /* QNAPIConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QNAPIConstants.m; sourceTree = "<group>"; };
893045EB252DE8B500E22F75 /* QNPromoPurchasesDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QNPromoPurchasesDelegate.h; sourceTree = "<group>"; };
896D2D5E25B0585B009905A0 /* QNIntroEligibility.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QNIntroEligibility.h; sourceTree = "<group>"; };
896D2D5F25B0585B009905A0 /* QNIntroEligibility.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QNIntroEligibility.m; sourceTree = "<group>"; };
896D2D6425B06447009905A0 /* QNIntroEligibility+Protected.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "QNIntroEligibility+Protected.h"; sourceTree = "<group>"; };
896D2D7B25B1A82B009905A0 /* QNExperimentInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QNExperimentInfo.h; sourceTree = "<group>"; };
896D2D7C25B1A82B009905A0 /* QNExperimentInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QNExperimentInfo.m; sourceTree = "<group>"; };
896D2D8725B1AF05009905A0 /* QNExperimentGroup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QNExperimentGroup.h; sourceTree = "<group>"; };
896D2D8825B1AF05009905A0 /* QNExperimentGroup.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QNExperimentGroup.m; sourceTree = "<group>"; };
896D2D8D25B1B41A009905A0 /* QNExperimentGroup+Protected.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "QNExperimentGroup+Protected.h"; sourceTree = "<group>"; };
896D2D9325B1B42E009905A0 /* QNExperimentInfo+Protected.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "QNExperimentInfo+Protected.h"; sourceTree = "<group>"; };
89ADA769250693C400EB2E54 /* ActivePermissionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivePermissionsViewController.swift; sourceTree = "<group>"; };
89ADA76B250696A400EB2E54 /* ActivePermissionsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivePermissionsTableViewCell.swift; sourceTree = "<group>"; };
89EA13AB25A42BB90065BCED /* QNOfferings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QNOfferings.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -393,13 +411,22 @@
children = (
45239D702517D5CD0085D0A8 /* QNLaunchResult.h */,
456ECD3E249C737500D2BC40 /* QNLaunchResult.m */,
896D2D7B25B1A82B009905A0 /* QNExperimentInfo.h */,
896D2D7C25B1A82B009905A0 /* QNExperimentInfo.m */,
896D2D9325B1B42E009905A0 /* QNExperimentInfo+Protected.h */,
896D2D8725B1AF05009905A0 /* QNExperimentGroup.h */,
896D2D8825B1AF05009905A0 /* QNExperimentGroup.m */,
896D2D8D25B1B41A009905A0 /* QNExperimentGroup+Protected.h */,
456ECD40249C75D400D2BC40 /* QNLaunchResult+Protected.h */,
45FFA2E424BED563007EFB8F /* QNMapperObject.h */,
45FFA2E524BED563007EFB8F /* QNMapperObject.m */,
45F4C2E92517E85D00AD8FF0 /* QNPermission.h */,
45F4C2EA2517E85E00AD8FF0 /* QNPermission.m */,
456ECD41249C76D400D2BC40 /* QNProduct.h */,
456ECD44249C8B2000D2BC40 /* QNProduct.m */,
896D2D5E25B0585B009905A0 /* QNIntroEligibility.h */,
896D2D5F25B0585B009905A0 /* QNIntroEligibility.m */,
896D2D6425B06447009905A0 /* QNIntroEligibility+Protected.h */,
89EA13AB25A42BB90065BCED /* QNOfferings.h */,
89EA13AC25A42BB90065BCED /* QNOfferings.m */,
89EA13B725A443070065BCED /* QNOfferings+Protected.h */,
Expand Down Expand Up @@ -612,10 +639,15 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
896D2D6025B0585B009905A0 /* QNIntroEligibility.h in Headers */,
896D2D7D25B1A82B009905A0 /* QNExperimentInfo.h in Headers */,
89EA13B325A42BC90065BCED /* QNOffering.h in Headers */,
89EA13AD25A42BB90065BCED /* QNOfferings.h in Headers */,
893045EC252DE8B500E22F75 /* QNPromoPurchasesDelegate.h in Headers */,
896D2D8925B1AF05009905A0 /* QNExperimentGroup.h in Headers */,
45FFA2CE24BDE5FE007EFB8F /* QNAPIClient.h in Headers */,
896D2D9525B1B42E009905A0 /* QNExperimentInfo+Protected.h in Headers */,
896D2D8F25B1B41A009905A0 /* QNExperimentGroup+Protected.h in Headers */,
454BE230247C4AD8001FE771 /* QNUtils.h in Headers */,
45239D722517D9270085D0A8 /* QNLaunchResult+Protected.h in Headers */,
45FFA2D924BE029E007EFB8F /* QNRequestBuilder.h in Headers */,
Expand All @@ -642,6 +674,7 @@
458A8CD124BAC5F500637130 /* QNUserDefaultsStorage.h in Headers */,
4572FE1C24BC40F900A17AC4 /* QNProductCenterManager.h in Headers */,
458A8CC124B5E50A00637130 /* QNProduct.h in Headers */,
896D2D6625B06447009905A0 /* QNIntroEligibility+Protected.h in Headers */,
458A8CD824BAC61E00637130 /* QNRequestSerializer.h in Headers */,
458A8CC824B8407C00637130 /* QNStoreKitService.h in Headers */,
458A8CBE24B4B88F00637130 /* QNStoreKitSugare.h in Headers */,
Expand Down Expand Up @@ -890,11 +923,14 @@
458A8CD924BAC61E00637130 /* QNRequestSerializer.m in Sources */,
45FFA2CF24BDE5FE007EFB8F /* QNAPIClient.m in Sources */,
45FFA2E724BED563007EFB8F /* QNMapperObject.m in Sources */,
896D2D7E25B1A82B009905A0 /* QNExperimentInfo.m in Sources */,
459DABFC243E35BC0011ECF3 /* QNMapper.m in Sources */,
456ECD34249B901900D2BC40 /* QNRequestBuilder.m in Sources */,
4572FE2124BC4B5B00A17AC4 /* QNUserPropertiesManager.m in Sources */,
896D2D6125B0585B009905A0 /* QNIntroEligibility.m in Sources */,
458A8CBF24B4B88F00637130 /* QNStoreKitSugare.m in Sources */,
4531CBC424577D770022C422 /* QNConstants.m in Sources */,
896D2D8A25B1AF05009905A0 /* QNExperimentGroup.m in Sources */,
45FFA2D424BDFCE8007EFB8F /* QNAttributionManager.m in Sources */,
458A8CC924B8407C00637130 /* QNStoreKitService.m in Sources */,
459DABF9243E35BC0011ECF3 /* QNKeychain.m in Sources */,
Expand Down Expand Up @@ -1149,7 +1185,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 2.7.0;
MARKETING_VERSION = 2.8.0;
MODULEMAP_FILE = Framework/Qonversion.modulemap;
PRODUCT_BUNDLE_IDENTIFIER = com.qonversion.Qonversion;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
Expand Down Expand Up @@ -1181,7 +1217,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 2.7.0;
MARKETING_VERSION = 2.8.0;
MODULEMAP_FILE = Framework/Qonversion.modulemap;
PRODUCT_BUNDLE_IDENTIFIER = com.qonversion.Qonversion;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
Expand Down
3 changes: 3 additions & 0 deletions Sources/Qonversion/QNAPIClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
receipt:(nullable NSString *)receipt
completion:(QNAPIClientCompletionHandler)completion;

- (void)checkTrialIntroEligibilityParamsForProducts:(NSArray<QNProduct *> *)products
completion:(QNAPIClientCompletionHandler)completion;

- (void)properties:(NSDictionary *)properties completion:(QNAPIClientCompletionHandler)completion;

- (void)attributionRequest:(QNAttributionProvider)provider
Expand Down
9 changes: 9 additions & 0 deletions Sources/Qonversion/QNAPIClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ - (void)purchaseRequestWith:(SKProduct *)product
return [self dataTaskWithRequest:request completion:completion];
}

- (void)checkTrialIntroEligibilityParamsForProducts:(NSArray<QNProduct *> *)products
completion:(QNAPIClientCompletionHandler)completion {
NSDictionary *requestData = [self.requestSerializer introTrialEligibilityDataForProducts:products];
NSDictionary *resultBody = [self enrichParameters:requestData];
NSURLRequest *request = [self.requestBuilder makeIntroTrialEligibilityRequestWithData:resultBody];

return [self dataTaskWithRequest:request completion:completion];
}

- (void)properties:(NSDictionary *)properties completion:(QNAPIClientCompletionHandler)completion {
NSDictionary *body = [self enrichParameters:@{@"properties": properties}];
NSURLRequest *request = [self.requestBuilder makePropertiesRequestWith:body];
Expand Down
1 change: 1 addition & 0 deletions Sources/Qonversion/QNAPIConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
extern NSString *const kAPIBase;
extern NSString *const kInitEndpoint;
extern NSString *const kPurchaseEndpoint;
extern NSString *const kProductsEndpoint;
extern NSString *const kPropertiesEndpoint;
extern NSString *const kAttributionEndpoint;
extern NSString *const kStoredRequestsKey;
1 change: 1 addition & 0 deletions Sources/Qonversion/QNAPIConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
NSString * const kAPIBase = @"https://api.qonversion.io/";
NSString * const kInitEndpoint = @"v1/user/init";
NSString * const kPurchaseEndpoint = @"v1/user/purchase";
NSString * const kProductsEndpoint = @"v1/products/get";
NSString * const kPropertiesEndpoint = @"v1/properties";


Expand Down
2 changes: 1 addition & 1 deletion Sources/Qonversion/QNConstants.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "QNConstants.h"

NSString *const keyQVersion = @"2.7.0";
NSString *const keyQVersion = @"2.8.0";
NSString *const keyQUnknownLibrary = @"unknown";
NSString *const keyQUnknownVersion = @"unknown";
NSString *const keyQInternalUserID = @"keyQInternalUserID";
Expand Down
19 changes: 19 additions & 0 deletions Sources/Qonversion/QNExperimentGroup+Protected.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// QNExperimentGroup+Protected.h
// Qonversion
//
// Created by Surik Sarkisyan on 15.01.2021.
// Copyright © 2021 Qonversion Inc. All rights reserved.
//

#import "QNExperimentGroup.h"

NS_ASSUME_NONNULL_BEGIN

@interface QNExperimentGroup (Protected)

- (instancetype)initWithType:(QNExperimentGroupType)type;

@end

NS_ASSUME_NONNULL_END
25 changes: 25 additions & 0 deletions Sources/Qonversion/QNExperimentGroup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// QNExperimentGroup.h
// Qonversion
//
// Created by Surik Sarkisyan on 15.01.2021.
// Copyright © 2021 Qonversion Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, QNExperimentGroupType) {
QNExperimentGroupTypeA = 0,
QNExperimentGroupTypB
} NS_SWIFT_NAME(Qonversion.ExperimentGroupType);

NS_SWIFT_NAME(Qonversion.ExperimentGroup)
@interface QNExperimentGroup : NSObject

@property (nonatomic, assign) QNExperimentGroupType type;

@end

NS_ASSUME_NONNULL_END
23 changes: 23 additions & 0 deletions Sources/Qonversion/QNExperimentGroup.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// QNExperimentGroup.m
// Qonversion
//
// Created by Surik Sarkisyan on 15.01.2021.
// Copyright © 2021 Qonversion Inc. All rights reserved.
//

#import "QNExperimentGroup.h"

@implementation QNExperimentGroup

- (instancetype)initWithType:(QNExperimentGroupType)type {
self = [super init];

if (self) {
_type = type;
}

return self;
}

@end
19 changes: 19 additions & 0 deletions Sources/Qonversion/QNExperimentInfo+Protected.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// QNExperimentInfo+Protected.h
// Qonversion
//
// Created by Surik Sarkisyan on 15.01.2021.
// Copyright © 2021 Qonversion Inc. All rights reserved.
//

#import "QNExperimentInfo.h"

NS_ASSUME_NONNULL_BEGIN

@interface QNExperimentInfo (Protected)

- (instancetype)initWithIdentifier:(NSString *)identifier group:(QNExperimentGroup *)group;

@end

NS_ASSUME_NONNULL_END
23 changes: 23 additions & 0 deletions Sources/Qonversion/QNExperimentInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// QNExperimentInfo.h
// Qonversion
//
// Created by Surik Sarkisyan on 15.01.2021.
// Copyright © 2021 Qonversion Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class QNExperimentGroup;

NS_SWIFT_NAME(Qonversion.ExperimentInfo)
@interface QNExperimentInfo : NSObject

@property (nonatomic, copy) NSString *identifier;
@property (nonatomic, strong) QNExperimentGroup *group;

@end

NS_ASSUME_NONNULL_END
24 changes: 24 additions & 0 deletions Sources/Qonversion/QNExperimentInfo.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// QNExperimentInfo.m
// Qonversion
//
// Created by Surik Sarkisyan on 15.01.2021.
// Copyright © 2021 Qonversion Inc. All rights reserved.
//

#import "QNExperimentInfo.h"

@implementation QNExperimentInfo

- (instancetype)initWithIdentifier:(NSString *)identifier group:(QNExperimentGroup *)group {
self = [super init];

if (self) {
_identifier = identifier;
_group = group;
}

return self;
}

@end
19 changes: 19 additions & 0 deletions Sources/Qonversion/QNIntroEligibility+Protected.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// QNIntroEligibility+Protected.h
// Qonversion
//
// Created by Surik Sarkisyan on 14.01.2021.
// Copyright © 2021 Qonversion Inc. All rights reserved.
//

#import "QNIntroEligibility.h"

NS_ASSUME_NONNULL_BEGIN

@interface QNIntroEligibility (Protected)

- (instancetype)initWithStatus:(QNIntroEligibilityStatus)status;

@end

NS_ASSUME_NONNULL_END
27 changes: 27 additions & 0 deletions Sources/Qonversion/QNIntroEligibility.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// QNIntroEligibility.h
// Qonversion
//
// Created by Surik Sarkisyan on 14.01.2021.
// Copyright © 2021 Qonversion Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, QNIntroEligibilityStatus) {
QNIntroEligibilityStatusUnknown = 0,
QNIntroEligibilityStatusNonIntroProduct,
QNIntroEligibilityStatusIneligible,
QNIntroEligibilityStatusEligible
} NS_SWIFT_NAME(Qonversion.IntroEligibilityStatus);

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(Qonversion.IntroEligibility)
@interface QNIntroEligibility : NSObject

@property (nonatomic, assign, readonly) QNIntroEligibilityStatus status;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 767330c

Please sign in to comment.