You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Handle enriched context - enhanced data for flow completion
417
417
onTwoFactorContextUpdated = { enrichedContext ->
418
418
// SDK-enriched context with additional data:
419
-
// - Available email addresses for 2FA
419
+
// - Available email addresses for TFA
420
420
// - Phone numbers registered for SMS
421
421
// - QR codes for authenticator apps
422
422
// - Tokens needed for flow continuation
@@ -503,6 +503,222 @@ This powerful DSL system allows you to:
503
503
-**Handle complex flows** with enriched context data
504
504
-**Maintain clean separation** between business logic and UI logic
505
505
506
+
# Session Event Bus
507
+
508
+
The SDK provides a lifecycle-aware event bus for session and messaging events. This allows your app to react to session changes (expiration, refresh, verification) and push notifications across your entire application in a decoupled, type-safe manner.
509
+
510
+
## Event Types
511
+
512
+
### Session Events
513
+
514
+
**Core Session Events (Always Available):**
515
+
-`SessionEvent.SessionExpired` - Session has expired
516
+
-`SessionEvent.SessionRefreshed` - Session was successfully refreshed
⚠️ **Note:** Session validation adds periodic background checks to ensure session validity. Only enable if your app requires this level of session monitoring.
539
+
540
+
### Message Events
541
+
542
+
Push notification and Firebase messaging events:
543
+
-`MessageEvent.TokenReceived` - FCM token received
544
+
-`MessageEvent.RemoteMessageReceived` - Push notification received
⚠️ **Initialization:** Call `CDCEventBusProvider.initialize()` once in your app (e.g., in MainActivity or Application class)
715
+
716
+
⚠️ **Manual Subscriptions:** Always call `unsubscribe()` on manual subscriptions to prevent memory leaks
717
+
718
+
⚠️ **Thread Safety:** Event handlers run on background threads (IO dispatcher) for manual subscriptions. Use appropriate dispatchers for UI updates.
719
+
720
+
⚠️ **Validation Events:** Only subscribe to validation events if you've enabled session validation via `registerForSessionValidation()`
721
+
506
722
# Social Provider Authentication
507
723
508
724
The SDK provides a flexible system for integrating social login providers (Google, Facebook, WeChat, Line, etc.) through the `IAuthenticationProvider` interface. The SDK is **intentionally decoupled** from third-party social SDKs, allowing you to use any version of social provider SDKs without compatibility issues.
0 commit comments