-
Notifications
You must be signed in to change notification settings - Fork 243
Added API setSafetrackAPIURL #1481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
//Check if user has set a custom API base URL / custom API safetrack base url | ||
if (self.useTrackingDomain && self.customSafeTrackAPIURL){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to confirm:
The if
on line 98 is always true by default which means useTrackingDomain
will always equal optedIntoIDFA
. So then on line 103 the if
checks if opted into idfa
and use custom safe track url
- so if using idfa and there is a custom safetrack url, use that. Else if not using idfa or no custom safe track url, use custom endpoint if available.
I think we'll want to simplify this logic further down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gdeluna-branch Thats used for unit tests. we set this to NO in unit tests. Otherwise value set for self.useTrackingDomain is overriden by actual opted in status.
|
||
|
||
- (void)testSetSafeTrackServiceURLWithUserTrackingDomain { | ||
NSString *url = @"https://links.tospotify.com"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove test urls with branding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks !
Reference
EMT-1779 -- [iOS SDK] Provide setSafetrackAPIURL utility to override BNC_SAFETRACK_API_URL
https://branch.atlassian.net/browse/EMT-1779
Summary
Added new API -
setSafetrackAPIURL
. It overridesBNC_SAFETRACK_API_URL
.If app sets a custom safe track url and user opts in for IDFA collection (useTrackingDomain is true), this custom url will be used for all v2 requests, v1/open and v1/install.
Type Of Change
Testing Instructions
BNCServerAPI *serverAPI = [BNCServerAPI sharedInstance]; serverAPI.automaticallyEnableTrackingDomain = NO; serverAPI.useTrackingDomain = YES;
Verify SDK uses this custom safetrack URL as base URL for linking and v2 requests. A sample of expected URLs is added here https://branch.atlassian.net/browse/EMT-1779?focusedCommentId=620999
cc @BranchMetrics/saas-sdk-devs for visibility.