Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated error domain constants visibility #416

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ end

target 'Sample' do
platform :ios, 12.0
pod 'Firebase/Auth'
pod 'GoogleSignIn'
pod 'Firebase/Auth', '8.9.0'
pod 'GoogleSignIn', '6.0.2'
#pod 'Qonversion', :path => './'
end

Expand Down
81 changes: 41 additions & 40 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,66 +1,67 @@
PODS:
- AppAuth (1.4.0):
- AppAuth/Core (= 1.4.0)
- AppAuth/ExternalUserAgent (= 1.4.0)
- AppAuth/Core (1.4.0)
- AppAuth/ExternalUserAgent (1.4.0)
- Firebase/Auth (8.9.1):
- AppAuth (1.6.2):
- AppAuth/Core (= 1.6.2)
- AppAuth/ExternalUserAgent (= 1.6.2)
- AppAuth/Core (1.6.2)
- AppAuth/ExternalUserAgent (1.6.2):
- AppAuth/Core
- Firebase/Auth (8.9.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 8.9.0)
- Firebase/CoreOnly (8.9.1):
- FirebaseCore (= 8.9.1)
- Firebase/CoreOnly (8.9.0):
- FirebaseCore (= 8.9.0)
- FirebaseAuth (8.9.0):
- FirebaseCore (~> 8.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.6)
- GoogleUtilities/Environment (~> 7.6)
- GTMSessionFetcher/Core (~> 1.5)
- FirebaseCore (8.9.1):
- FirebaseCore (8.9.0):
- FirebaseCoreDiagnostics (~> 8.0)
- GoogleUtilities/Environment (~> 7.6)
- GoogleUtilities/Logger (~> 7.6)
- FirebaseCoreDiagnostics (8.9.0):
- FirebaseCoreDiagnostics (8.15.0):
- GoogleDataTransport (~> 9.1)
- GoogleUtilities/Environment (~> 7.6)
- GoogleUtilities/Logger (~> 7.6)
- nanopb (~> 2.30908.0)
- GoogleDataTransport (9.1.2):
- GoogleUtilities/Environment (~> 7.2)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/Logger (~> 7.7)
- nanopb (~> 2.30908.0)
- GoogleDataTransport (9.2.5):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleSignIn (6.0.2):
- AppAuth (~> 1.4)
- GTMAppAuth (~> 1.0)
- GTMSessionFetcher/Core (~> 1.1)
- GoogleUtilities/AppDelegateSwizzler (7.6.0):
- GoogleUtilities/AppDelegateSwizzler (7.12.0):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.6.0):
- GoogleUtilities/Environment (7.12.0):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.6.0):
- GoogleUtilities/Logger (7.12.0):
- GoogleUtilities/Environment
- GoogleUtilities/Network (7.6.0):
- GoogleUtilities/Network (7.12.0):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.6.0)"
- GoogleUtilities/Reachability (7.6.0):
- "GoogleUtilities/NSData+zlib (7.12.0)"
- GoogleUtilities/Reachability (7.12.0):
- GoogleUtilities/Logger
- GTMAppAuth (1.2.2):
- AppAuth/Core (~> 1.4)
- GTMSessionFetcher/Core (~> 1.5)
- GTMSessionFetcher/Core (1.7.0)
- GTMAppAuth (1.3.1):
- AppAuth/Core (~> 1.6)
- GTMSessionFetcher/Core (< 3.0, >= 1.5)
- GTMSessionFetcher/Core (1.7.2)
- nanopb (2.30908.0):
- nanopb/decode (= 2.30908.0)
- nanopb/encode (= 2.30908.0)
- nanopb/decode (2.30908.0)
- nanopb/encode (2.30908.0)
- OCMock (3.7.1)
- PromisesObjC (2.0.0)
- OCMock (3.9.3)
- PromisesObjC (2.3.1)

DEPENDENCIES:
- Firebase/Auth
- GoogleSignIn
- Firebase/Auth (= 8.9.0)
- GoogleSignIn (= 6.0.2)
- OCMock

SPEC REPOS:
Expand All @@ -80,20 +81,20 @@ SPEC REPOS:
- PromisesObjC

SPEC CHECKSUMS:
AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7
Firebase: fb5114cd2bf96e2ff7bcb01d0d9a156cf5fd2f07
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
Firebase: 13d8d96499e2635428d5bf0ec675df21f95d9a95
FirebaseAuth: 2b78b2a32c07b3ecfa4970bdf1d3632b8304099b
FirebaseCore: c5aab092d9c4b8efea894946166b04c9d9ef0e68
FirebaseCoreDiagnostics: 5daa63f1c1409d981a2d5007daa100b36eac6a34
GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940
FirebaseCore: 599ee609343eaf4941bd188f85e3aa077ffe325b
FirebaseCoreDiagnostics: 92e07a649aeb66352b319d43bdd2ee3942af84cb
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
GoogleSignIn: fd381840dbe7c1137aa6dc30849a5c3e070c034a
GoogleUtilities: 684ee790a24f73ebb2d1d966e9711c203f2a4237
GTMAppAuth: ad5c2b70b9a8689e1a04033c9369c4915bfcbe89
GTMSessionFetcher: 43748f93435c2aa068b1cbe39655aaf600652e91
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
GTMSessionFetcher: 5595ec75acf5be50814f81e9189490412bad82ba
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
OCMock: 75fbeaa46a9b11f8c182bbb1d1f7e9a35ccc9955
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
OCMock: 300b1b1b9155cb6378660b981c2557448830bdc6
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4

PODFILE CHECKSUM: cd1911d751c59f56b7f0243af0b5eba4ce54bf26
PODFILE CHECKSUM: 578415250db59f137d92c9b1ce32646ae18974ba

COCOAPODS: 1.11.3
22 changes: 10 additions & 12 deletions Qonversion.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
6A95DEA229E40E9900350BD6 /* QNOutagerIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A95DEA129E40E9900350BD6 /* QNOutagerIntegrationTests.m */; };
6A95DEA529E40F2E00350BD6 /* XCTestCase+Helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A95DEA429E40F2E00350BD6 /* XCTestCase+Helpers.m */; };
700EC173291277130032E205 /* QONExperimentGroup+Protected.h in Headers */ = {isa = PBXBuildFile; fileRef = 700EC171291277130032E205 /* QONExperimentGroup+Protected.h */; };
701922272B0B812400724926 /* Qonversion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 459DAB69243E329F0011ECF3 /* Qonversion.framework */; };
701922282B0B812400724926 /* Qonversion.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 459DAB69243E329F0011ECF3 /* Qonversion.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
702394912923EBF3003126D5 /* QONNotificationsService.h in Headers */ = {isa = PBXBuildFile; fileRef = 7023948F2923EBF3003126D5 /* QONNotificationsService.h */; };
702394922923EBF3003126D5 /* QONNotificationsService.m in Sources */ = {isa = PBXBuildFile; fileRef = 702394902923EBF3003126D5 /* QONNotificationsService.m */; };
70283DF729F66FAC00D138BC /* PurchasesMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70283DF629F66FAC00D138BC /* PurchasesMapper.swift */; };
Expand Down Expand Up @@ -205,8 +207,6 @@
8957330526DD03A3009507A6 /* QNIdentityServiceInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 8957327826DD03A3009507A6 /* QNIdentityServiceInterface.h */; };
8957330926DE5531009507A6 /* QNKeyedArchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 8957330726DE5531009507A6 /* QNKeyedArchiver.h */; };
8957330A26DE5532009507A6 /* QNKeyedArchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 8957330826DE5531009507A6 /* QNKeyedArchiver.m */; };
895733B726DFDD6C009507A6 /* Qonversion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 459DAB69243E329F0011ECF3 /* Qonversion.framework */; };
895733B826DFDD6C009507A6 /* Qonversion.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 459DAB69243E329F0011ECF3 /* Qonversion.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
89673C2926F35D29008D209A /* QNIdentityServiceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 89673C2826F35D29008D209A /* QNIdentityServiceTests.m */; };
89673C2C26F37DC2008D209A /* XCTestCase+Helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 89673C2B26F37DC2008D209A /* XCTestCase+Helpers.m */; };
89673C2F26F49BAA008D209A /* QNIdentityManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 89673C2E26F49BA9008D209A /* QNIdentityManagerTests.m */; };
Expand Down Expand Up @@ -260,7 +260,7 @@
remoteGlobalIDString = 454EF63B24E5CC580070581E;
remoteInfo = Sample;
};
895733B926DFDD6C009507A6 /* PBXContainerItemProxy */ = {
701922292B0B812400724926 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 459DAB60243E329F0011ECF3 /* Project object */;
proxyType = 1;
Expand All @@ -270,13 +270,13 @@
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
895733BB26DFDD6C009507A6 /* Embed Frameworks */ = {
7019222B2B0B812400724926 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
895733B826DFDD6C009507A6 /* Qonversion.framework in Embed Frameworks */,
701922282B0B812400724926 /* Qonversion.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -540,9 +540,9 @@
files = (
45754AE725814C7500FCA376 /* iAd.framework in Frameworks */,
891ECE0B2773614600DF6A56 /* AdServices.framework in Frameworks */,
701922272B0B812400724926 /* Qonversion.framework in Frameworks */,
70D9CBDF2B03BF07003F1878 /* StoreKit.framework in Frameworks */,
A2649CD29A7FDF280A2EC27C /* Pods_Sample.framework in Frameworks */,
895733B726DFDD6C009507A6 /* Qonversion.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1663,13 +1663,13 @@
454EF63824E5CC580070581E /* Sources */,
454EF63924E5CC580070581E /* Frameworks */,
454EF63A24E5CC580070581E /* Resources */,
895733BB26DFDD6C009507A6 /* Embed Frameworks */,
4CB079286CCC86BD200EEDB0 /* [CP] Embed Pods Frameworks */,
7019222B2B0B812400724926 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
895733BA26DFDD6C009507A6 /* PBXTargetDependency */,
7019222A2B0B812400724926 /* PBXTargetDependency */,
);
name = Sample;
productName = Sample;
Expand Down Expand Up @@ -2068,10 +2068,10 @@
target = 454EF63B24E5CC580070581E /* Sample */;
targetProxy = 6A8A604C29DAD5CB008EC7D8 /* PBXContainerItemProxy */;
};
895733BA26DFDD6C009507A6 /* PBXTargetDependency */ = {
7019222A2B0B812400724926 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 459DAB68243E329F0011ECF3 /* Qonversion */;
targetProxy = 895733B926DFDD6C009507A6 /* PBXContainerItemProxy */;
targetProxy = 701922292B0B812400724926 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

Expand Down Expand Up @@ -2099,7 +2099,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 13844A737C5779AEEAD10EB9 /* Pods-Sample.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -2139,7 +2138,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = C49A7C36E2D376FDC85E470B /* Pods-Sample.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
Expand Down
7 changes: 4 additions & 3 deletions Sources/Qonversion/Public/QONErrors.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "QONErrors.h"
#import "QNInternalConstants.h"
#import "Qonversion.h"
#import <StoreKit/StoreKit.h>

@implementation QONErrors
Expand All @@ -26,7 +27,7 @@ + (NSError *)errorWithCode:(QONAPIError)errorCode message:(NSString *)message fa
info[NSDebugDescriptionErrorKey] = NSLocalizedString(failureReason, nil);
}

NSError *error = [NSError errorWithDomain:keyQONAPIErrorDomain code:errorCode userInfo:[info copy]];
NSError *error = [NSError errorWithDomain:QonversionApiErrorDomain code:errorCode userInfo:[info copy]];

return error;
}
Expand All @@ -35,7 +36,7 @@ + (NSError *)errorWithCode:(QONError)errorCode message:(NSString *)message {
NSMutableDictionary *info = [NSMutableDictionary new];
info[NSLocalizedDescriptionKey] = NSLocalizedString(message, nil);

NSError *error = [NSError errorWithDomain:keyQONErrorDomain code:errorCode userInfo:[info copy]];
NSError *error = [NSError errorWithDomain:QonversionErrorDomain code:errorCode userInfo:[info copy]];

return error;
}
Expand Down Expand Up @@ -131,7 +132,7 @@ + (NSError *)errorFromURLDomainError:(NSError *)error {

+ (NSError *)errorWithQonversionErrorCode:(QONError)code
userInfo:(nullable NSDictionary<NSErrorUserInfoKey, id> *)dict {
return [NSError errorWithDomain:keyQONErrorDomain code:code userInfo:dict];
return [NSError errorWithDomain:QonversionErrorDomain code:code userInfo:dict];
}

+ (NSString *)helpAnchorForErrorCode:(QONError)errorCode {
Expand Down
3 changes: 3 additions & 0 deletions Sources/Qonversion/Public/Qonversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

NS_ASSUME_NONNULL_BEGIN

static NSString *const QonversionErrorDomain = @"com.qonversion.io";
static NSString *const QonversionApiErrorDomain = @"com.qonversion.io.api";

@interface Qonversion : NSObject

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ extern NSString *const keyQONUserPropertyKeyReg;
extern NSString *const keyQSource;
extern NSString *const keyQSourceVersion;

extern NSString *const keyQONErrorDomain;
extern NSString *const keyQONAPIErrorDomain;
extern NSString *const kQNPlatform;
extern NSString *const kQNOSName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
NSString *const keyQSource = @"com.qonversion.keys.source";
NSString *const keyQSourceVersion = @"com.qonversion.keys.sourceVersion";

NSString *const keyQONErrorDomain = @"com.qonversion.io";
NSString *const keyQONAPIErrorDomain = @"com.qonversion.io.api";

NSString *const kHistoricalDataSynced = @"isHistoricalDataSynced";

#if TARGET_OS_OSX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#import "QNInternalConstants.h"
#import "QNProductCenterManager.h"
#import "QONUserPropertiesMapper.h"
#import "Qonversion.h"

#if !TARGET_OS_OSX
#import <UIKit/UIKit.h>
Expand Down Expand Up @@ -134,7 +135,7 @@ - (void)sendProperties {
weakSelf.updatingCurrently = NO;

if (error) {
if ([error.domain isEqualToString:keyQONAPIErrorDomain] && error.code == QONAPIErrorInvalidClientUID) {
if ([error.domain isEqualToString:QonversionApiErrorDomain] && error.code == QONAPIErrorInvalidClientUID) {
[weakSelf.productCenterManager launchWithCompletion:^(QONLaunchResult * _Nonnull result, NSError * _Nullable error) {
[weakSelf retryProperties];
}];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "QONStoreKit2PurchaseModel.h"
#import "QNDevice.h"
#import "QONRateLimiter.h"
#import "Qonversion.h"

NSUInteger const kUnableToParseEmptyDataDefaultCode = 3840;

Expand Down Expand Up @@ -592,7 +593,7 @@ - (NSError *)internalErrorFromResponse:(NSURLResponse *)response {
if (httpURLResponse.statusCode >= kInternalServerErrorFirstCode && httpURLResponse.statusCode <= kInternalServerErrorLastCode) {
NSMutableDictionary *userInfo = [NSMutableDictionary new];
userInfo[NSLocalizedDescriptionKey] = kInternalServerError;
NSError *error = [NSError errorWithDomain:keyQONErrorDomain code:httpURLResponse.statusCode userInfo:userInfo];
NSError *error = [NSError errorWithDomain:QonversionErrorDomain code:httpURLResponse.statusCode userInfo:userInfo];

return error;
}
Expand All @@ -609,7 +610,7 @@ - (NSError *)criticalErrorFromResponse:(NSURLResponse *)response {
if ([self.criticalErrorCodes containsObject:@(statusCode)]) {
NSMutableDictionary *userInfo = [NSMutableDictionary new];
userInfo[NSLocalizedDescriptionKey] = kAccessDeniedError;
NSError *error = [NSError errorWithDomain:keyQONErrorDomain code:statusCode userInfo:userInfo];
NSError *error = [NSError errorWithDomain:QonversionErrorDomain code:statusCode userInfo:userInfo];

return error;
}
Expand Down
Loading