Skip to content

Commit

Permalink
Release 5.11.0
Browse files Browse the repository at this point in the history
Release 5.11.0
  • Loading branch information
SpertsyanKM authored Jul 5, 2024
2 parents 5c327ba + 87ea026 commit d092fd1
Show file tree
Hide file tree
Showing 27 changed files with 634 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Framework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.10.1</string>
<string>5.11.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
4 changes: 4 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ let sources: [String] = ["Qonversion/Automations/Constants",
"Qonversion/Qonversion/Mappers/QNUserInfoMapper",
"Qonversion/Qonversion/Mappers/QONRemoteConfigMapper",
"Qonversion/Qonversion/Mappers/QONUserPropertiesMapper",
"Qonversion/Qonversion/Mappers/QONFallbackMapper",
"Qonversion/Qonversion/Models",
"Qonversion/Qonversion/Models/Protected",
"Qonversion/Qonversion/Models/QONStoreKit2PurchaseModel",
"Qonversion/Qonversion/Models/QONFallbackObject",
"Qonversion/Qonversion/Models/QNMapperObject",
"Qonversion/Qonversion/Services",
"Qonversion/Qonversion/Services/QNAPIClient",
"Qonversion/Qonversion/Services/QNIdentityService",
"Qonversion/Qonversion/Services/QNStoreKitService",
"Qonversion/Qonversion/Services/QONFallbackService",
"Qonversion/Qonversion/Services/QNUserInfoService",
"Qonversion/Qonversion/Services/QONRemoteConfigService",
"Qonversion/Qonversion/Services/QONExceptionManager",
Expand All @@ -65,6 +68,7 @@ let sources: [String] = ["Qonversion/Automations/Constants",
"Qonversion/Qonversion/Utils/QNProperties",
"Qonversion/Qonversion/Utils/QNRateLimiter",
"Qonversion/Qonversion/Utils/QNUserInfo",
"Qonversion/Qonversion/Utils/NSError+Sugare",
"Qonversion/Qonversion/Utils/QNUtils"]

let package = Package(
Expand Down
2 changes: 1 addition & 1 deletion Qonversion.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
idfa_exclude_files = ['Sources/Qonversion/IDFA']
s.name = 'Qonversion'
s.swift_version = '5.5'
s.version = '5.10.1'
s.version = '5.11.0'
s.summary = 'qonversion.io'
s.description = <<-DESC
Deep Analytics for iOS Subscriptions
Expand Down
76 changes: 68 additions & 8 deletions Qonversion.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion QonversionTests/ProductCenterManagerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "QNUserInfoService.h"
#import "QNIdentityManager.h"
#import "QNLocalStorage.h"
#import "QONFallbackService.h"
#import "Helpers/XCTestCase+TestJSON.h"

@interface QNProductCenterManager (Private)
Expand Down Expand Up @@ -46,7 +47,8 @@ - (void)setUp {
id mockUserInfoService = OCMClassMock([QNUserInfoService class]);
id mockIdentityManager = OCMClassMock([QNIdentityManager class]);
id mockLocalStorage = OCMProtocolMock(@protocol(QNLocalStorage));
_manager = [[QNProductCenterManager alloc] initWithUserInfoService:mockUserInfoService identityManager:mockIdentityManager localStorage:mockLocalStorage];
id mockFallbackService = OCMClassMock([QONFallbackService class]);
_manager = [[QNProductCenterManager alloc] initWithUserInfoService:mockUserInfoService identityManager:mockIdentityManager localStorage:mockLocalStorage fallbackService:mockFallbackService];
[_manager setApiClient:_mockClient];
}

Expand Down
1 change: 1 addition & 0 deletions QonversionTests/QonversionMapperTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import "QNMapperObject.h"
#import "QONEntitlement.h"
#import "QONLaunchResult.h"
#import "QONProduct.h"

@interface QNMapperTests : XCTestCase
@property (nonatomic, strong) NSDictionary *userInitSuccess;
Expand Down
2 changes: 1 addition & 1 deletion QonversionTests/StoreKitServiceTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ - (void)testGroupTransactions {
NSArray *resultArray = resultTransactions[key];
XCTAssertEqual(expectedArray.count, resultArray.count);

for (NSUInteger i; i < expectedArray.count; i++) {
for (NSUInteger i = 0; i < expectedArray.count; i++) {
NSArray *expectedTransaction = expectedArray[i];
NSArray *resultTransaction = resultArray[i];
XCTAssertEqual(expectedTransaction, resultTransaction);
Expand Down
159 changes: 159 additions & 0 deletions Sample/qonversion_ios_fallbacks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"products": [
{
"id": "weekly",
"duration": 0,
"store_id": "io.qonversion.weekly",
"type": 1
},
{
"id": "consumable",
"duration": null,
"store_id": "io.qonversion.consumable",
"type": 2
},
{
"id": "subs_plus_trial",
"duration": 1,
"store_id": "io.qonversion.subs.monthly.plus.trial",
"type": 0
},
{
"id": "annual",
"duration": 4,
"store_id": "io.qonversion.subs.annual",
"type": 0
},
{
"id": "in_app",
"duration": null,
"store_id": "io.qonversion.nonconsumable",
"type": 2
}
],
"offerings": [
{
"id": "main",
"tag": 1,
"products": [
{
"id": "weekly",
"duration": 0,
"store_id": "io.qonversion.weekly",
"type": 1
},
{
"id": "annual",
"duration": 4,
"store_id": "io.qonversion.subs.annual",
"type": 0
},
{
"id": "consumable",
"duration": null,
"store_id": "io.qonversion.consumable",
"type": 2
}
]
},
{
"id": "discounted_offer",
"tag": 0,
"products": []
}
],
"products_permissions": {
"weekly": [
"plus"
],
"consumable": [],
"subs_plus_trial": [
"standart"
],
"annual": [
"standart",
"sample"
],
"in_app": [
"Premium Movies"
]
},
"remote_config_list": [
{
"experiment": null,
"payload": {
"CTA": "Start Trial",
"CTA_color": "#307BF6",
"main_image": "[IMAGE_URL]",
"product_id": "prod_7d_trial_5.99",
"show_close_button": true
},
"source": {
"assignment_type": "auto",
"context_key": "main_paywall",
"name": "default paywall",
"type": "remote_configuration",
"uid": "0dcb1bd9-9bc3-4668-84aa-4540d1042c5d"
}
},
{
"experiment": null,
"payload": {
"CTA": "Start you trial",
"CTA_color": "red",
"main_image": "111",
"product_id": "123123123123123",
"show_close_button": true
},
"source": {
"assignment_type": "auto",
"context_key": "",
"name": "Default settings",
"type": "remote_configuration",
"uid": "12feb1dd-8096-47bc-a5a1-443fd2828ecc"
}
},
{
"experiment": null,
"payload": {
"test_key": "test_value"
},
"source": {
"assignment_type": "auto",
"context_key": "test_context_key",
"name": "Test with context key1",
"type": "remote_configuration",
"uid": "c5077ec4-acf4-41ea-8b43-05114be5d7ce"
}
},
{
"experiment": null,
"payload": {
"test_key_2": "test_value_2"
},
"source": {
"assignment_type": "auto",
"context_key": "test_context_key_2",
"name": "Test with context key2 - copy",
"type": "remote_configuration",
"uid": "1c000f2a-2f4b-4736-b5dd-75b13bf73deb"
}
},
{
"experiment": null,
"payload": {
"bool": true,
"json": {
"key": "value"
}
},
"source": {
"assignment_type": "auto",
"context_key": "swift_key ",
"name": "Swift",
"type": "remote_configuration",
"uid": "9f85d738-56d8-4f6c-b54a-c08658be2cb4"
}
}
]
}
2 changes: 1 addition & 1 deletion Sources/Qonversion/Public/QONConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "QONConfiguration.h"
#import "QNAPIConstants.h"

static NSString *const kSDKVersion = @"5.10.1";
static NSString *const kSDKVersion = @"5.11.0";

@interface QONConfiguration ()

Expand Down
6 changes: 6 additions & 0 deletions Sources/Qonversion/Public/Qonversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ NS_SWIFT_NAME(remoteConfigList(contextKeys:includeEmptyContextKey:completion:));
*/
- (void)handlePurchases:(NSArray<QONStoreKit2PurchaseModel *> *)purchasesInfo completion:(nullable QONDefaultCompletionHandler)completion;

/**
Call this function to check if the fallback file is accessible.
@return flag that indicates whether Qonversion was able to read data from the fallback file or not.
*/
- (BOOL)isFallbackFileAccessible;

@end

NS_ASSUME_NONNULL_END
14 changes: 11 additions & 3 deletions Sources/Qonversion/Public/Qonversion.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import "QONRemoteConfigManager.h"
#import "QONExceptionManager.h"
#import "QONUserProperty.h"
#import "QONFallbackService.h"

static id shared = nil;

Expand All @@ -26,7 +27,7 @@ @interface Qonversion()
@property (nonatomic, strong) QONExceptionManager *exceptionManager;
@property (nonatomic, strong) id<QNUserInfoServiceInterface> userInfoService;
@property (nonatomic, strong) id<QNLocalStorage> localStorage;

@property (nonatomic, strong) QONFallbackService *fallbackService;
@property (nonatomic, assign) BOOL debugMode;
@property (nonatomic, assign) QONLaunchMode launchMode;

Expand Down Expand Up @@ -239,6 +240,12 @@ - (void)handlePurchases:(NSArray<QONStoreKit2PurchaseModel *> *)purchasesInfo co
[[self productCenterManager] handlePurchases:purchasesInfo completion:completion];
}

- (BOOL)isFallbackFileAccessible {
QONFallbackObject *fallbackData = [self.fallbackService obtainFallbackData];

return fallbackData != nil;
}

// MARK: - Private

- (instancetype)initWithCustomUserDefaults:(NSUserDefaults *)userDefaults {
Expand All @@ -249,8 +256,9 @@ - (instancetype)initWithCustomUserDefaults:(NSUserDefaults *)userDefaults {
_userInfoService = [servicesAssembly userInfoService];
_localStorage = [servicesAssembly localStorage];
id<QNIdentityManagerInterface> identityManager = [servicesAssembly identityManager];

_productCenterManager = [[QNProductCenterManager alloc] initWithUserInfoService:_userInfoService identityManager:identityManager localStorage:_localStorage];
QONFallbackService *fallbackService = [QONFallbackService new];
_productCenterManager = [[QNProductCenterManager alloc] initWithUserInfoService:_userInfoService identityManager:identityManager localStorage:_localStorage fallbackService:fallbackService];
_fallbackService = fallbackService;
_propertiesManager = [QNUserPropertiesManager new];
_attributionManager = [QNAttributionManager new];
_remoteConfigManager = [QONRemoteConfigManager new];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#import "QONLaunchMode.h"
#import "QONRemoteConfigManager.h"

@class QONLaunchResult, QONStoreKit2PurchaseModel;
@class QONLaunchResult, QONStoreKit2PurchaseModel, QONFallbackService;
@protocol QONPromoPurchasesDelegate, QONEntitlementsUpdateListener, QNUserInfoServiceInterface, QNIdentityManagerInterface, QNLocalStorage;

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) QONLaunchMode launchMode;
@property (nonatomic, strong) QONRemoteConfigManager *remoteConfigManager;

- (instancetype)initWithUserInfoService:(id<QNUserInfoServiceInterface>)userInfoService identityManager:(id<QNIdentityManagerInterface>)identityManager localStorage:(id<QNLocalStorage>)localStorage;
- (instancetype)initWithUserInfoService:(id<QNUserInfoServiceInterface>)userInfoService identityManager:(id<QNIdentityManagerInterface>)identityManager localStorage:(id<QNLocalStorage>)localStorage fallbackService:(QONFallbackService *)fallbackService;

- (BOOL)isUserStable;
- (void)identify:(NSString *)userID completion:(nullable QONUserInfoCompletionHandler)completion;
Expand Down
Loading

0 comments on commit d092fd1

Please sign in to comment.