# IMbeeUI

### What is it? <a href="#what-is-it" id="what-is-it"></a>

**IMbeeUI** is a library that implements a rich chat-room view which makes straightforward integrating a chat window to your existing app.

### Integration <a href="#integration" id="integration"></a>

{% hint style="info" %}
IMbee SDK is private. Contact with [IMbee Messenger](http://imbeemessenger.com/) to get more details.
{% endhint %}

You only need to add `IMbeeCore.framework` and `IMbeeUI.framework` into 'Embedded Binaries'. Then `pod install` dependencies from `Podfile`.

Then, you have to configure `IMbeeCore` with your credentials (checkout [example code](https://docs.imbee.me/ios/imbee-core/#basic-setup)).

Finally, you only have to present the chat window when you want. See [examples](https://docs.imbee.me/ios/imbee-ui/#examples) section below.

### Examples <a href="#examples" id="examples"></a>

```swift
#import <IMbeeUI/IMbeeUI.h>
#import <IMbeeCore/IMbeeCore.h>

// ...

- (IBAction)presentChatRoom:(id)sender {
    Conversation *conv = [[IMbeeCore conversations] conversationWithWoowosId:@"190ab...cd874"];

    IMMessageListVC *vc = [IMbeeUI presentConversation:conv
                                              intoView:self.contr
                                      onViewController:self];

    [vc setMessageDelegate:self];
}

- (void)buttonPressed:(ButtonContentPart *)button onMessage:(Message *)message
{
    if ([button.type isEqualToString:@"url"]) {
        NSURL *url = [NSURL URLWithString:button.payload];

        if (url)
            [[UIApplication sharedApplication] openURL:url];
    }
}
```

### UI Customization <a href="#ui-customization" id="ui-customization"></a>

Customize colors, radius ...

```
[IMbeeUI setPrimaryColor:[UIColor colorWithR:0 G:0x9a B:0xd8 A:1]];
[IMbeeUI setRightMessageBackgroundColor:[UIColor colorWithR:0 G:0x9a B:0xd8 A:1]];
[IMbeeUI setRightMessageTextColor:[UIColor whiteColor]];
[IMbeeUI setLeftMessageBackgroundColor:[UIColor colorWithR:0xe5 G:0xf4 B:0xfb A:1]];
[IMbeeUI setLeftMessageTextColor:[UIColor blackColor]];
[IMbeeUI setMessageRadius:12];
```

Icons customization

```
IMMessageListVC *vc = ...;

[vc setRightButtonImage:[UIImage imageNamed:@"CustomSendButton"]];
```


---

# 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://docs.imbee.me/imbee-docs/apps/ios-sdk/imbeeui.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.
