Skip to content

Commit

Permalink
Fixed bug and updated automation testbed
Browse files Browse the repository at this point in the history
  • Loading branch information
nsingh-branch committed Jun 26, 2024
1 parent a7fa569 commit ea7a764
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ fastlane/test_output
# Ruby stuff
vendor
.bundle
DeepLinkDemo/DeepLinkDemo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
8 changes: 7 additions & 1 deletion Branch-TestBed/Branch-TestBed/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ - (BOOL)application:(UIApplication *)application
// Branch.useTestBranchKey = YES; // Make sure to comment this line out for production apps!!!
Branch *branch = [Branch getInstance];


// Change the Branch base API URL
//[Branch setAPIUrl:@"https://api3.branch.io"];

// test pre init support
//[self testDispatchToIsolationQueue:branch]
[branch enableLoggingAtLevel:BranchLogLevelVerbose withCallback:^(NSString * _Nonnull message, BranchLogLevel logLevel, NSError * _Nullable error) {


[Branch enableLoggingAtLevel:BranchLogLevelVerbose withCallback:^(NSString * _Nonnull message, BranchLogLevel logLevel, NSError * _Nullable error) {
// Handle the log message and error here. For example, printing to the console:
if (error) {
NSLog(@"[BranchLog] Level: %lu, Message: %@, Error: %@", (unsigned long)logLevel, message, error.localizedDescription);
Expand All @@ -46,6 +49,7 @@ - (BOOL)application:(UIApplication *)application
}
}];


// Comment out in production. Un-comment to test your Branch SDK Integration:
//[branch validateSDKIntegration];

Expand All @@ -62,6 +66,8 @@ - (BOOL)application:(UIApplication *)application

[branch setIdentity:@"Bobby Branch"];

//[branch setConsumerProtectionAttributionLevel:BranchAttributionLevelReduced];

[branch initSessionWithLaunchOptions:launchOptions andRegisterDeepLinkHandlerUsingBranchUniversalObject:
^ (BranchUniversalObject * _Nullable universalObject, BranchLinkProperties * _Nullable linkProperties, NSError * _Nullable error) {

Expand Down
9 changes: 5 additions & 4 deletions Branch-TestBed/Branch-TestBed/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,22 +157,23 @@ - (IBAction)goToPasteControlPressed:(id)sender {
}

- (IBAction)changeConsumerProtectionAttributionLevel:(id)sender {
Branch *branch = [Branch getInstance];
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:@"Select Consumer Protection Attribution Level" message:nil preferredStyle:UIAlertControllerStyleActionSheet];

UIAlertAction *fullAction = [UIAlertAction actionWithTitle:@"Full" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[Branch setConsumerProtectionAttributionLevel:BranchAttributionLevelFull];
[branch setConsumerProtectionAttributionLevel:BranchAttributionLevelFull];
}];

UIAlertAction *privacyOnlyAction = [UIAlertAction actionWithTitle:@"Reduced" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[Branch setConsumerProtectionAttributionLevel:BranchAttributionLevelReduced];
[branch setConsumerProtectionAttributionLevel:BranchAttributionLevelReduced];
}];

UIAlertAction *attributionOnlyAction = [UIAlertAction actionWithTitle:@"Minimal" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[Branch setConsumerProtectionAttributionLevel:BranchAttributionLevelMinimal];
[branch setConsumerProtectionAttributionLevel:BranchAttributionLevelMinimal];
}];

UIAlertAction *noAttributionAction = [UIAlertAction actionWithTitle:@"None" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[Branch setConsumerProtectionAttributionLevel:BranchAttributionLevelNone];
[branch setConsumerProtectionAttributionLevel:BranchAttributionLevelNone];
}];

UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
Expand Down
2 changes: 0 additions & 2 deletions DeepLinkDemo/DeepLinkDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
B7B7DC292859974E00D45FC5 /* TextViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextViewController.swift; sourceTree = "<group>"; };
C06885D21868B25319262FC1 /* Pods-DeepLinkDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DeepLinkDemo.debug.xcconfig"; path = "Target Support Files/Pods-DeepLinkDemo/Pods-DeepLinkDemo.debug.xcconfig"; sourceTree = "<group>"; };
DDBB5A837B0C008CA5BEC1EF /* Pods_DeepLinkDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DeepLinkDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E70E80C12A0E22C1008007B6 /* BranchSDK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = BranchSDK.xcframework; path = Framework/BranchSDK.xcframework; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -101,7 +100,6 @@
29D53CAAE9E9EF2F96296086 /* Frameworks */ = {
isa = PBXGroup;
children = (
E70E80C12A0E22C1008007B6 /* BranchSDK.xcframework */,
DDBB5A837B0C008CA5BEC1EF /* Pods_DeepLinkDemo.framework */,
);
name = Frameworks;
Expand Down
Loading

0 comments on commit ea7a764

Please sign in to comment.