Skip to content

AzureBot is an iOS SDK for embedding a bot created using Microsoft Bot Framework.

License

Notifications You must be signed in to change notification settings

colbylwilliams/AzureBot

Repository files navigation

AzureBot

AzureBot is an iOS SDK for embedding a bot created using Microsoft Bot Framework.

Features

  • 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

Requirements

  • iOS 11.0+
  • Xcode 9.3+
  • Swift 4.1+
  • A Bot

Try Me

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.

Installation

Follow one of these three options to add the framework to your own project.

Carthage

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.

CocoaPods

Coming soon

Swift Package Manager

Coming soon

Keys

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:

Programmatically

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")

Plist File

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.

Info.plist

...
<dict>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>BotFrameworkDirectLineSecret</key>
    <string>BOT_FRAMEWORK_DIRECT_LINE_SECRET</string>
...

AzureBot.plist

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>

Named 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

BotViewController is a UIViewController that renders the conversational interface for your bot.

BotViewController-0 BotViewController-1 BotViewController-2

You can add a BotViewController to your application programmatically or in your Storyboard file:

Programmatically

let botController = BotViewController.create()

present(botController, animated: true, completion: nil)

Storyboard

Storyboard

About

Third-party Code ❤️

License

Licensed under the MIT License. See LICENSE for details.

About

AzureBot is an iOS SDK for embedding a bot created using Microsoft Bot Framework.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published