Skip to content

Commit

Permalink
Selected the wrong code to keep during merge, also updated the log me…
Browse files Browse the repository at this point in the history
…ssage.
  • Loading branch information
echo-branch committed Feb 15, 2024
1 parent 1bb6f9b commit 9463e61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions BranchSDK/Branch.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,12 @@ extern NSString * __nonnull const BNCSpotlightFeature;
*/
- (void)useEUEndpoints;

/**
Sets a custom base URL for all calls to the Branch API.
@param url Base URL that the Branch API will use.
*/
+ (void)setAPIUrl:(NSString *)url;

/**
@brief Use the `validateSDKIntegration` method as a debugging aid to assure that you've
integrated the Branch SDK correctly.
Expand Down
8 changes: 8 additions & 0 deletions BranchSDK/Branch.m
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,14 @@ - (void)useEUEndpoints {
[BNCServerAPI sharedInstance].useEUServers = YES;
}

+ (void)setAPIUrl:(NSString *)url {
if ([url hasPrefix:@"http://"] || [url hasPrefix:@"https://"] ){
[BNCServerAPI sharedInstance].customAPIURL = url;
} else {
[[BranchLogger shared] logWarning:(@"Ignoring invalid custom API URL")];
}
}

- (void)validateSDKIntegration {
[self validateSDKIntegrationCore];
}
Expand Down

0 comments on commit 9463e61

Please sign in to comment.