summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2019-05-14 15:38:51 -0700
committerJason Wray <friedbunny@users.noreply.github.com>2019-05-15 11:22:04 -0700
commitf3dcf7937bca4ae6abb4245c1f1489635761408a (patch)
treed8cd7a66c51ed6fc619fd47e9793c1dda76c1749
parent582d615e7d96094aa86c97d2b0069c80b259e502 (diff)
downloadqtlocation-mapboxgl-f3dcf7937bca4ae6abb4245c1f1489635761408a.tar.gz
Revert "[ios] Remove events=true from new SKU requests"
This reverts commit a51e3856d7d12576df2d0584a9b8a52b0241cb8f.
-rw-r--r--platform/darwin/src/http_file_source.mm15
-rw-r--r--platform/ios/app/Info.plist2
2 files changed, 9 insertions, 8 deletions
diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm
index 26f6149b3f..c4b18ffd3c 100644
--- a/platform/darwin/src/http_file_source.mm
+++ b/platform/darwin/src/http_file_source.mm
@@ -208,17 +208,20 @@ 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];
- NSURLQueryItem *accountsQueryItem = nil;
+
+ NSMutableArray *newQueryItems = [NSMutableArray arrayWithArray:@[
+ [NSURLQueryItem queryItemWithName:@"events" value:@"true"]
+ ]];
// 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");
- accountsQueryItem = [NSURLQueryItem queryItemWithName:@"sku" value:MGLAccountManager.skuToken];
- } else {
- accountsQueryItem = [NSURLQueryItem queryItemWithName:@"events" value:@"true"];
+ [newQueryItems addObject:[NSURLQueryItem queryItemWithName:@"sku" value:MGLAccountManager.skuToken]];
}
- components.queryItems = components.queryItems ? [components.queryItems arrayByAddingObject:accountsQueryItem] : @[accountsQueryItem];
+ components.queryItems = components.queryItems ? [components.queryItems arrayByAddingObjectsFromArray:newQueryItems] : newQueryItems;
+
url = components.URL;
}
#endif
diff --git a/platform/ios/app/Info.plist b/platform/ios/app/Info.plist
index a30b62a862..e2f294a5a5 100644
--- a/platform/ios/app/Info.plist
+++ b/platform/ios/app/Info.plist
@@ -66,7 +66,5 @@
<string>settings</string>
</dict>
</array>
- <key>MGLMapboxAccountsSDKEnabled</key>
- <true/>
</dict>
</plist>