Skip to content

Commit c77afd4

Browse files
docs(SDK-549): document logout() as native logoutUser equivalent
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e0b46ae commit c77afd4

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

‎src/core/classes/Iterable.ts‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,27 @@ export class Iterable {
941941
/**
942942
* Logs out the current user from the Iterable SDK.
943943
*
944-
* This method will remove all event listeners for the Iterable SDK and set the email and user ID to null.
944+
* This is the React Native equivalent of native `logoutUser`. There is no
945+
* dedicated bridged `logoutUser` method. `logout()` removes JS event
946+
* listeners and clears identity via `setEmail(null)` and `setUserId(null)`,
947+
* which triggers the native logout cleanup on both platforms.
948+
*
949+
* Native cleanup includes:
950+
* - resetting the auth manager
951+
* - resetting the in-app (and embedded) manager
952+
* - disabling the current push token when
953+
* `IterableConfig.autoPushRegistration` is `true`
954+
*
955+
* Both identity-clears are required. On iOS, `setEmail(null)` is a no-op
956+
* when the user is identified only by userId, and `setUserId(null)` is a
957+
* no-op when the user is identified only by email. Android has no public
958+
* `logoutUser`; private `logoutPreviousUser()` runs as part of identity
959+
* clear.
960+
*
961+
* iOS `logoutUser(withOnSuccess:onFailure:)` is not exposed.
962+
*
963+
* Calling `logout()` when no user is signed in is safe: listeners are
964+
* removed and native identity-clear is effectively a no-op.
945965
*
946966
* @example
947967
* ```typescript

0 commit comments

Comments
 (0)