Finally, you only have to present the chat window when you want. See section below.
#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];
}
}
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];
IMMessageListVC *vc = ...;
[vc setRightButtonImage:[UIImage imageNamed:@"CustomSendButton"]];