Skip to content

Commit 821e89f

Browse files
authored
Merge pull request #1082 from BranchMetrics/CORE-1626-missed-a-term
CORE-1626 missed a term
2 parents 9e09383 + 213dc8a commit 821e89f

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

Branch-SDK/BNCServerInterface.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ - (void)genericHTTPRequest:(NSURLRequest *)request
244244
if (Branch.trackingDisabled) {
245245
NSString *endpoint = request.URL.absoluteString;
246246

247-
// if endpoint is not on the whitelist, fail it.
248-
if (![self whiteListContainsEndpoint:endpoint]) {
247+
// if endpoint is not linking related, fail it.
248+
if (![self isLinkingRelatedRequest:endpoint]) {
249249
[[BNCPreferenceHelper preferenceHelper] clearTrackingInformation];
250250
NSError *error = [NSError branchErrorWithCode:BNCTrackingDisabledError];
251251
BNCLogWarning([NSString stringWithFormat:@"Dropping Request %@: - %@", endpoint, error]);
@@ -269,7 +269,7 @@ - (void)genericHTTPRequest:(NSURLRequest *)request
269269
}
270270
}
271271

272-
- (BOOL)whiteListContainsEndpoint:(NSString *)endpoint {
272+
- (BOOL)isLinkingRelatedRequest:(NSString *)endpoint {
273273
BNCPreferenceHelper *prefs = [BNCPreferenceHelper preferenceHelper];
274274
BOOL hasIdentifier = (prefs.linkClickIdentifier.length > 0 ) || (prefs.spotlightIdentifier.length > 0 ) || (prefs.universalLinkUrl.length > 0);
275275

Branch-SDK/Branch.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -619,18 +619,18 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
619619
-(void)setDeepLinkDebugMode:(nullable NSDictionary *)debugParams;
620620

621621
/**
622-
Add a scheme to a whitelist of URI schemes that will be tracked by Branch. Default to all schemes.
622+
Allow a URI scheme to be tracked by Branch. Default to all schemes.
623623
624-
@param scheme to add to the whitelist, i.e. @"http", @"https" or @"myapp"
624+
@param scheme URI scheme allowed to track, i.e. @"http", @"https" or @"myapp"
625625
*/
626-
-(void)addWhiteListedScheme:(nullable NSString *)scheme;
626+
-(void)addAllowedScheme:(nullable NSString *)scheme;
627627

628628
/**
629-
Add an array of schemes to a whitelist of URI schemes that will be tracked by Branch. Default to all schemes.
629+
Allow an array of URI schemes to be tracked by Branch. Default to all schemes.
630630
631-
@param schemes array to add to the whitelist, i.e. @[@"http", @"https", @"myapp"]
631+
@param schemes An array of URI schemes allowed to track, i.e. @[@"http", @"https", @"myapp"]
632632
*/
633-
-(void)setWhiteListedSchemes:(nullable NSArray *)schemes;
633+
-(void)setAllowedSchemes:(nullable NSArray *)schemes;
634634

635635
/**
636636
@brief Sets an array of regex patterns that match URLs for Branch to ignore.

Branch-SDK/Branch.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ @interface Branch() <BranchDeepLinkingControllerCompletionDelegate> {
140140
@property (strong, nonatomic) NSMutableDictionary *deepLinkControllers;
141141
@property (weak, nonatomic) UIViewController *deepLinkPresentingController;
142142
@property (strong, nonatomic) NSDictionary *deepLinkDebugParams;
143-
@property (strong, nonatomic) NSMutableArray *whiteListedSchemeList;
143+
@property (strong, nonatomic) NSMutableArray *allowedSchemeList;
144144
@property (strong, nonatomic) BNCURLFilter *urlFilter;
145145

146146
#if !TARGET_OS_TV
@@ -193,7 +193,7 @@ - (id)initWithInterface:(BNCServerInterface *)interface
193193
_processing_sema = dispatch_semaphore_create(1);
194194
_networkCount = 0;
195195
_deepLinkControllers = [[NSMutableDictionary alloc] init];
196-
_whiteListedSchemeList = [[NSMutableArray alloc] init];
196+
_allowedSchemeList = [[NSMutableArray alloc] init];
197197

198198
#if !TARGET_OS_TV
199199
_contentDiscoveryManager = [[BNCContentDiscoveryManager alloc] init];
@@ -665,12 +665,12 @@ - (void)setDeepLinkDebugMode:(NSDictionary *)debugParams {
665665
self.deepLinkDebugParams = debugParams;
666666
}
667667

668-
- (void)setWhiteListedSchemes:(NSArray *)schemes {
669-
self.whiteListedSchemeList = [schemes mutableCopy];
668+
- (void)setAllowedSchemes:(NSArray *)schemes {
669+
self.allowedSchemeList = [schemes mutableCopy];
670670
}
671671

672-
- (void)addWhiteListedScheme:(NSString *)scheme {
673-
[self.whiteListedSchemeList addObject:scheme];
672+
- (void)addAllowedScheme:(NSString *)scheme {
673+
[self.allowedSchemeList addObject:scheme];
674674
}
675675

676676
- (void)setUrlPatternsToIgnore:(NSArray<NSString*>*)urlsToIgnore {
@@ -731,8 +731,8 @@ - (BOOL)handleSchemeDeepLink_private:(NSURL*)url sceneIdentifier:(NSString *)sce
731731
NSString *urlScheme = [url scheme];
732732

733733
// save the incoming url in the preferenceHelper in the externalIntentURI field
734-
if ([self.whiteListedSchemeList count]) {
735-
for (NSString *scheme in self.whiteListedSchemeList) {
734+
if ([self.allowedSchemeList count]) {
735+
for (NSString *scheme in self.allowedSchemeList) {
736736
if (urlScheme && [scheme isEqualToString:urlScheme]) {
737737
self.preferenceHelper.externalIntentURI = [url absoluteString];
738738
self.preferenceHelper.referringURL = [url absoluteString];

Branch-SDK/NSError+Branch.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ + (NSString *) messageForCode:(BNCErrorCode)code {
4141
[messages setObject:@"Can't redeem zero credits." forKey:@(BNCRedeemZeroCreditsError)];
4242
[messages setObject:@"The Spotlight identifier is required to remove indexing from spotlight." forKey:@(BNCSpotlightIdentifierError)];
4343
[messages setObject:@"Spotlight cannot remove publicly indexed content." forKey:@(BNCSpotlightPublicIndexError)];
44-
[messages setObject:@"User tracking is disabled and the request is not on the whitelist" forKey:@(BNCTrackingDisabledError)];
44+
[messages setObject:@"User tracking is disabled and the request is not allowed" forKey:@(BNCTrackingDisabledError)];
4545
});
4646

4747
NSString *errorMessage = [messages objectForKey:@(code)];

0 commit comments

Comments
 (0)