Skip to content

Commit

Permalink
Merge pull request #551 from qonversion/release/5.12.4
Browse files Browse the repository at this point in the history
Release 5.12.4
  • Loading branch information
SpertsyanKM authored Oct 15, 2024
2 parents b51a531 + 4eb2a7a commit 8ea6171
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 28 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.12.3</string>
<string>5.12.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
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.12.3'
s.version = '5.12.4'
s.summary = 'qonversion.io'
s.description = <<-DESC
Deep Analytics for iOS Subscriptions
Expand Down
5 changes: 0 additions & 5 deletions QonversionTests/QDeviceTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,4 @@ - (void)testVendorID {
XCTAssertEqualObjects(_device.vendorID, [[[UIDevice currentDevice] identifierForVendor] UUIDString]);
}

- (void)testAfUserID {
XCTAssertNil(_device.afUserID);
XCTAssertNil(_device.adjustUserID);
}

@end
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.12.3";
static NSString *const kSDKVersion = @"5.12.4";

@interface QONConfiguration ()

Expand Down
6 changes: 5 additions & 1 deletion Sources/Qonversion/Public/QONErrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ typedef NS_ERROR_ENUM(QONErrorDomain, QONError) {
QONErrorStorePaymentDeferred = 18,

// No remote configuration for the current user
QONErrorRemoteConfigurationNotAvailable = 19
QONErrorRemoteConfigurationNotAvailable = 19,

// No offerings for the current user
QONErrorOfferingsNotAvailable = 20,

} NS_SWIFT_NAME(Qonversion.Error);

Expand Down Expand Up @@ -131,6 +134,7 @@ typedef NS_ERROR_ENUM(QONErrorDomain, QONAPIError) {
+ (NSError *)errorFromURLDomainError:(NSError *)error;
+ (NSError *)errorFromTransactionError:(NSError *)error;
+ (NSError *)deferredTransactionError;
+ (NSError *)emptyOfferingsError;

@end

7 changes: 7 additions & 0 deletions Sources/Qonversion/Public/QONErrors.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ + (NSError *)deferredTransactionError {
return [self errorWithQonversionErrorCode:QONErrorStorePaymentDeferred userInfo:[userInfo copy]];
}

+ (NSError *)emptyOfferingsError {
NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init];
userInfo[NSLocalizedDescriptionKey] = @"Offerings are not available";

return [self errorWithQonversionErrorCode:QONErrorOfferingsNotAvailable userInfo:[userInfo copy]];
}

+ (NSError *)errorFromTransactionError:(NSError *)error {
QONError errorCode = QONErrorUnknown;
NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init];
Expand Down
1 change: 1 addition & 0 deletions Sources/Qonversion/Public/QONUserProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ typedef NS_ENUM(NSInteger, QONUserPropertyKey) {
QONUserPropertyKeyPushWooshHwId,
QONUserPropertyKeyAppMetricaDeviceId,
QONUserPropertyKeyAppMetricaUserProfileId,
QONUserPropertyKeyTenjinAnalyticsInstallationId,
QONUserPropertyKeyCustom,
} NS_SWIFT_NAME(Qonversion.UserPropertyKey);

Expand Down
2 changes: 1 addition & 1 deletion Sources/Qonversion/Public/Qonversion.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ - (void)syncHistoricalData {
return;
}

[[Qonversion sharedInstance] restore:^(NSDictionary<NSString *,QONEntitlement *> * _Nonnull result, NSError * _Nullable error) {
[[Qonversion sharedInstance].productCenterManager restoreTransactions:^(NSDictionary<NSString *,QONEntitlement *> * _Nonnull result, NSError * _Nullable error) {
if (error) {
QONVERSION_LOG(@"❌ Historical data sync failed: %@", error.localizedDescription);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,10 @@ - (void)executeOfferingsBlocksWithError:(NSError * _Nullable)error {
QONOfferings *offerings = [self enrichOfferingsWithStoreProducts];
resultError = offerings ? nil : resultError;

if (!offerings && !resultError) {
resultError = [QONErrors emptyOfferingsError];
}

for (QONOfferingsCompletionHandler block in blocks) {
run_block_on_main(block, offerings, resultError);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,11 @@ - (void)collectIntegrationsData {
}

- (void)collectIntegrationsDataInBackground {
NSString *adjustUserID = _device.adjustUserID;
if (![QNUtils isEmptyString:adjustUserID]) {
[self setUserProperty:@"_q_adjust_adid" value:adjustUserID];
}
[_device adjustUserIDWithCompletion:^(NSString * _Nullable userId) {
if (![QNUtils isEmptyString:userId]) {
[self setUserProperty:@"_q_adjust_adid" value:userId];
}
}];

NSString *fbAnonID = _device.fbAnonID;
if (![QNUtils isEmptyString:fbAnonID]) {
Expand Down
3 changes: 2 additions & 1 deletion Sources/Qonversion/Qonversion/Utils/QNDevice/QNDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
@property (readonly, copy, nonatomic) NSString *vendorID;

@property (readonly, copy, nonatomic) NSString *afUserID;
@property (readonly, copy, nonatomic) NSString *adjustUserID;
@property (readonly, copy, nonatomic) NSString *fbAnonID;

@property (readonly, copy, nonatomic) NSString *installDate;

- (void)adjustUserIDWithCompletion:(void(^)(NSString *userId))completion;

@end
28 changes: 17 additions & 11 deletions Sources/Qonversion/Qonversion/Utils/QNDevice/QNDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -258,20 +258,26 @@ - (nullable NSString *)fbAnonID {
return nil;
}

- (nullable NSString *)adjustUserID {
- (void)adjustUserIDWithCompletion:(void(^)(NSString *userId))completion {
Class Adjust = NSClassFromString(@"Adjust");
SEL adid = NSSelectorFromString(@"adid");
if (Adjust && adid) {
id (*imp1)(id, SEL) = (id (*)(id, SEL))[Adjust methodForSelector:adid];
NSString *adidString = nil;
if (imp1) {
adidString = imp1(Adjust, adid);
if (Adjust) {
SEL adid = NSSelectorFromString(@"adid");
SEL adidWithCompletion = NSSelectorFromString(@"adidWithCompletionHandler:");
if ([Adjust respondsToSelector:adid]) {
id (*imp1)(id, SEL) = (id (*)(id, SEL))[Adjust methodForSelector:adid];
NSString *adidString = nil;
if (imp1) {
adidString = imp1(Adjust, adid);
}

completion(adidString);
} else if ([Adjust respondsToSelector:adidWithCompletion]) {
id (*imp1)(id, SEL, id) = (id (*)(id, SEL, id))[Adjust methodForSelector:adidWithCompletion];
if (imp1) {
imp1(Adjust, adidWithCompletion, completion);
}
}

return adidString;
}

return nil;
}

- (NSString *)vendorID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ + (nullable NSString *)keyForProperty:(QONUserPropertyKey) property {
case QONUserPropertyKeyAppMetricaUserProfileId:
key = @"_q_appmetrica_user_profile_id";
break;
case QONUserPropertyKeyTenjinAnalyticsInstallationId:
key = @"_q_tenjin_aiid";
break;
case QONUserPropertyKeyCustom:
key = nil;
break;
Expand All @@ -73,6 +76,7 @@ + (QONUserPropertyKey)propertyKeyFromString:(NSString *)key {
@"_q_pushwoosh_hwid": @(QONUserPropertyKeyPushWooshHwId),
@"_q_appmetrica_device_id": @(QONUserPropertyKeyAppMetricaDeviceId),
@"_q_appmetrica_user_profile_id": @(QONUserPropertyKeyAppMetricaUserProfileId),
@"_q_tenjin_aiid": @(QONUserPropertyKeyTenjinAnalyticsInstallationId),
};

return propertiesMap[key] ? propertiesMap[key].integerValue : QONUserPropertyKeyCustom;
Expand Down
4 changes: 2 additions & 2 deletions fastlane/report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@



<testcase classname="fastlane.lanes" name="0: update_plist" time="0.007773">
<testcase classname="fastlane.lanes" name="0: update_plist" time="0.008335">

</testcase>


<testcase classname="fastlane.lanes" name="1: version_bump_podspec" time="0.000663">
<testcase classname="fastlane.lanes" name="1: version_bump_podspec" time="0.000673">

</testcase>

Expand Down

0 comments on commit 8ea6171

Please sign in to comment.