diff options
Diffstat (limited to 'platform/ios/MGLAccountManager.m')
-rw-r--r-- | platform/ios/MGLAccountManager.m | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index 2f246b7d91..03a90c31b9 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -15,13 +15,15 @@ @implementation MGLAccountManager + (void)load { - // Read initial configuration from Info.plist. - NSBundle *bundle = [NSBundle bundleForClass:self]; - self.accessToken = [bundle objectForInfoDictionaryKey:@"MGLMapboxAccessToken"]; + // Read the initial configuration from Info.plist. The shown-in-app setting + // preempts the Settings bundle check in -[MGLMapboxEvents init] triggered + // by setting the access token. + NSBundle *bundle = [NSBundle mainBundle]; NSNumber *shownInAppNumber = [bundle objectForInfoDictionaryKey:@"MGLMapboxMetricsEnabledSettingShownInApp"]; if (shownInAppNumber) { [MGLAccountManager sharedManager].mapboxMetricsEnabledSettingShownInApp = [shownInAppNumber boolValue]; } + self.accessToken = [bundle objectForInfoDictionaryKey:@"MGLMapboxAccessToken"]; } // Can be called from any thread. |