Commit graph

115 commits

Author SHA1 Message Date
ketanmixpanel
44b215162e
Release 6.3.0 (#718)
* Version 6.3.0

* Update docs
2026-04-17 23:11:42 +05:30
ketanmixpanel
aa43906260
Release 6.2.0 (#710)
* Version 6.2.0

* Update docs
2026-04-07 22:26:10 +05:30
ketanmixpanel
6e2a786b1e
Release 6.1.0 (#708)
* Version 6.1.0

* Update docs
2026-04-02 20:57:26 +05:30
Ketan S
8d46455a6b Update docs 2026-03-17 00:02:07 +05:30
Ketan S
f0d300bc3c Update docs 2026-02-25 15:11:40 -05:00
Jared McFarland
de73100ee3
Add deviceIdProvider closure for custom device ID generation (#692)
* Add deviceIdProvider closure for custom device ID generation

Adds a `deviceIdProvider: (() -> String)?` property to MixpanelOptions
that allows customers to supply their own device ID generation logic.

Key behaviors:
- Provider called on init (if no persisted identity) and after reset()/optOutTracking()
- Return same value = persistent device ID (never resets)
- Return different value = ephemeral device ID (resets each time)
- SDK logs warning when provider would replace existing persisted anonymousId
- Empty string from provider falls back to default UUID/IDFV behavior

This gives customers full control over device ID persistence and reset
semantics without needing separate parameters on reset() and optOutTracking().

Includes:
- 13 unit tests covering all behaviors
- Comprehensive documentation in docs/device-id-provider.md

* Address PR review feedback for deviceIdProvider

- Change log level from warn to error for identity mismatch
- Use defaultDeviceId() in unarchive to avoid calling provider twice
- Add whitespace trimming to provider result
- Update documentation table with "Value Used?" column
- Add testIdentifyWithDeviceIdProvider test case

* Add deviceIdProvider QA helpers to MixpanelDemo

- Add persistent and ephemeral device ID provider examples in AppDelegate
- Enhance Reset button with before/after console logging
- Default to no provider (standard SDK behavior) for production

* Make deviceIdProvider return optional String for graceful error handling

Change type from `(() -> String)?` to `(() -> String?)?` so customers can
return nil to signal "use SDK default" when their device ID source fails.

- Update MixpanelOptions type signature and documentation
- Handle optional return in defaultDeviceId() with nil-coalescing
- Update warning message to mention nil or empty string
- Add failingDeviceIdProvider test option in demo app
- Add testProviderReturningNilFallsBackToDefault test

* Add Original ID Merge compatibility note to deviceIdProvider docs

Document the footgun with persistent device IDs + Original ID Merge
on shared devices, where createAlias() can incorrectly merge
identities of different users.

* Add thread-safety warning to deviceIdProvider documentation

The provider closure is called while holding internal locks, so blocking
operations (Keychain, network, UserDefaults) can cause deadlocks. Update
docs and examples to recommend caching the device ID at app launch and
returning the cached value from the provider.

- Add Thread Safety note to MixpanelOptions.swift doc comment
- Update docs/device-id-provider.md with caching pattern
- Revise Best Practices to emphasize non-blocking providers
- Update MixpanelDemo to demonstrate caching pattern
2026-02-06 11:35:58 +05:30
Jared McFarland
f6a84e62de Update docs 2026-02-03 20:33:19 -08:00
Jared McFarland
e0af743b6a Update docs 2025-09-24 15:29:52 -07:00
Jared McFarland
96a0e8f0fa Update docs 2025-09-17 13:57:11 -07:00
Jared McFarland
f1b8ceb52f Update docs 2025-08-06 12:26:25 -07:00
Jared McFarland
82d1ce415b Update docs 2025-05-28 13:55:22 -07:00
Jared McFarland
e261928289 Update docs 2025-04-24 15:52:30 -07:00
Jared McFarland
c550cbef76 Update docs 2025-03-31 16:52:28 -07:00
Jared McFarland
6302088440 Update docs 2025-02-10 16:25:33 -08:00
Zihe Jia
7f73084879 Update docs 2024-05-03 17:08:17 -07:00
Zihe Jia
2dc2121b6d Update docs 2024-04-19 16:35:34 -07:00
Jared McFarland
a7bd4851ca Update docs 2024-04-08 14:53:49 -07:00
Jared McFarland
c3be71ee3d Update docs 2024-03-27 11:52:52 -07:00
Jared McFarland
f9c08fa17e Update docs 2024-03-25 12:26:56 -07:00
Jared McFarland
e1339901ad Update docs 2024-03-18 12:53:59 -07:00
Jared McFarland
60e265aa20 Update docs 2024-03-14 16:32:29 -07:00
Zihe Jia
ecd44ed6af Update docs 2023-11-13 13:55:00 -08:00
Jared McFarland
8ce81c8ed4 Update docs 2023-07-19 16:50:11 -07:00
Zihe Jia
7c6f28ecbf Update docs 2023-06-16 13:28:27 -07:00
Jared McFarland
78e020a28d Update docs 2023-05-16 17:00:34 -07:00
Jared McFarland
c151e407e5 Update docs 2023-04-28 15:01:27 -07:00
Zihe Jia
17642e5982 Update docs 2023-03-22 19:43:20 -07:00
Zihe Jia
adcad0457e Update docs 2023-03-14 19:04:27 -07:00
Jared McFarland
c24d055da7 Update docs 2023-03-01 14:44:10 -08:00
Jared McFarland
cde947cd8d Update docs 2022-11-02 15:02:23 -07:00
Jared McFarland
96945a6a57 Update docs 2022-09-19 11:16:10 -07:00
Jared McFarland
945676fc3d Update docs 2022-09-13 15:47:02 -07:00
Jared McFarland
3cb689a884 Update docs 2022-09-09 14:12:46 -07:00
Jared McFarland
4f576088b8 Update docs 2022-08-16 14:48:16 -07:00
Jared McFarland
369e5796b2 Update docs 2022-07-18 16:14:30 -07:00
Zihe Jia
d313f7acfd fix minor typo in docs 2022-07-06 12:35:04 -07:00
Zihe Jia
7a43e2d706 Update docs 2022-07-06 12:26:26 -07:00
Jared McFarland
d6ea5d4f71 Update docs 2022-06-24 12:03:14 -07:00
Jared McFarland
d85609ac7c Update docs 2022-05-20 15:00:31 -07:00
Jared McFarland
4302379856 Update docs 2022-05-05 17:47:02 -07:00
Jared McFarland
2c9bbe963e Update docs 2022-05-05 13:03:28 -07:00
Jared McFarland
f5518818b6 Update docs 2022-04-26 15:41:59 -07:00
Jared McFarland
1469a7cdc2 Update docs 2022-04-21 15:30:04 -07:00
Jared McFarland
9929161180 update docs 2022-04-11 13:48:27 -07:00
Jared McFarland
8ecce4c2ce Update docs 2022-03-23 15:29:13 -07:00
Jared McFarland
c20637be10 Update docs 2022-03-08 17:14:32 -08:00
Zihe Jia
b1ff3fd1b5 Update docs 2022-02-18 17:37:59 -08:00
Zihe Jia
f2f462ed1a Update docs 2022-02-10 18:05:25 -08:00
Zihe Jia
86aa46d54b Update docs 2022-02-03 11:31:22 -08:00
Zihe Jia
c7f8f46c7c Update docs 2022-01-26 13:15:06 -08:00