From c77afd48a6d3d8d65676f4edaa6db93b11ff5328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ferr=C3=A3o?= Date: Sat, 12 Sep 2026 07:26:04 +0100 Subject: [PATCH] docs(SDK-549): document logout() as native logoutUser equivalent Co-authored-by: Cursor --- src/core/classes/Iterable.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/core/classes/Iterable.ts b/src/core/classes/Iterable.ts index aaaa84073..3716f6277 100644 --- a/src/core/classes/Iterable.ts +++ b/src/core/classes/Iterable.ts @@ -941,7 +941,27 @@ export class Iterable { /** * Logs out the current user from the Iterable SDK. * - * This method will remove all event listeners for the Iterable SDK and set the email and user ID to null. + * This is the React Native equivalent of native `logoutUser`. There is no + * dedicated bridged `logoutUser` method. `logout()` removes JS event + * listeners and clears identity via `setEmail(null)` and `setUserId(null)`, + * which triggers the native logout cleanup on both platforms. + * + * Native cleanup includes: + * - resetting the auth manager + * - resetting the in-app (and embedded) manager + * - disabling the current push token when + * `IterableConfig.autoPushRegistration` is `true` + * + * Both identity-clears are required. On iOS, `setEmail(null)` is a no-op + * when the user is identified only by userId, and `setUserId(null)` is a + * no-op when the user is identified only by email. Android has no public + * `logoutUser`; private `logoutPreviousUser()` runs as part of identity + * clear. + * + * iOS `logoutUser(withOnSuccess:onFailure:)` is not exposed. + * + * Calling `logout()` when no user is signed in is safe: listeners are + * removed and native identity-clear is effectively a no-op. * * @example * ```typescript