Skip to content

Installation with Objective C

soyombo edited this page May 19, 2020 · 9 revisions

Installation

1. Add "ENV['SWIFT_VERSION'] = '5'" on top of your podfile then add 'ErxesSdk' to your podfile and run pod install

use_modular_headers!

target '<Your Target Name>' do
    pod 'ErxesSDK'
end
Don't forget to put use_modular_headers! at top of the Podfile in objective-c projects

2. Config basic properties of ErxesSDK in your AppDelegate

  • brandCode - generated unique code of your brand
  • apiHost - erxes-api server url
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [Erxes setupWithErxesApiUrl:@"erxesApiUrl" brandId:@"brandCode"];
    return YES;
}

3. Start chat

Just call this function inside your own trigger function

- (IBAction)btnClick:(id)sender {
    [Erxes start];
}

If your application has already registered user provide info with this function