iOS

The iOS client SDK provides a way of communicating with a Teneo Engine allowing app users to chat with your bot directly from an iOS, tvOS or watchOS application.

The source code and installation instructions can be found on GitHub.

Requirements

  • iOS 11.0+ / macOS 10.13+ / tvOS 12.0+ / watchOS 5.0+
  • Xcode 10.2+
  • Swift 4.2+

Basic Use

Setup

Must be called before calling sendInput or closeSession

do {
    try TieApiService.sharedInstance.setup("BASE_URL", endpoint: "ENDPOINT")
} catch {
    // Handle errors here
}

Send Input

TieApiService.sharedInstance.sendInput({MESSAGE},
                                       parameters: {PARAMETERS},
                                       success: { response in
    // Handle response. Remember to dispatch to main thread if updating UI
}, failure: { error in
    // Handle error
})

Close Session

TieApiService.sharedInstance.closeSession({ response in
    // Handle response. Remember to dispatch to main thread if updating UI
}, failure { error in
    // Handle error
})

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.5+ is required to build TieApiClient 1.1.1+.

To integrate TieApiClient into your Xcode project using CocoaPods, specify it in your Podfile:

pod "TieApiClient"

Then, run the following command:

$ pod install

License

TieApiClient is released under the Apache License, Version 2.0. See LICENSE for details.

Was this page helpful?