Applozic's LOGO

Official iOS SDK for Chat :speech_balloon:

Platform Platform GitHub repo size GitHub contributors GitHub stars Twitter Follow

Introduction :cyclone:

Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emerging startups and established companies with the most scalable and powerful chat APIs, enabling application product teams to drive better user engagement, and reduce time-to-market.

Customers and developers from over 50+ countries use us and love us, from online marketplaces and eCommerce to on-demand services, to Education Tech, Health Tech, Gaming, Live-Streaming, and more.

Our feature-rich product includes robust client-side SDKs for iOS, Android, React Native, and Flutter. We also support popular server-side languages, a beautifully customizable UI kit, and flexible platform APIs.

Chat, video, and audio-calling have become the new norm in the post-COVID era, and we're bridging the gap between businesses and customers by delivering those exact solutions.

Table of Contents :beginner:

Prerequisites :crystal_ball:

  • Install the following:

  • Make sure that your project meets these requirements:

    • Your project must target iOS 10 or later.
    • Set up a physical or simulator iOS device to run your app
  • Sign-Up or Login to get your Applozic's API key/App Id.

Quick Start :rocket:

Before getting started with installation. We recommend to go through some basic documentation for Applozic iOS Chat & Messaging SDK Documentation :memo:

Setting up Xcode project

  • Open Xcode Create a new project Select App and Click Next
  • Set the Product Name as per your preference (we will name it as applozic-first-app) and click Next and Select folder then Create.

1. Setup

Include the Applozic SDK for iOS in an Existing Application

The iOS Applozic framework can be installed using CocoaPods or Dynamic Frameworks, as you prefer.


Applozic is available through CocoaPods. To install it

  1. Open Terminal
  2. Navigate to the root directory of your Project (the directory where your *.xcodeproj file is)
  3. Run command
pod init

Again go to your Project's root directory, click on the "Podfile" to open. Copy-paste the following code in the file and Save

source ''
use_frameworks!  # Required to add 
platform :ios, '10.0'

target 'TARGET_NAME' do
    pod 'Applozic'  # Required to add 
  1. Go to your project directory where Podfile there run pod install or pod update from terminal to refresh the CocoaPods dependencies.

  2. Open your project newly generated *.xcworkspace or existing and build your project.


XCFramework setup

  1. Download the Applozic latest Chat frameworks from here
  2. Uncompress the ZIP files inside Debug or Release Applozic and ApplozicCore framework.
  3. On your application targets General settings tab, in the Frameworks, libraries, and embedded content, drag and drop each xcframework you want to use from the downloaded folder.
  4. Make sure Always Embed Swift Standard Libraries is YES in the build settings of your project.

Add Permissions

App Store requires any app which accesses camera, contacts, gallery, location, a microphone to add the description of why does your app needs to access these features.

In the Info.plist file of your project. Please add the following permissions

 <string>Allow Camera</string>
 <string>Allow Contacts</string>
 <string>Allow location sharing!!</string>
 <string>Allow MicroPhone</string>
 <string>Allow Photos</string>
 <string>Allow write access</string>

Importing Methods for Authentication

The method file that we need here is ALChatManager files.

  1. Download the ALChatManager.h here and ALChatManager.m here
  2. Add the Downloaded ALChatManager.h and ALChatManager.m in your project
  3. Open ALChatManager.h file in your Xcode and Replace "applozic-sample-app" with your App ID from here

2. Register/Login the User

// Creating "ALUser" and Passing user details
// Except UserId all the other parameters are optional

ALUser *alUser = [[ALUser alloc] init];
[alUser setUserId:@"testUser"]; //NOTE : +,*,? are not allowed chars in userId.
[alUser setDisplayName:@"Applozic Test"]; // Display name of user 
[alUser setContactNumber:@""];// formatted contact no
[alUser setImageLink:@"user_profile_image_link"];// User's profile image link.
[alUser setPassword:@"testpassword"]; //Password for the user

//Saving the details
[ALUserDefaultsHandler setUserId:alUser.userId];
[ALUserDefaultsHandler setDisplayName:alUser.displayName];
[ALUserDefaultsHandler setUserAuthenticationTypeId:(short)APPLOZIC];
[ALUserDefaultsHandler setPassword:alUser.password];

// Registering or Loging in the User
 ALChatManager * chatManager = [[ALChatManager alloc] init];
 [chatManager connectUserWithCompletion:alUser withHandler:^(ALRegistrationResponse *rResponse, NSError *error) {
      if (!error) {
        // Applozic registration successful
      } else {
          NSLog(@"Error in Applozic registration : %@",error.description);

3. Push notification

Setting up APNs Certificates

Applozic sends the payload to Apple servers which then sends the Push notification to your user's device.

Creating APNs certificates

For Apple to send these notifications, would have to create an APNs certificate in your Apple developer account.

  1. Visit this link, to create Apple Push Notification service SSL (Sandbox) i.e development certificate


  1. Visit this link, to create Apple Push Notification service SSL (Sandbox & Production) i.e distribution certificate


Once the certificates are created you can download them and export the p12 files with password for development and distribution certificate either from Keychain Acess from Mac.

Upload APNs Certificates

Upload your push notification certificates (mentioned above) to the Applozic console by referring to the below-given image.

Go to Applozic console push notification section to upload the APNs development and distribution certificates


Adding Capabilities to Your App

Add capabilities to configure app services from Apple, such as push notifications, Background modes

  1. On the Xcode projectโ€™s Signing & Capabilities tab, Click (+ Capability) to add โ€œPush Notificationsโ€

  2. Next Click (+ Capability) to add "Background modes" enable this below four options from Background modes

  • "Background fetch"

  • "Remote notifications"

    Following screenshot would be of help.


Configure the push notification in the Appdelegate file of your project.

Add the below imports in the Appdelegate file

#import <Applozic/Applozic.h>
#import <UserNotifications/UserNotifications.h>
Handling app launch on notification click and register remote notification for APNs

Add the following code in AppDelegate.m class, this function will be called after the app launch to register for push notifications.

// UNUserNotificationCenterDelegate are required for APNs call backs please add this delegate to your AppDelegate file 
@interface AppDelegate () <UNUserNotificationCenterDelegate>


// didFinishLaunchingWithOptions method of your app

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    // checks wheather app version is updated/changed then makes server call setting VERSION_CODE
    [ALRegisterUserClientService isAppUpdated];

    // Register APNs and Push kit
    [self registerForNotification];

    // Register for Applozic notification tap actions and network change notifications
    ALAppLocalNotifications *localNotification = [ALAppLocalNotifications appLocalNotificationHandler];
    [localNotification dataConnectionNotificationHandler];
    ALPushNotificationHandler *pushNotificationHandler = [ALPushNotificationHandler shared];
    [pushNotificationHandler dataConnectionNotificationHandler];

    // Override point for customization after application launch.
    NSLog(@"launchOptions: %@", launchOptions);
    if (launchOptions != nil) {
        NSDictionary *dictionary = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
        if (dictionary != nil) {
            NSLog(@"Launched from push notification: %@", dictionary);
            ALPushNotificationService *pushNotificationService = [[ALPushNotificationService alloc] init];
            BOOL applozicProcessed = [pushNotificationService processPushNotification:dictionary updateUI:[NSNumber numberWithInt:APP_STATE_INACTIVE]];

            //IF not a appplozic notification, process it
            if (!applozicProcessed) {
                //Note: notification for app

    return YES;

// Register APNs

    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
    center.delegate = self;
    [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error)
            dispatch_async(dispatch_get_main_queue(), ^ {
                [[UIApplication sharedApplication] registerForRemoteNotifications];  // required to get the app to do anything at all about push notifications
                NSLog(@"Push registration success." );
            NSLog(@"Push registration FAILED" );
            NSLog(@"ERROR: %@ - %@", error.localizedFailureReason, error.localizedDescription );
            NSLog(@"SUGGESTIONS: %@ - %@", error.localizedRecoveryOptions, error.localizedRecoverySuggestion );

Sending an APNs device token to applozic server

Add the below code in your Appdelegate file if any of these methods already exist then you can copy-paste the code from the below methods.

// APNs device token sending to applozic

- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)
deviceToken {

    const unsigned *tokenBytes = [deviceToken bytes];
    NSString *hexToken = [NSString stringWithFormat:@"%08x%08x%08x%08x%08x%08x%08x%08x",
                          ntohl(tokenBytes[0]), ntohl(tokenBytes[1]), ntohl(tokenBytes[2]),
                          ntohl(tokenBytes[3]), ntohl(tokenBytes[4]), ntohl(tokenBytes[5]),
                          ntohl(tokenBytes[6]), ntohl(tokenBytes[7])];

    NSString *apnDeviceToken = hexToken;
    NSLog(@"apnDeviceToken: %@", hexToken);

    if (![[ALUserDefaultsHandler getApnDeviceToken] isEqualToString:apnDeviceToken]) {
        ALRegisterUserClientService *registerUserClientService = [[ALRegisterUserClientService alloc] init];
        [registerUserClientService updateApnDeviceTokenWithCompletion
         :apnDeviceToken withCompletion:^(ALRegistrationResponse
                                          *rResponse, NSError *error) {

            if (error) {
            NSLog(@"Registration response%@", rResponse);

Receiving push notification

Once your app receives notification, pass it to the Applozic handler for chat notification processing.

// UNUserNotificationCenter delegates for chat
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification*)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
    ALPushNotificationService *pushNotificationService = [[ALPushNotificationService
                                                           alloc] init];
    NSDictionary *userInfo = notification.request.content.userInfo;
    NSLog(@"APNS willPresentNotification for userInfo: %@", userInfo);

    if ([pushNotificationService isApplozicNotification:userInfo]) {
        [pushNotificationService notificationArrivedToApplication:[UIApplication sharedApplication] withDictionary:userInfo];

- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(nonnull UNNotificationResponse* )response withCompletionHandler:(nonnull void (^)(void))completionHandler {

    ALPushNotificationService *pushNotificationService = [[ALPushNotificationService
                                                           alloc] init];
    NSDictionary *userInfo =  response.notification.request.content.userInfo;
    NSLog(@"APNS didReceiveNotificationResponse for userInfo: %@", userInfo);

    if ([pushNotificationService isApplozicNotification:userInfo]) {
        [pushNotificationService notificationArrivedToApplication:[UIApplication sharedApplication] withDictionary:userInfo];

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{

    ALPushNotificationService *pushNotificationService = [[ALPushNotificationService alloc] init];
    if ([pushNotificationService isApplozicNotification:userInfo]) {
        [pushNotificationService notificationArrivedToApplication:application withDictionary:userInfo];

- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.

    [[ALDBHandler sharedInstance] saveContext];

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.

    [application setApplicationIconBadgeNumber:0];

4. Launch chat list

Implement the following code at the event or Button action designated for showing chat list screen.

ALChatManager * chatManager = [[ALChatManager alloc] init];
[chatManager launchChat:self];

5. Logout user

On logout of your app you need to logout the applozic user as well use the below method to logout the user:

ALRegisterUserClientService *registerUserClientService = [[ALRegisterUserClientService alloc] init];
[registerUserClientService logoutWithCompletionHandler:^(ALAPIResponse *response, NSError *error) {
    if(!error && [response.status isEqualToString:@"success"]) {
        NSLog(@"Logout success");
    } else {
        NSLog(@"Logout failed with response : %@",response.response);

Announcements :loudspeaker:

All updates to this library are documented in our releases. For any queries, feel free to reach out us at

Roadmap :vertical_traffic_light:

If you are interested in the future direction of this project, please take a look at our open issues and pull requests.
We would :heart: to hear your feedback.

Features :confetti_ball:

  • One to one and Group Chat
  • Image capture
  • Photo sharing
  • Location sharing
  • Push notifications
  • In App notifications
  • Online presence
  • Last seen at
  • Unread message count
  • Typing indicator
  • Message sent
  • Read Recipients and Delivery report
  • Offline messaging
  • User block/unblock
  • Multi Device sync
  • Application to user messaging
  • Customized chat bubble
  • UI Customization Toolkit
  • Cross Platform Support(iOS,Android&Web)

About & Help/Support :rainbow:

We provide support over at StackOverflow when you tag using applozic, ask us anything.

License :heavy_check_mark:

This code library fully developed and supported by Applozic's team of contributors:sunglasses: and licensed under the BSD-3 Clause License.

Applozic IOS Sdk

Official Applozic's iOS SDK for Real-Time Chat & Messaging.

Applozic IOS Sdk Info

โญ Stars110
๐Ÿ”— Source
๐Ÿ•’ Last Updatea year ago
๐Ÿ•’ Created7 years ago
๐Ÿž Open Issues0
โž— Star-Issue RatioInfinity
๐Ÿ˜Ž AuthorAppLozic