Skip to content

Commit 9463e61

Browse files
committed
Selected the wrong code to keep during merge, also updated the log message.
1 parent 1bb6f9b commit 9463e61

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

BranchSDK/Branch.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,12 @@ extern NSString * __nonnull const BNCSpotlightFeature;
576576
*/
577577
- (void)useEUEndpoints;
578578

579+
/**
580+
Sets a custom base URL for all calls to the Branch API.
581+
@param url Base URL that the Branch API will use.
582+
*/
583+
+ (void)setAPIUrl:(NSString *)url;
584+
579585
/**
580586
@brief Use the `validateSDKIntegration` method as a debugging aid to assure that you've
581587
integrated the Branch SDK correctly.

BranchSDK/Branch.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,14 @@ - (void)useEUEndpoints {
434434
[BNCServerAPI sharedInstance].useEUServers = YES;
435435
}
436436

437+
+ (void)setAPIUrl:(NSString *)url {
438+
if ([url hasPrefix:@"http://"] || [url hasPrefix:@"https://"] ){
439+
[BNCServerAPI sharedInstance].customAPIURL = url;
440+
} else {
441+
[[BranchLogger shared] logWarning:(@"Ignoring invalid custom API URL")];
442+
}
443+
}
444+
437445
- (void)validateSDKIntegration {
438446
[self validateSDKIntegrationCore];
439447
}

0 commit comments

Comments
 (0)