handleTokenUpdate static method
Wire to FirebaseMessaging.instance.onTokenRefresh AND the value from
getToken() at startup. Fires fcm_token_updated only when the token
actually changes — Firebase re-emits the same token on every cold start
and we don't want to spam analytics with duplicates.
Implementation
static void handleTokenUpdate(String? token) {
final prev = _cachedToken;
_cachedToken = token;
if (token == null || token.isEmpty || token == prev) return;
final props = <String, Object?>{'fcm_token': token};
if (prev != null && prev.isNotEmpty) props['prev_token'] = prev;
UniTrack.instance.track('fcm_token_updated', properties: props);
}