> ## Documentation Index
> Fetch the complete documentation index at: https://support.getskara.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS SDK - Configuration

Track who your users are and what they do in your mobile app and customize the Skara Messenger.

Here’s how to configure Skara Chat for iOS:

* [Update your User](#update-your-user)
* [Submit an Event](#submit-an-event)
* [Create a Custom Launcher](#create-a-custom-launcher)

### Update your User

* When you call a login method we create a user with his basic detail, if you want to change his basic detail then you can use update user functionality as per the below code snippet:

```swift theme={null}
let email = "user@example.com"
let firstName = "John"
let lastName = "Doe"
let userId = "unique-user-id" // Unique ID recommended

SalesmateChat.update(userId: userId, email: email, firstName: firstName, lastName: lastName) { success, error in
    if error == nil {
        // Update successfully
    } else {
        // Update error
    }
}
```

### Submit an Event

* You can log events in Skara Chat SDK that record what users do in your app and when they do it. For example, you could record the item a user contact from your mobile app, and when they contact it.

**Objective-C**

```objc theme={null}
[SalesmateChat logEventWithEventName:@"contact_item" 
                            withData:@{
    @"created_date": @1260016272,
    @"contact_id": @"011",
    @"contact_detail": @{
        @"first_name": @"John",
        @"last_name": @"Smith"
    }
}];
```

**Swift**

```
SalesmateChat.logEventWith(
    eventName: "contact_item",
    withData: [
        "created_date": 1260016272,
        "contact_id": "011",
        "contact_detail": [
            "first_name": "John",
            "last_name": "Smith"
        ]
    ]
)
```

### Create a Custom Launcher

* However, if you’d like Messenger to open from another location in your mobile app, you can create a custom launcher. This allows you to specify a button, link, or element that opens Messenger. For example, you can trigger the launcher to open when a customer clicks on your ‘Ask for support’ button.

![Custom Launcher](https://quip.com/blob/TZEAAA8WD3W/ioJmS_q4oPPr_4K0u37iAw?a=7i9Mac3ZudcwqqPO5yKvvKEKH44zbFfP1fKbDvviMmka)

* If you have a custom launcher, you can call:

**Objective-C**

```objc theme={null}
- (IBAction)presentMessenger:(id)sender {
    [SalesmateChat presentMessengerFrom:self];
}
```

**Swift**

```swift theme={null}
@IBAction func presentMessenger(_ sender: UIButton) {
    SalesmateChat.presentMessenger(from: self)
}
```
