diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index 819dd741d..d5b89e9f9 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -16,15 +16,13 @@ @implementation MGLAccountManager -+ (void)initialize { - if (self == [MGLAccountManager class]) { - // Read initial configuration from Info.plist. - NSBundle *bundle = [NSBundle bundleForClass:self]; - self.accessToken = [bundle objectForInfoDictionaryKey:@"MGLMapboxAccessToken"]; - NSNumber *shownInAppNumber = [bundle objectForInfoDictionaryKey:@"MGLMapboxMetricsEnabledSettingShownInApp"]; - if (shownInAppNumber) { - [MGLAccountManager sharedManager].mapboxMetricsEnabledSettingShownInApp = [shownInAppNumber boolValue]; - } ++ (void)load { + // Read initial configuration from Info.plist. + NSBundle *bundle = [NSBundle bundleForClass:self]; + self.accessToken = [bundle objectForInfoDictionaryKey:@"MGLMapboxAccessToken"]; + NSNumber *shownInAppNumber = [bundle objectForInfoDictionaryKey:@"MGLMapboxMetricsEnabledSettingShownInApp"]; + if (shownInAppNumber) { + [MGLAccountManager sharedManager].mapboxMetricsEnabledSettingShownInApp = [shownInAppNumber boolValue]; } } @@ -63,7 +61,7 @@ + (void) setAccessToken:(NSString *) accessToken { if ( ! [accessToken length]) return; - [[MGLAccountManager sharedManager] setAccessToken:accessToken]; + [MGLAccountManager sharedManager].accessToken = accessToken; // Update MGLMapboxEvents // NOTE: This is (likely) the initial setup of MGLMapboxEvents