summaryrefslogtreecommitdiff
path: root/platform/darwin/src/http_file_source.mm
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2019-04-26 17:52:19 -0700
committerJason Wray <friedbunny@users.noreply.github.com>2019-04-29 15:12:38 -0700
commit7263c7973b0dfb0acddd8bf66de7e57391fa5903 (patch)
treefd2a9ada8f5dc01fd372ce6acb6761a73233dc59 /platform/darwin/src/http_file_source.mm
parent9ad89cf8d7031be85eb9633f7e73d9a63b7b659e (diff)
downloadqtlocation-mapboxgl-7263c7973b0dfb0acddd8bf66de7e57391fa5903.tar.gz
[ios] Remove events=true from new SKU requests
Diffstat (limited to 'platform/darwin/src/http_file_source.mm')
-rw-r--r--platform/darwin/src/http_file_source.mm15
1 files changed, 6 insertions, 9 deletions
diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm
index c4b18ffd3c..26f6149b3f 100644
--- a/platform/darwin/src/http_file_source.mm
+++ b/platform/darwin/src/http_file_source.mm
@@ -208,20 +208,17 @@ std::unique_ptr<AsyncRequest> HTTPFileSource::request(const Resource& resource,
if (impl->accountType == 0 &&
([url.host isEqualToString:@"mapbox.com"] || [url.host hasSuffix:@".mapbox.com"])) {
NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
-
- NSMutableArray *newQueryItems = [NSMutableArray arrayWithArray:@[
- [NSURLQueryItem queryItemWithName:@"events" value:@"true"]
- ]];
+ NSURLQueryItem *accountsQueryItem = nil;
// Only add the token if we have enabled the accounts SDK
- if (MGLAccountManager.isAccountsSDKEnabled)
- {
+ if (MGLAccountManager.isAccountsSDKEnabled) {
NSCAssert(MGLAccountManager.skuToken, @"skuToken should be non-nil if the accounts SDK is enabled");
- [newQueryItems addObject:[NSURLQueryItem queryItemWithName:@"sku" value:MGLAccountManager.skuToken]];
+ accountsQueryItem = [NSURLQueryItem queryItemWithName:@"sku" value:MGLAccountManager.skuToken];
+ } else {
+ accountsQueryItem = [NSURLQueryItem queryItemWithName:@"events" value:@"true"];
}
- components.queryItems = components.queryItems ? [components.queryItems arrayByAddingObjectsFromArray:newQueryItems] : newQueryItems;
-
+ components.queryItems = components.queryItems ? [components.queryItems arrayByAddingObject:accountsQueryItem] : @[accountsQueryItem];
url = components.URL;
}
#endif