Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/core/classes/Iterable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading