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

Make telemetry on/off setting available in-app - #3445

Merged
friedbunny merged 1 commit into
masterfrom
tell-me-more
Jan 9, 2016
Merged

friedbunny merged 1 commit into
masterfrom
tell-me-more

Conversation

@friedbunny

Copy link
Copy Markdown
Contributor

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 in Info.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.

blah2-compressor

/cc @1ec5

@friedbunny friedbunny added iOS Mapbox Maps SDK for iOS refactor telemetry Integration with Mapbox Telemetry libraries labels Jan 6, 2016
@friedbunny friedbunny added this to the ios-v3.1.0 milestone Jan 6, 2016
@friedbunny

Copy link
Copy Markdown
Contributor Author

I'll squash this down before merging, but I wanted to preserve some code for discussion.

  1. I think we should remove +[MGLAccountManager mapboxMetricsEnabledSettingShownInApp] entirely before merging, but for now I've made it deprecated and throw an exception. This should never have been used externally.
  2. -[MGLMapboxEvents init] no longer has to care if Settings.bundle exists, so I ripped all of that out.

@1ec5

1ec5 commented Jan 6, 2016

Copy link
Copy Markdown
Contributor

for now I've made it deprecated and throw an exception

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 NSLog about the deprecation.

-[MGLMapboxEvents init] no longer has to care if Settings.bundle exists, so I ripped all of that out.

What if the ℹ️ button is hidden? Presumably the developer will implement the attribution elsewhere in the application, but then we should clarify the MGLMapView.attributionButton documentation. Currently it only talks about copyright notices, but the user opt-out is also important to get right.

Comment thread include/mbgl/ios/MGLAccountManager.h Outdated

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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.

@friedbunny

Copy link
Copy Markdown
Contributor Author

What if the ℹ️ button is hidden?

We could repurpose/rename the MGLMapboxMetricsEnabledSettingShownInApp plist key, checking if ℹ️ is hidden and shouting if the key is not set, but I don't think I'm in favor of that — improved docs for MGLMapView.attributionButton will hopefully suffice.

Comment thread platform/ios/src/MGLAccountManager.m Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: , → ;.

@1ec5

1ec5 commented Jan 6, 2016

Copy link
Copy Markdown
Contributor

Looks good!

@friedbunny

Copy link
Copy Markdown
Contributor Author

Incoming MGLMapView.attributionButton docs updates:

screen shot 2016-01-06 at 4 28 30 pm

The new, second note links to https://www.mapbox.com/help/metrics-opt-out-for-users/, which will need updating.

@friedbunny
friedbunny force-pushed the tell-me-more branch 2 times, most recently from 44952a8 to 09ab2ed Compare January 8, 2016 22:47

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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.

@1ec5

1ec5 commented Jan 8, 2016

Copy link
Copy Markdown
Contributor

The setting is still called Mapbox Metrics in a couple places. (Don’t ask me why it’s duplicated…)

Mind updating the strings?

Comment thread platform/ios/src/MGLMapboxEvents.m Outdated

Copy link
Copy Markdown
Contributor

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
@friedbunny friedbunny self-assigned this Jan 9, 2016
@friedbunny
friedbunny merged commit 45a0f48 into master Jan 9, 2016
@mourner mourner removed the ready label Jan 9, 2016
@friedbunny
friedbunny deleted the tell-me-more branch January 9, 2016 06:38
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 this pull request may close these issues.

3 participants