# 1.29.1 -> 1.30.0

## Migrating your code

### Setting Identity

**API Complete Redesign**

* **Old** :

  ```kotlin
  fun setIdentity(context: Context, identity: Identity?):MutableStateFlow<Result<Unit>>
  ```
* **New** :

  ```swift
  suspend fun setIdentity(context: Context, identity: Identity): Result<Unit>
  ```

  * Changed from callback-based (StateFlow) to suspend function approach
  * Identity parameter is now non-null
  * Removed StateFlow-based Identity Management
    * Returns `Result<Unit>` directly instead of `MutableStateFlow<Result<Unit>>`
  * Removed `currentIdentity: StateFlow<Identity?>`

```kotlin
**Before:**
val identityFlow = ImsSdkManager.setIdentity(context, identity)
identityFlow.collect { result ->
    when {
        result.isSuccess -> // Handle success
        result.isFailure -> // Handle failure
    }
}

**After:**
// In a coroutine
val result = ImsSdkManager.setIdentity(context, identity)
when {
    result.isSuccess -> // Handle success
    result.isFailure -> // Handle failure, identity automatically cleared
}
```

### Clearing identity

While logging out the user, it was possible to use setIdentity with a null value to clear identity. From now on, there is a mandatory `clearIdentity` call for logging out the user.

When logging out please use the following method

```kotlin
**Before:**
ImsSdkManager.setIdentity(context, null)

**After:**
ImsSdkManager.clearIdentity(context)
```

### Removed fields and methods

The following methods/getter have been removed

* `ImsSdkManager.updateSdkConfig(Context)`
* `SdkConfigBuilder.apiKey`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sdk.ims.tech/migration-notes/android/1.29.1-greater-than-1.30.0.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
