Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

MGLAccountManager should get its data from Info.plist entries, not class setter method calls #1535

Closed
1ec5 opened this issue May 12, 2015 · 0 comments · Fixed by #1553
Closed
Labels
iOS Mapbox Maps SDK for iOS refactor telemetry Integration with Mapbox Telemetry libraries
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented May 12, 2015

MGLAccountManager currently forces the developer to send it -setMapboxMetricsEnabledSettingShownInApp: (optionally) and -setAccessToken: sometime at startup, in that order, before the first MGLMapView is initialized. The exact place where these setters must be called depends on how and where they use MGLMapView – whether programmatically or in a storyboard, whether in the initial view controller or some later view controller, etc.

iOS has an affordance for settings that need to be set right at launch: the Info.plist that comes with every project. MGLAccountManager should look there for the access token and in-app opt-out flag. For beta 2, we should deprecate the class setters and add code to +[MGLAccountManager initialize] (which is called as soon as MapboxGL.a loads) that looks inside the Info.plist using -[NSBundle objectForInfoDictionaryKey:].

/cc @incanus @bleege

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS refactor telemetry Integration with Mapbox Telemetry libraries labels May 12, 2015
@1ec5 1ec5 added this to the iOS Beta 2 milestone May 12, 2015
1ec5 added a commit that referenced this issue May 13, 2015
That way there’s no ambiguity about when you should call things like `+[MGLAccountManager setMapboxMetricsEnabledSettingShownInApp:]`. In fact, that method is now deprecated because it’s so easy to call in the wrong place.

Fixes #1535.
@1ec5 1ec5 added the ready label May 17, 2015
@1ec5 1ec5 removed the ready label May 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS refactor telemetry Integration with Mapbox Telemetry libraries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant