This website is no longer maintained. Please, visit documentation.indigitall.com to read our updated documentation.
quick integration guide
This article shows the minimum development that must be done to start registering devices and being able to carry out the first push campaigns.
Chat is available through CocoaPods.
CocoaPods is a valid dependency manager for Swift and Objective-C, being the most popular in iOS development.
If you don't have it yet, install CocoaPods . Open your terminal and run the following commands:
$ cd /ROOT/OF/YOUR/PROJECT
$ gem install cocoapods
$ pod init
To integrate the Chat of indigitall it is necessary to add the following dependencies:
Modify the PodFile file of your project and add this code:
target '<YourTarget>' do
pod 'indigitall-ios-chat'
end
Remember : add the corresponding pod of the Chat inside the names of the target that your application has.
Update the CocoaPod repository and install the dependencies from the terminal:
$ pod repo update
$ pod install
Attention : from here you must use .workspace instead of .xcproject to work on the project.
The main difference is that .xcproject is for a single project and .workspace can contain multiple projects.
To initialize the Chat it is necessary to add a UIView object that refers to IndigitallChatView in the Identity Inspector of the side menu, where the Chat will be displayed. We must add the following lines of code:
The following fields are custom. If they are not added, the Chat will show the default values.
To be able to perform actions when the Chat is shown or hidden, you can implement the event handlers or protocols, first you must define the viewController as a delegate and then add the protocol interfaces:
class ViewController: UIViewController, OnChatProtocol{
...
@IBOutlet weak var indigitallChatView: IndigitallChatView!{
didSet{
indigitallChatView.chatProtocol = ChatProtocol.init()
indigitallChatView.chatProtocol.setDelegate(self)
}
}
func onChatShown() {
//Do Something
}
func onChatHidden() {
//Do Something
}
}
@interface ViewController : UIViewController<OnChatProtocol>{
@property (weak, nonatomic) IBOutlet IndigitallChatView *indigitallChatView;
....
}
@implementation ViewController{
- (void) setIndigitallChatView: (IndigitallChatView *)indigitallChatView{
indigitallChatView.chatProtocol = [[ChatProtocol alloc]init];
[indigitallChatView.chatProtocol setDelegate: self];
}
- (void) onChatShown(){
//Do Something
}
- (void) onChatHidden(){
//Do Something
}
}
You can check if the welcome event has been fired with this method:
let isEmitted = IndigitallChat.isWelcomeEmitted()
BOOL isEmitted = [IndigitallChat isWelcomeEmitted];
If you want to send a message custom you can use this method:
IndigitallChat.setCustomEvent("your_event")
[IndigitallChat setCustomEvent:@"your_custom_Event"];
You can also control the action of deleting messages with this method:
IndigitallChat.clearAllMessages()
[IndigitallChat clearAllMessages];
Start automating your communications thanks to our administration API