summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2019-04-26 17:52:19 -0700
committerJason Wray <jason@mapbox.com>2019-04-26 17:54:16 -0700
commit31743cc9f6ae807f9edea4507385e892967d4989 (patch)
tree1e95d69e8a041c8ebe1cd72fc02fccb70b272517
parent4c04f972a6fcc943dd7a8acee291fc66390c7577 (diff)
downloadqtlocation-mapboxgl-upstream/friedbunny-updates-to-libmbxaccounts-0.0.4.tar.gz
[ios] Remove events=true from new SKU requestsupstream/friedbunny-updates-to-libmbxaccounts-0.0.4
-rw-r--r--platform/darwin/src/http_file_source.mm15
-rw-r--r--platform/ios/app/Info.plist2
2 files changed, 8 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
diff --git a/platform/ios/app/Info.plist b/platform/ios/app/Info.plist
index e2f294a5a5..a30b62a862 100644
--- a/platform/ios/app/Info.plist
+++ b/platform/ios/app/Info.plist
@@ -66,5 +66,7 @@
<string>settings</string>
</dict>
</array>
+ <key>MGLMapboxAccountsSDKEnabled</key>
+ <true/>
</dict>
</plist>