From f9af58bedee61e47dad8ae36fbc459f98a8b060c Mon Sep 17 00:00:00 2001 From: ssriram-branch Date: Mon, 25 Nov 2024 13:36:34 +0530 Subject: [PATCH] fix: PR changes --- BranchSDK.xcodeproj/project.pbxproj | 2 +- Sources/BranchSDK/BNCSystemObserver.m | 2 -- Sources/BranchSDK/Branch+Validator.m | 4 ++-- Sources/BranchSDK/BranchFileLogger.m | 12 ++++-------- .../BranchSDK/{Public => Private}/BranchFileLogger.h | 0 5 files changed, 7 insertions(+), 13 deletions(-) rename Sources/BranchSDK/{Public => Private}/BranchFileLogger.h (100%) diff --git a/BranchSDK.xcodeproj/project.pbxproj b/BranchSDK.xcodeproj/project.pbxproj index 02f1cb075..a56ab52f3 100644 --- a/BranchSDK.xcodeproj/project.pbxproj +++ b/BranchSDK.xcodeproj/project.pbxproj @@ -898,7 +898,6 @@ 5FCDD3982B7AC6A100EAF29F /* Public */ = { isa = PBXGroup; children = ( - E52E5B052CC79E4E00F553EE /* BranchFileLogger.h */, 5FCDD3A42B7AC6A100EAF29F /* BNCCallbacks.h */, 5FCDD3A02B7AC6A100EAF29F /* BNCCurrency.h */, 5FCDD3A72B7AC6A100EAF29F /* BNCInitSessionResponse.h */, @@ -978,6 +977,7 @@ 5FCDD3CC2B7AC6A100EAF29F /* NSError+Branch.h */, 5FCDD3C82B7AC6A100EAF29F /* NSMutableDictionary+Branch.h */, 5FCDD3D12B7AC6A100EAF29F /* NSString+Branch.h */, + E52E5B052CC79E4E00F553EE /* BranchFileLogger.h */, 5FCDD3BB2B7AC6A100EAF29F /* UIViewController+Branch.h */, ); path = Private; diff --git a/Sources/BranchSDK/BNCSystemObserver.m b/Sources/BranchSDK/BNCSystemObserver.m index 6c5d8a2ec..600e88922 100644 --- a/Sources/BranchSDK/BNCSystemObserver.m +++ b/Sources/BranchSDK/BNCSystemObserver.m @@ -159,8 +159,6 @@ + (BOOL)compareUriSchemes : (NSString *) serverUriScheme { if ([uriScheme isEqualToString:serverUriSchemeWithoutSuffix]) { return true; } } - // If no Uri schemes match the one set on the dashboard - return false; } return false; } diff --git a/Sources/BranchSDK/Branch+Validator.m b/Sources/BranchSDK/Branch+Validator.m index a56ab5410..c6a30266f 100644 --- a/Sources/BranchSDK/Branch+Validator.m +++ b/Sources/BranchSDK/Branch+Validator.m @@ -47,7 +47,7 @@ typedef NS_ENUM(NSUInteger, BranchValidationError) { case BranchLinkDomainError: return @"Check the link domain and alternate domain values in your info.plist file under the key 'branch_universal_link_domains'. The values should match with the ones on the Branch dashboard.\n\n"; case BranchURISchemeError: - return @"The URI scheme in your info.plist file shoudl match with the URI scheme value for iOS on the Branch dashboard.\n\n"; + return @"The URI scheme in your info.plist file should match with the URI scheme value for iOS on the Branch dashboard.\n\n"; case BranchAppIDError: return @"Check your bundle ID and Apple App Prefix from the Apple Developer website and ensure it matches with the values you have added on the Branch dashboard.\n\n"; case BranchATTError: @@ -132,8 +132,8 @@ - (void) validateIntegrationWithServerResponse:(BNCServerResponse*)response { NSLog(@"-------------------------------------------------"); NSLog(@"------ Checking for URI scheme correctness ------"); - NSString *uriScheme = [BNCSystemObserver compareUriSchemes:serverUriScheme] ? passString : errorString; bool doUriSchemesMatch = [BNCSystemObserver compareUriSchemes:serverUriScheme]; + NSString *uriScheme = doUriSchemesMatch ? passString : errorString; NSLog(@"-------------------------------------------------"); NSLog(@"-- Checking for bundle identifier correctness ---"); diff --git a/Sources/BranchSDK/BranchFileLogger.m b/Sources/BranchSDK/BranchFileLogger.m index 10aceb5ce..e02c68ca5 100644 --- a/Sources/BranchSDK/BranchFileLogger.m +++ b/Sources/BranchSDK/BranchFileLogger.m @@ -70,31 +70,27 @@ - (void)clearLogs { } - (BOOL)isLogFilePopulated { - NSString *logFilePath = [self getLogFilePath]; - // Check if the file exists - if (![[NSFileManager defaultManager] fileExistsAtPath:logFilePath]) { + if (![[NSFileManager defaultManager] fileExistsAtPath:self.logFilePath]) { return NO; } // Check if the file is non-empty - NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:logFilePath error:nil]; + NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.logFilePath error:nil]; unsigned long long fileSize = [attributes fileSize]; return fileSize > 0; // Return YES if file is populated, NO otherwise } - (void)shareLogFileFromViewController:(UIViewController *)viewController { - NSString *logFilePath = [self getLogFilePath]; - // Check if the log file exists - if (![[NSFileManager defaultManager] fileExistsAtPath:logFilePath]) { + if (![[NSFileManager defaultManager] fileExistsAtPath:self.logFilePath]) { NSLog(@"No log file found to share."); return; } // Create a URL from the log file path - NSURL *logFileURL = [NSURL fileURLWithPath:logFilePath]; + NSURL *logFileURL = [NSURL fileURLWithPath:self.logFilePath]; // Create an activity view controller with the log file UIActivityViewController *activityVC = diff --git a/Sources/BranchSDK/Public/BranchFileLogger.h b/Sources/BranchSDK/Private/BranchFileLogger.h similarity index 100% rename from Sources/BranchSDK/Public/BranchFileLogger.h rename to Sources/BranchSDK/Private/BranchFileLogger.h