Quickstart
This guide helps you integrate Chat UI iOS into your app. You'll learn how to import the SDK, initialize it, connect users, display channel lists and message views, and test message delivery.
Requirements
- iOS app targeting iOS 13.0 or later
- Valid App Key for your target environment
- User access token generated by your app server
- User and group profile data (or managed info service) for displaying names and avatars
Before you start
- Register a developer account on Nexconn Console (registration creates a development app automatically)
- Copy the development App Key from Key Management
- Obtain an access token for your test user from your app server
- Prepare display data for users and groups
Development and production environments use separate App Keys with isolated data. Switch to your production App Key before app release.
Import the SDK
Chat UI iOS supports CocoaPods and Swift Package Manager. This guide uses CocoaPods. See Import the SDK for all options.
- Objective-C
- Swift
#import <NexconnChatSDK/NexconnChatSDK.h>
#import <NexconnChatUI/NexconnChatUI.h>
import NexconnChatSDK
import NexconnChatUI
Initialize the SDK
Initialize NCChatUI before using any SDK features. The NCInitParams configuration includes:
appKey: Your application identifierareaCode: Data center location. The default is Singapore (NCAreaCodeSg/.sg).naviServer: Custom navigation server address. Set it only for private navigation environments.crashMonitorEnabled: Error reporting togglelogLevel: Debug output level
The SDK defaults to Singapore. Set areaCode explicitly when your App Key belongs to another data center. Configure naviServer only when your environment requires a private navigation server.
- Objective-C
- Swift
NSString *appKey = @"Your_AppKey";
NCInitParams *params = [[NCInitParams alloc] initWithAppKey:appKey];
params.areaCode = NCAreaCodeSg; // Set this to your App Key's data center.
// params.naviServer = @"https://your-navi-server.example.com"; // Private navigation only.
[[NCChatUI shared] initializeWithParams:params];
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let params = NCInitParams(appKey: "Your_AppKey")
params.areaCode = .sg // Set this to your App Key's data center.
// params.naviServer = "https://your-navi-server.example.com" // Private navigation only.
NCChatUI.shared().initialize(with: params)
return true
}
For advanced initialization options, see Initialize the SDK.
Find your App Key and data center in Nexconn Console under Service Management.
Get an access token
Access tokens authenticate individual users. Your app server must:
- Request tokens from Nexconn Server API
- Securely deliver them to client devices
For testing, use the API Debugger to generate tokens via the Register User endpoint.
Never request tokens directly from client code. This would expose your App Secret through decompilation.
Connect to chat service
Establish a connection before using messaging features:
-
Add connection status monitoring:
- Objective-C
- Swift
Objective C[[NCChatUI shared] addConnectionStatusDelegate:self];swiftfinal class ChatCoordinator: NSObject, NCChatUIConnectionStatusDelegate {
override init() {
super.init()
NCChatUI.shared().addConnectionStatusDelegate(self)
}
func onNCChatUIConnectionStatusChanged(_ status: NCConnectionStatus) {
// Handle connection state changes
}
} -
Connect with user credentials:
- Objective-C
- Swift
Objective CNCConnectParams *connectParams = [[NCConnectParams alloc] initWithToken:@"Your_Token"];
connectParams.timeout = 30;
[[NCChatUI shared] connectWithParams:connectParams
databaseOpenedHandler:^(BOOL isRecreated, NCError * _Nullable error) {
// Local database ready
} completionHandler:^(NSString * _Nullable userId, NCError * _Nullable error) {
if (userId.length > 0) {
// Connection successful
}
}];swiftfunc connectChatUI() {
let params = NCConnectParams(token: "Your_Token")
params.timeout = 30
NCChatUI.shared().connect(
with: params,
databaseOpenedHandler: { isRecreated, error in
// Local database ready
},
completionHandler: { userId, error in
if let userId = userId {
// Connection successful
}
}
)
} -
Configure user profile:
- Objective-C
- Swift
Objective CNCChatUIUserInfo *currentUser = [[NCChatUIUserInfo alloc] init];
currentUser.userId = @"user_001";
currentUser.name = @"Ava";
currentUser.avatarUrl = @"https://example.com/avatar.png";
[NCChatUI shared].currentUserInfo = currentUser;
[NCChatUI shared].userInfoDataSource = self;
[NCChatUI shared].groupInfoDataSource = self;swiftlet currentUser = NCChatUIUserInfo()
currentUser.userId = "user_001"
currentUser.name = "Ava"
currentUser.avatarUrl = "https://example.com/avatar.png"
NCChatUI.shared().currentUserInfo = currentUser
NCChatUI.shared().userInfoDataSource = self
NCChatUI.shared().groupInfoDataSource = self
Display channel list
Use the built-in NCChannelListViewController to show channels. This example filters for direct, group, and system channels:
- Objective-C
- Swift
@interface AppChannelListViewController : NCChannelListViewController
@end
NSArray *displayChannelTypes = @[
@(NCChannelTypeDirect),
@(NCChannelTypeGroup),
@(NCChannelTypeSystem)
];
AppChannelListViewController *channelListVC =
[[AppChannelListViewController alloc] initWithDisplayConversationTypes:displayChannelTypes];
[self.navigationController pushViewController:channelListVC animated:YES];
final class AppChannelListViewController: NCChannelListViewController {
}
func openChannelList() {
let displayChannelTypes = [
NSNumber(value: NCChannelType.direct.rawValue),
NSNumber(value: NCChannelType.group.rawValue),
NSNumber(value: NCChannelType.system.rawValue),
]
let channelListViewController =
AppChannelListViewController(displayConversationTypes: displayChannelTypes)
navigationController?.pushViewController(channelListViewController, animated: true)
}
The SDK provides the channel list view only. Implement search, tabs, and other UI elements in your app.
For profile display, either:
- Implement the info data sources
- Enable the Managed info service

Open channel view
The SDK includes NCChannelViewController for messaging. Handle channel selection in your list view subclass:
- Objective-C
- Swift
- (void)onSelectedTableRow:(NCChannelModelType)conversationModelType
conversationModel:(NCChannelModel *)model
atIndexPath:(NSIndexPath *)indexPath {
NCChannelViewController *channelVC =
[[NCChannelViewController alloc] initWithChannelType:model.channelType
channelId:model.channelId];
channelVC.title = model.conversationTitle ?: @"Channel";
[self.navigationController pushViewController:channelVC animated:YES];
}
override func onSelectedTableRow(
_ conversationModelType: NCChannelModelType,
conversationModel model: NCChannelModel,
at indexPath: IndexPath
) {
let channelViewController = NCChannelViewController(
channelType: model.channelType,
channelId: model.channelId
)
channelViewController.title = model.conversationTitle ?? "Channel"
navigationController?.pushViewController(channelViewController, animated: true)
}
Test messaging
For direct messaging testing:
- Use
userIdas thechannelId - Send a test message from your server
- Verify message receipt in the iOS app
- Send a reply from the app
Next steps
Explore these features: