Coder Social home page Coder Social logo

colbylwilliams / azurebot Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 6.0 802 KB

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

License: MIT License

Swift 99.68% Objective-C 0.32%
swift azure microsoft bot-framework azure-bot-service ios framework chat

azurebot's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.