Coder Social home page Coder Social logo

Comments (3)

winsmith avatar winsmith commented on May 28, 2024 1

I totally agree with your suggestion!

from swiftclient.

Jeehut avatar Jeehut commented on May 28, 2024 1

Alright, then expect a PR from me with my above outlined solution sometime soon.

from swiftclient.

Jeehut avatar Jeehut commented on May 28, 2024

@winsmith I just noticed this warning in my console for my macOS app:

[Telemetry] On this platform, Telemetry can't generate a unique user identifier. It is recommended you supply one yourself. More info: https://telemetrydeck.com/pages/signal-reference.html

From this code I derived that you're using identifierForVendor to retrieve a unique ID for the user on other platforms. From what I understand, this ID provided by Apple behaves very much like a self-generated UUID() on first app start that was persisted somewhere accessible by the app. The only 2 differences to a self-generated UUID are:

  1. Apples UUID is the same for all apps of the same vendor on the same device.
  2. The system takes care of persisting this UUID on behalf of the developer.

As such a thing is not available on macOS, I believe the closest thing to that would be a self-generated UUID based on nothing (no deviceName or system version needed). This UUID needs to be persisted and to not meddle with the developers data, I suggest using the UserDefaults with a custom suiteName such as TelemetryDeck for that. This way TelemetryDeck could take care of persisting the default identifier on behalf of the developer. Overriding it of course should still be possible and developer who followed the warning and have overridden it should not see any effect of this default ID change.

The last difference to identifierForVendor would then be that multiple apps of the same vendor on the same device would still have different unique identifiers. I suggest that this is covered by providing a hook the developer can opt-in to by passing the user defaults object of their app group if they really want this behavior. By default, this would be the only difference to identifierForVendor.

The solution you suggest in my opinion is not safe to be unique. Two users with the same system and build version, and with the same name (e.g. "Daniel") and device could easily end up having the same identifier which could lead to a lot of confusion when tracking funnels, for example. I think, a persisted UUID is a better default here.

As I need this right now, I would be up to implement it like outlined above if you agree with my suggestion.

from swiftclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.