summaryrefslogtreecommitdiff
path: root/platform/ios/MGLMapboxEvents.m
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-05-21 01:49:53 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-05-21 01:49:53 -0700
commit70381d2705991b15a1861b3162f50aa56961343c (patch)
treeeb402d4df1de78d197df7dc16321454b7b31547d /platform/ios/MGLMapboxEvents.m
parent8a83c31e05b47c910d5862cb2ed34828fc491e40 (diff)
downloadqtlocation-mapboxgl-70381d2705991b15a1861b3162f50aa56961343c.tar.gz
Fixed up various Info.plist edge cases
Need to look in the main bundle for Info.plist settings, because the developer has no access to the framework’s Info.plist. Need to check MGLMapboxMetricsEnabledSettingShownInApp before MGLMapboxAccessToken; otherwise, `MGLMapboxEvents` inspects the Settings bundle plist before MGLMapboxMetricsEnabledSettingShownInApp is even checked.
Diffstat (limited to 'platform/ios/MGLMapboxEvents.m')
-rw-r--r--platform/ios/MGLMapboxEvents.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m
index a0e771ad07..1079899ced 100644
--- a/platform/ios/MGLMapboxEvents.m
+++ b/platform/ios/MGLMapboxEvents.m
@@ -177,7 +177,7 @@ const NSTimeInterval MGLFlushInterval = 60;
+ (void)initialize {
if (self == [MGLMapboxEvents class]) {
- NSBundle *bundle = [NSBundle bundleForClass:self];
+ NSBundle *bundle = [NSBundle mainBundle];
NSNumber *accountTypeNumber = [bundle objectForInfoDictionaryKey:@"MGLMapboxAccountType"];
[[NSUserDefaults standardUserDefaults] registerDefaults:@{
@"MGLMapboxAccountType": accountTypeNumber ? accountTypeNumber : @0,
@@ -198,7 +198,8 @@ const NSTimeInterval MGLFlushInterval = 60;
self = [super init];
if (self) {
- if (! [MGLAccountManager mapboxMetricsEnabledSettingShownInApp]) {
+ if (! [MGLAccountManager mapboxMetricsEnabledSettingShownInApp] &&
+ [[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"] == 0) {
// Opt Out is not configured in UI, so check for Settings.bundle
// Put Settings bundle into memory
id defaultEnabledValue;