Initialization

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:

589
  • channelKey is an alphanumeric string that identifies your indigitall project.

Chat actions

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
  }
}