Skip to content

Latest commit

 

History

History
326 lines (227 loc) · 8.69 KB

CUSTOMIZATION-DOC.md

File metadata and controls

326 lines (227 loc) · 8.69 KB

Applozic SDK provides various UI settings to customise chat view easily. If you are using ALChatManager.h explained in the earlier section, you can put all your settings in below method.

-(void)ALDefaultChatViewSettings;

If you have your own implementation, you should set UI Customization setting on successfull registration of user.

Below section explains UI settings provided by Applozic SDK.

Chat Bubble

Received Message bubble color

Objective-C

[ALApplozicSettings setColorForReceiveMessages: [UIColor colorWithRed:255.0/255 green:255.0/255 blue:255.0/255 alpha:1]];

Swift

ALApplozicSettings.setColorForReceiveMessages(UIColor(red: 255/255, green: 255/255, blue: 255/255, alpha:1))
Send Message bubble color

Objective-C

[ALApplozicSettings setColorForSendMessages: [UIColor colorWithRed:66.0/255 green:173.0/255 blue:247.0/255 alpha:1]];

Swift

ALApplozicSettings.setColorForSendMessages(UIColor(red: 66.0/255, green: 173.0/255, blue: 247.0/255, alpha:1))

Chat Background

Objective-C

[ALApplozicSettings setChatWallpaperImageName:@"<WALLPAPER NAME>"];

Swift

ALApplozicSettings.setChatWallpaperImageName("<WALLPAPER NAME>")

Chat Screen

Hide/Show profile Image

Objective-C

[ALApplozicSettings setUserProfileHidden: NO];

Swift

ALApplozicSettings.setUserProfileHidden(false)

Hide/Show Refresh Button

Objective-C

[ALApplozicSettings hideRefreshButton: NO];

Swift

ALApplozicSettings.hideRefreshButton(flag)

Chat Title

Objective-C

[ALApplozicSettings setTitleForConversationScreen: @"Recent Chats"];

Swift

ALApplozicSettings.setTitleForConversationScreen("Recent Chats")

Group Messaging

Objective-C

[ALApplozicSettings setGroupOption: YES];

Swift

ALApplozicSettings.setGroupOption(true)

This method is used when group feature is required . It will disable group functionality when set to NO.

Show/Hide Group Exit Button

Objective-C

[ALApplozicSettings setGroupExitOption:YES];

Swift

ALApplozicSettings.setGroupExitOption(true)
Show/Hide Group Member-Add Button (Admin only)

Objective-C

[ALApplozicSettings setGroupMemberAddOption:YES];

Swift

ALApplozicSettings.setGroupMemberAddOption(true)
Show/Hide Group Member-Remove Button (Admin only)

Objective-C

[ALApplozicSettings setGroupMemberRemoveOption:YES];

Swift

ALApplozicSettings.setGroupMemberRemoveOption(true)
Disable GroupInfo (Tap on group Title)

Objective-C

[ALApplozicSettings setGroupInfoDisabled:YES];

Swift

ALApplozicSettings.setGroupInfoDisabled(true)
Disable GroupInfoEdit (Edit group name and image)

Objective-C

[ALApplozicSettings setGroupInfoEditDisabled:YES];

Swift

 ALApplozicSettings.setGroupInfoEditDisabled(true)

Theme Customization

Set Colour for Navigation Bar

Objective-C

[ALApplozicSettings setColorForNavigation: [UIColor colorWithRed:66.0/255 green:173.0/255 blue:247.0/255 alpha:1]];

Swift

ALApplozicSettings.setColorForNavigation(UIColor(red: 66.0/255, green: 173.0/255, blue: 247.0/255, alpha:1))
Set Colour for Navigation Bar Item

Objective-C

[ALApplozicSettings setColorForNavigationItem: [UIColor whiteColor]];

Swift

ALApplozicSettings.setColorForNavigationItem(UIColor.whiteColor())
Hide/Show Tab Bar

Objective-C

[ALUserDefaultsHandler setBottomTabBarHidden: YES];

Swift

ALUserDefaultsHandler.setBottomTabBarHidden(true)
Set Font Face

Objective-C

[ALApplozicSettings setFontaFace: @"Helvetica"];

Swift

ALApplozicSettings.setFontFace("Helvetica")

Localization

1)You can get the localisation file from this link Localizable.strings

2)Then you need to copy text entries from above Localizable.strings in your file with translations for your language.

Example :

"placeHolderText" ="Write a Message...";

Add and change the string values in your app Localizable.strings(arabic)

"placeHolderText" ="اكتب رسالة...;

Container View

Objective-C

// Add this in viewDidLoad to add Applozic as subview:

UIView * containerView = [[UIView alloc] init];
containerView.translatesAutoresizingMaskIntoConstraints = false;
[self.view addSubview:containerView];

[containerView.leadingAnchor constraintEqualToAnchor: self.view.leadingAnchor].active = true;
[containerView.trailingAnchor constraintEqualToAnchor: self.view.trailingAnchor].active = true;
[containerView.topAnchor constraintEqualToAnchor:self.view.topAnchor].active = true;
[containerView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor].active = true;

// Add child view controller view to container
NSBundle * bundle = [NSBundle bundleForClass:ALMessagesViewController.class];
UIStoryboard * storyboard = [UIStoryboard storyboardWithName: @"Applozic" bundle:bundle];
UIViewController * controller = [storyboard instantiateViewControllerWithIdentifier:@"ALViewController"];
[self addChildViewController: controller];
controller.view.translatesAutoresizingMaskIntoConstraints = true;
[containerView addSubview:controller.view];

[controller.view.leadingAnchor constraintEqualToAnchor: containerView.leadingAnchor].active = true;
[controller.view.trailingAnchor constraintEqualToAnchor: containerView.trailingAnchor].active = true;
[controller.view.topAnchor constraintEqualToAnchor:containerView.topAnchor].active = true;
[controller.view.bottomAnchor constraintEqualToAnchor:containerView.bottomAnchor].active = true;

[controller didMoveToParentViewController:self];

Swift

// Add this in viewDidLoad to add Applozic as subview:

let containerView = UIView()
containerView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(containerView)
NSLayoutConstraint.activate([
    containerView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0),
    containerView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 0),
    containerView.topAnchor.constraint(equalTo: view.topAnchor, constant: 0),
    containerView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0),
    ])

// Add child view controller view to container
let story = UIStoryboard(name: "Applozic", bundle: Bundle(for: ALMessagesViewController.self))
let controller = story.instantiateViewController(withIdentifier: "ALViewController")
addChildViewController(controller)
controller.view.translatesAutoresizingMaskIntoConstraints = false
containerView.addSubview(controller.view)

NSLayoutConstraint.activate([
    controller.view.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),
    controller.view.trailingAnchor.constraint(equalTo: containerView.trailingAnchor),
    controller.view.topAnchor.constraint(equalTo: containerView.topAnchor),
    controller.view.bottomAnchor.constraint(equalTo: containerView.bottomAnchor)
    ])

controller.didMove(toParentViewController: self)

Customise Pod

If you have added our SDK using CocoaPods then you should not directly modify our pod. If you modify our pod and later you want to update the pod then all the local changes will be removed.

The right way to do is to fork our repo then clone the repo and do the changes. Once you are done with the changes then push it. Now what you need to do is to use this forked repo in the pod. You need to pass the url of this forked repo.

In your podfile you need to write it in this way:

pod 'Applozic', :path => '<url_of_your_repo>'

then pod install

Later, when you want to update our SDK then just fetch the changes from our repo, and merge the changes to your forked repo. It will be updated.

If you just want to keep your changes locally, then clone the repo and do the changes. In your podfile, pass the path of your local repo.

UI source code

For complete control over UI, you can also download open source chat UI toolkit and change it as per your designs :

https://github.com/AppLozic/Applozic-iOS-SDK

Import Applozic iOS Library into your Xcode project.

Applozic contains the UI related source code, icons, views and other resources which you can customize based on your design needs.

Sample app with integration is available under sampleapp