[ios] Remove events=true from new SKU requests

This commit is contained in:
Jason Wray
2019-04-26 17:52:19 -07:00
committed by Jason Wray
parent 9ad89cf8d7
commit 7263c7973b
2 changed files with 8 additions and 9 deletions

View File

@@ -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

View File

@@ -66,5 +66,7 @@
<string>settings</string>
</dict>
</array>
<key>MGLMapboxAccountsSDKEnabled</key>
<true/>
</dict>
</plist>