-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make telemetry on/off setting available in-app #3445
Conversation
I'll squash this down before merging, but I wanted to preserve some code for discussion.
|
That would make the method unavailable, not deprecated. There’s an attribute for marking a method as unavailable, too, but I don’t think we need the backwards-incompatibility in this case. Just turn the method into a no-op with an
What if the ℹ️ button is hidden? Presumably the developer will implement the attribution elsewhere in the application, but then we should clarify the |
Whether in-app user metrics opt-out is configured. If set to the default value of `NO`, a user opt-out preference is expected in a `Settings.bundle` that shows in the application's section within the system Settings app. | ||
*/ | ||
+ (BOOL)mapboxMetricsEnabledSettingShownInApp; | ||
Whether in-app user telemetry opt-out is configured. If set to the default value of `NO`, a user opt-out preference was expected in a `Settings.bundle` that shows in the application's section within the system Settings app. Telemetry settings were added directly to the in-app ℹ️ menu, obseleting this method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jazzy doesn’t recognize the deprecated attribute yet. Our convention from the appledoc days is to omit documentation for deprecated and unavailable methods, but if this information is still valuable, I’d stick the last sentence in a @note
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultimately killed the docs here.
We could repurpose/rename the |
@@ -60,7 +52,7 @@ + (instancetype) sharedManager { | |||
} | |||
|
|||
+ (BOOL) mapboxMetricsEnabledSettingShownInApp { | |||
return [MGLAccountManager sharedManager].mapboxMetricsEnabledSettingShownInApp; | |||
NSLog(@"mapboxMetricsEnabledSettingShownInApp is no longer necessary, the Mapbox iOS SDK has changed to always provide a telemetry setting in-app."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: ,
→ ;
.
Looks good! |
Incoming The new, second note links to https://www.mapbox.com/help/metrics-opt-out-for-users/, which will need updating. |
44952a8
to
09ab2ed
Compare
+ (void) validate; | ||
|
||
// Main thread only | ||
+ (void) ensureMetricsOptoutExists; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be asserting that we’re on the main thread, using MGLAssertIsMainThread()
, instead of using these Java annotation–like comments, which mean nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do MGLAssertIsMainThread()
in most cases here — I'll go ahead and do so for ensureMetricsOptoutExists
, too.
@"End users must be able to opt out of Mapbox Telemetry in your app, either inside Settings (via Settings.bundle) or inside this app. " | ||
@"By default, this opt-out control is included as a menu item in the attribution action sheet. " | ||
@"If you reimplement the opt-out control inside this app, disable this assertion by setting MGLMapboxMetricsEnabledSettingShownInApp to YES in Info.plist." | ||
@"\r\n\r\nSee https://www.mapbox.com/ios-sdk/#telemetry_opt_out for more information." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\r
is extraneous on Unix-based systems. (On the Mac, it results in Windows-style selection, so I wouldn’t be surprised if VoiceOver trips over it in iOS.)
- Deprecate and no-op `+[MGLAccountManager mapboxMetricsEnabledSettingShownInApp]` - Check for attribution button hiding and make sure ToS are understood
8080b92
to
45a0f48
Compare
Changes the ℹ️ action sheet to include a "Mapbox Telemetry" entry that pops up a modal dialog with the telemetry on/off setting. This replaces "Adjust privacy settings", which kicked the user out to the system Settings.app.
Because the telemetry on/off setting is now always available (so long as the ℹ️ button is not hidden), there is no longer the requirement that the developer provide such a setting in their app's
Settings.bundle
or specify inInfo.plist
that they were otherwise providing this setting in-app.Providing the telemetry setting in Settings.app (via
Settings.bundle
) is still a recommended best-practice and completely supported, it's just no longer a requirement.Blocked by #3336, which causes this in-app setting changing to not take immediate effect./cc @1ec5