aptabase / aptabase-swift

Swift SDK for Aptabase: Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps
https://aptabase.com
MIT License
23 stars 8 forks source link

Fix device model identifier for Mac #22

Closed manucheri closed 5 months ago

manucheri commented 6 months ago

uname returns x86_64 (or Apple Silicon equivalent) as the device name for Macs. Get the device name in another way for Mac devices. If it fails (it shouldn't AFAIK but still), fallback to the default way (which I guess can be represented as "unknown Mac" or similar).

manucheri commented 6 months ago

@goenning With this fix I think all supported platforms should now report a device model corresponding to the actual device the code is running on.

FWIW the method used is similar to how other popular libraries (Firebase) gather the identifier.

Fine to merge?

cristipufu commented 5 months ago

Thanks @manucheri