Skip to content

Commit

Permalink
Removed file logger from tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
sharath-branch committed Oct 22, 2024
1 parent 0c97306 commit 5239c1b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
12 changes: 12 additions & 0 deletions BranchSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@
5FCDD5B22B7AC89100EAF29F /* BranchSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FF2AFDF28E7C22100393216 /* BranchSDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
5FCDD5B32B7AC89200EAF29F /* BranchSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FF2AFDF28E7C22100393216 /* BranchSDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
5FCDD5B42B7AC89200EAF29F /* BranchSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FF2AFDF28E7C22100393216 /* BranchSDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
E52E5B062CC79E4E00F553EE /* BranchFileLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = E52E5B052CC79E4E00F553EE /* BranchFileLogger.h */; };
E52E5B072CC79E4E00F553EE /* BranchFileLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = E52E5B052CC79E4E00F553EE /* BranchFileLogger.h */; };
E52E5B0A2CC79E5C00F553EE /* BranchFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = E52E5B092CC79E5C00F553EE /* BranchFileLogger.m */; };
E52E5B0B2CC79E5C00F553EE /* BranchFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = E52E5B092CC79E5C00F553EE /* BranchFileLogger.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -698,6 +702,8 @@
5FF2AFDC28E7BF8A00393216 /* build_xcframework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build_xcframework.sh; sourceTree = "<group>"; };
5FF2AFDE28E7C22100393216 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
5FF2AFDF28E7C22100393216 /* BranchSDK.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BranchSDK.h; sourceTree = "<group>"; };
E52E5B052CC79E4E00F553EE /* BranchFileLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BranchFileLogger.h; sourceTree = "<group>"; };
E52E5B092CC79E5C00F553EE /* BranchFileLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BranchFileLogger.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -811,6 +817,7 @@
5FCDD36B2B7AC6A100EAF29F /* BranchSDK */ = {
isa = PBXGroup;
children = (
E52E5B092CC79E5C00F553EE /* BranchFileLogger.m */,
5FCDD3F62B7AC6A100EAF29F /* BNCAppGroupsData.m */,
5FCDD3EE2B7AC6A100EAF29F /* BNCAppleReceipt.m */,
5FCDD3712B7AC6A100EAF29F /* BNCApplication.m */,
Expand Down Expand Up @@ -890,6 +897,7 @@
5FCDD3982B7AC6A100EAF29F /* Public */ = {
isa = PBXGroup;
children = (
E52E5B052CC79E4E00F553EE /* BranchFileLogger.h */,
5FCDD3A42B7AC6A100EAF29F /* BNCCallbacks.h */,
5FCDD3A02B7AC6A100EAF29F /* BNCCurrency.h */,
5FCDD3A72B7AC6A100EAF29F /* BNCInitSessionResponse.h */,
Expand Down Expand Up @@ -1030,6 +1038,7 @@
5FCDD4C22B7AC6A200EAF29F /* BranchDeepLinkingController.h in Headers */,
5FCDD4B92B7AC6A200EAF29F /* BranchPasteControl.h in Headers */,
5FCDD5072B7AC6A300EAF29F /* BNCUrlQueryParameter.h in Headers */,
E52E5B062CC79E4E00F553EE /* BranchFileLogger.h in Headers */,
5FCDD5462B7AC6A300EAF29F /* BNCConfig.h in Headers */,
5FCDD4E62B7AC6A200EAF29F /* UIViewController+Branch.h in Headers */,
5F5FDA1A2B7DE31E00F14A43 /* BranchLogger.h in Headers */,
Expand Down Expand Up @@ -1110,6 +1119,7 @@
5FCDD4C32B7AC6A200EAF29F /* BranchDeepLinkingController.h in Headers */,
5FCDD4BA2B7AC6A200EAF29F /* BranchPasteControl.h in Headers */,
5FCDD49F2B7AC6A200EAF29F /* Branch.h in Headers */,
E52E5B072CC79E4E00F553EE /* BranchFileLogger.h in Headers */,
5FCDD5082B7AC6A300EAF29F /* BNCUrlQueryParameter.h in Headers */,
5FCDD5472B7AC6A300EAF29F /* BNCConfig.h in Headers */,
5F5FDA1B2B7DE31E00F14A43 /* BranchLogger.h in Headers */,
Expand Down Expand Up @@ -1608,6 +1618,7 @@
5FCDD4592B7AC6A100EAF29F /* BNCNetworkService.m in Sources */,
5FCDD5942B7AC6A400EAF29F /* UIViewController+Branch.m in Sources */,
5FCDD4172B7AC6A100EAF29F /* BNCServerRequestQueue.m in Sources */,
E52E5B0A2CC79E5C00F553EE /* BranchFileLogger.m in Sources */,
5FCDD5A32B7AC6A400EAF29F /* BranchOpenRequest.m in Sources */,
5FCDD5672B7AC6A300EAF29F /* BNCLinkData.m in Sources */,
5FCDD44A2B7AC6A100EAF29F /* BranchContentDiscoveryManifest.m in Sources */,
Expand Down Expand Up @@ -1712,6 +1723,7 @@
5FCDD45A2B7AC6A100EAF29F /* BNCNetworkService.m in Sources */,
5FCDD5952B7AC6A400EAF29F /* UIViewController+Branch.m in Sources */,
5FCDD4182B7AC6A100EAF29F /* BNCServerRequestQueue.m in Sources */,
E52E5B0B2CC79E5C00F553EE /* BranchFileLogger.m in Sources */,
5FCDD5A42B7AC6A400EAF29F /* BranchOpenRequest.m in Sources */,
5FCDD5682B7AC6A400EAF29F /* BNCLinkData.m in Sources */,
5FCDD44B2B7AC6A100EAF29F /* BranchContentDiscoveryManifest.m in Sources */,
Expand Down
11 changes: 10 additions & 1 deletion Sources/BranchSDK/Branch+Validator.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
#import "UIViewController+Branch.h"
#import "BNCConfig.h"
#import "Branch.h"
#if !TARGET_OS_TV
#import "BranchFileLogger.h"
#endif

void BNCForceBranchValidatorCategoryToLoad(void) {
// Empty body but forces loader to load the category.
Expand Down Expand Up @@ -307,7 +309,12 @@ - (void) showSolutionsForErrors:(NSArray<NSNumber *>*) errors {
[alertController
addAction:[UIAlertAction actionWithTitle:BranchValidationErrorReferenceDescription(error)
style:UIAlertActionStyleDefault
handler:^ (UIAlertAction *action) { [[UIApplication sharedApplication] openURL:BranchValidationErrorReference(error) options:@{} completionHandler:nil];; }]];
handler:^ (UIAlertAction *action) {
Class applicationClass = NSClassFromString(@"UIApplication");
id<NSObject> sharedApplication = [applicationClass performSelector:@selector(sharedApplication)];
if ([sharedApplication respondsToSelector:@selector(openURL:)])
[sharedApplication performSelector:@selector(openURL:) withObject:BranchValidationErrorReference(error)];
}]];
}

alertController.message = message;
Expand All @@ -323,6 +330,7 @@ - (void) showSolutionsForErrors:(NSArray<NSNumber *>*) errors {
}

- (void) showExportedLogs {
#if !TARGET_OS_TV
if ([[BranchFileLogger sharedInstance] isLogFilePopulated]) {
UIViewController *currentVC = [UIViewController bnc_currentViewController];
[[BranchFileLogger sharedInstance] shareLogFileFromViewController:currentVC];
Expand All @@ -337,6 +345,7 @@ - (void) showExportedLogs {
animated:YES
completion:nil];
}
#endif
}

//MARK: Not in use until development of Integration Validator Phase 2 Changes
Expand Down
5 changes: 4 additions & 1 deletion Sources/BranchSDK/BranchLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
//

#import "BranchLogger.h"
#if !TARGET_OS_TV
#import "BranchFileLogger.h"

Check failure on line 11 in Sources/BranchSDK/BranchLogger.m

View workflow job for this annotation

GitHub Actions / verify

'BranchFileLogger.h' file not found

Check failure on line 11 in Sources/BranchSDK/BranchLogger.m

View workflow job for this annotation

GitHub Actions / verify

'BranchFileLogger.h' file not found
#endif
#import <os/log.h>

@implementation BranchLogger
Expand Down Expand Up @@ -82,10 +84,11 @@ - (void)logMessage:(NSString *)message withLevel:(BranchLogLevel)level error:(NS
if (self.logCallback) {
self.logCallback(formattedMessage, level, error);
}

#if !TARGET_OS_TV
#ifdef DEBUG
[[BranchFileLogger sharedInstance] logMessage:formattedMessage];
#endif
#endif
}

- (NSString *)callingClass {
Expand Down

0 comments on commit 5239c1b

Please sign in to comment.