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.
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))
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))
Objective-C
[ALApplozicSettings setChatWallpaperImageName:@"<WALLPAPER NAME>"];
Swift
ALApplozicSettings.setChatWallpaperImageName("<WALLPAPER NAME>")
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")
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.
Objective-C
[ALApplozicSettings setGroupExitOption:YES];
Swift
ALApplozicSettings.setGroupExitOption(true)
Objective-C
[ALApplozicSettings setGroupMemberAddOption:YES];
Swift
ALApplozicSettings.setGroupMemberAddOption(true)
Objective-C
[ALApplozicSettings setGroupMemberRemoveOption:YES];
Swift
ALApplozicSettings.setGroupMemberRemoveOption(true)
Objective-C
[ALApplozicSettings setGroupInfoDisabled:YES];
Swift
ALApplozicSettings.setGroupInfoDisabled(true)
Objective-C
[ALApplozicSettings setGroupInfoEditDisabled:YES];
Swift
ALApplozicSettings.setGroupInfoEditDisabled(true)
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))
Objective-C
[ALApplozicSettings setColorForNavigationItem: [UIColor whiteColor]];
Swift
ALApplozicSettings.setColorForNavigationItem(UIColor.whiteColor())
Objective-C
[ALUserDefaultsHandler setBottomTabBarHidden: YES];
Swift
ALUserDefaultsHandler.setBottomTabBarHidden(true)
Objective-C
[ALApplozicSettings setFontaFace: @"Helvetica"];
Swift
ALApplozicSettings.setFontFace("Helvetica")
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" ="اكتب رسالة...;
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)
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.
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