iOS Custom UI Quickstart

A quick start guide for creating your own UI using Custom UI APIs present in the Applozic iOS SDK. Using custom UI APIs, you can implement your own designs with your custom workflows.

In just three steps, we'll go from framework installation to sending a message.

1. Installation

The first step is installing the Applozic framework.
There are different ways to do it. Check out the detailed steps for installation here. Our preferred way of installation is Cocoapods.

If you install using CocoaPods then just add the below code in apps podfile and run pod install.

target 'MyTargetName' do
    pod 'ApplozicCore'

2. Authentication

Before sending a message, we need to authenticate the user. It's a two-step process:

First, initialise the SDK with the App ID as shown below. For more details check out the Setup section. Your App ID can be found here---> App ID

@import ApplozicCore

@property (strong, nonatomic) ApplozicClient *applozicClient;
// Call it only once in your app.
self.applozicClient = [[ApplozicClient alloc]initWithApplicationKey:@"<APP_ID>" withDelegate:self]; // Replace this with your App ID
import ApplozicCore
 var applozicClient : ApplozicClient?

// Call it only once in your app.
applozicClient = ApplozicClient(applicationKey: "applozic-sample-app", with: self) as ApplozicClient // Replace this with your App ID

The second step is to register the user as shown below. For more details check out the Registration section. Here a unique user Id will be used for each user.

ALUser *user = [[ALUser alloc] init];
user.userId = @"USER-ID"; // NOTE : +,*,? are not allowed chars in userId.
user.password = @"USER-PASSWORD"; // User password
user.displayName = @"USER-DISPLAY-NAME"; // User's Display Name = @"EMAIL-ID"; // User email Id
user.imageLink = @""; // Pass Profile image URL link
user.authenticationTypeId = APPLOZIC; // Authentication type id default is APPLOZIC
[ALUserDefaultsHandler setUserAuthenticationTypeId:user.authenticationTypeId];
  [self.applozicClient loginUser:user withCompletion:^(ALRegistrationResponse *response, NSError *error) {
        if (!error) {
            NSLog(@"Login success");
let user = ALUser()
user.userId = "USER-ID" // NOTE : +,*,? are not allowed chars in userId.
user.password = "PASSWORD" // Pass the password
user.displayName = "USER-DISPLAY-NAME"  // User's Display Name
user.imageLink = ""  // User's profile image link. = "EMAIL-ID" // User email Id
user.authenticationTypeId = Int16(APPLOZIC.rawValue)  // Authentication type id default is APPLOZIC

  applozicClient?.loginUser(user, withCompletion: { response, error in
      if error == nil {
          print("Login success")

3. Send a Message

The logged in user can send a message to another user or in a group. In this guide, we will see how it works in case of sending a message to another user. For a detailed explanation check out Message API section.

It's a single call where we need to pass the userId and the message that we need to send. As we are just trying out the APIs, we can send a message to a test user, in your app first you will have to register the user to whom you want to send a message and you can show them as a list of contacts to the sender. Check the Contacts section to learn more about creating and fetching contacts.

// Message builder
ALMessage *alMessage = [ALMessage build:^(ALMessageBuilder * alMessageBuilder) { = @"testId"; //Replace this later message
        alMessageBuilder.message = @"Test message";    
// Pass an `ALMessage` object to this method.
[self.applozicClient sendTextMessage:alMessage withCompletion:
 ^(ALMessage *message, NSError *error) {
        NSLog("Success: Message sent 🎉");
// Message builder
let alMessage ={ alMessageBuilder in
        guard let messageBuilder = alMessageBuilder else { return } = "testId" //Replace this later
        messageBuilder.message = "Test message"

// Pass an `ALMessage` object to this method.
applozicClient?.sendTextMessage(alMessage, withCompletion: { (alMessage, error) in       
    if(error == nil){
        print("Success: Message sent 🎉")

Run the above code to test if the message is sent. In case of an error, the error param will have the error details.

Here's a list of some other relevant sections that you might need:

  • For fetching a list of conversations: Conversation section.
  • To get Real-time updates on a message received, read or if the other user is typing: Real-time updates section. In this section, we have also explained how to send typing status if the logged in user is typing. To receive app notifications Push notification setup is required.
  • To update user details like display name, image etc. after the user has been registered check out Update user details section.
  • For creating a group, adding users and updating the group details check out Groups section.

Sample App

You can check out the sample app where we have used iOS Custom UI APIs to show some of the SDK features.



If you have any doubts or you are facing any issue in integration then you can check out our support page for help.

Did this page help you?