AzureBot is an iOS SDK for embedding a bot created using Microsoft Bot Framework.
- Direct Line API
- Uses websockets (instead of polling GET requests)
- Sample App
- Native Chat UI
- Rich Card Support
- AdaptiveCard
- AnimationCard
- AudioCard
- HeroCard
- ThumbnailCard
- ReceiptCard
- SignInCard
- SuggestedAction
- VideoCard
- CardCarousel
- iOS 11.0+
- Xcode 9.3+
- Swift 4.1+
- A Bot
Want to check out the SDK first? Check out the example app. Just clone this repo, add your Direct Line Secret to the Example App's AzureData.plist
file and run.
Follow one of these three options to add the framework to your own project.
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate AzureBot into your Xcode project using Carthage, specify it in your Cartfile:
github "colbylwilliams/AzureBot"
Run carthage update
to build the framework and drag the built AzureBot.framework
into your Xcode project.
Coming soon
Coming soon
To get started using AzureBot, you need to provide the SDK with your Direct Line Secret. There are two ways to provide the Direct Line Secret; programmatically, or by adding it to a plist file:
The simplest way to provide these values and start using the SDK is to set the values programmatically:
BotClient.shared.configure(withSecret: "BOT_FRAMEWORK_DIRECT_LINE_SECRET")
Alternatively, you can provide these values in your project's info.plist
, a separate AzureBot.plist
, or provide the name of your own plist file to use. Simply add the BotFrameworkDirectLineSecret
key and provide your Direct Line Secret.
Note: This method is provided for convenience when quickly developing samples and is not recommended to ship this secret in a plist in production apps.
...
<dict>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>BotFrameworkDirectLineSecret</key>
<string>BOT_FRAMEWORK_DIRECT_LINE_SECRET</string>
...
Or add a AzureBot.plist
file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BotFrameworkDirectLineSecret</key>
<string>BOT_FRAMEWORK_DIRECT_LINE_SECRET</string>
</dict>
</plist>
Finally, you can BotFrameworkDirectLineSecret
key/value to any plist in your project's main bundle and provide the name of the plist:
BotClient.shared.configure(withPlistNamed: "SuperDuperDope")
BotViewController
is a UIViewController that renders the conversational interface for your bot.
You can add a BotViewController
to your application programmatically or in your Storyboard file:
let botController = BotViewController.create()
present(botController, animated: true, completion: nil)
Licensed under the MIT License. See LICENSE for details.