Skip to content

omarfoz/watsonEat

Repository files navigation

WastonEats

Click the image to watch the demo.

Watch the video

In this developer experience, we will create an iOS mobile app using Swift, Watson Assistant and Google Places API. The Watson Assistant service will be used as a Chabot. The Google Places API will use to locate the nearby restaurants and coffee.

When the reader has completed this experience, they will understand how to:

  • Create a Chabot mobile app that can be used to find the nearby restaurants and coffee.
  • Use Google Places API to locate the nearby restaurants and coffee.

Flow

alt text

1- The user opens the iOS application then clicks start chat.

2- User types “Restaurant or Coffee” via the mobile app.

3- Watson Assistant identifies the word then activates the action method.

4- Google Places API searches nearby restaurants or coffee.

5- Return the nearby results.

Platform

Table of Contents

Summary

A Mobile Application that helps you find the nearest restaurants and coffee with Watson Assistant and Google Places API.

Requirements

  • iOS 9.0+
  • Xcode 9
  • Swift 4.0

Configuration

IBM Cloud Mobile services Dependency Management

The IBM Cloud Mobile services SDK uses CocoaPods to manage and configure dependencies.

You can install CocoaPods using the following command:

$ sudo gem install cocoapods

If the CocoaPods repository is not configured, run the following command:

$ pod setup

For this starter, a pre-configured Podfile has been provided. To download and install the required dependencies, run the following command in your project directory:

$ pod install

Now Open the Xcode workspace: {APP_Name}.xcworkspace. From now on, open the .xcworkspace file because it contains all the dependencies and configurations.

If you run into any issues during the pod install, it is recommended to run a pod update by using the following commands:

$ pod update
$ pod install

View configuration

Watson Dependency Management

This starter uses the Watson Developer Cloud iOS SDK in order to use the Watson Assistant service.

The Watson Developer Cloud iOS SDK uses Carthage to manage dependencies and build binary frameworks.

You can install Carthage with Homebrew:

$ brew update
$ brew install carthage

To use the Watson Developer Cloud iOS SDK in any of your applications, specify it in your Cartfile:

github "watson-developer-cloud/swift-sdk"

For this starter, a pre-configured Cartfile has been included.

Run the following command to build the dependencies and frameworks:

$ carthage update --platform iOS

Note: You may have to run carthage update --platform iOS --no-use-binaries, if the binary is a lower version than your current version of Swift.

Once the build has completed, the frameworks can be found in the Carthage/Build/iOS/ folder. The Xcode project in this starter already includes framework links to the following frameworks in this directory:

  • AssistantV1.framework

If you build your Carthage frameworks in a separate folder, you will have to drag-and-drop the above frameworks into your project and link them in order to run this starter successfully.

View configuration

Training Watson

Remember you need to Open the Watson Training user experience from the IBM Console before you can run the app locally. This automatically prepares training before the app connects to the Watson Assistant.

View configuration

Run

Create your own Starterkit from IBM Cloud

Starterkit-Virtual Assistant for iOS with Watson

alt text

  • You only need one file from the starterkit called "BMSCredentials.plist", then move this file inside the project folder watsonEats/VirtualAssistantforiOSSideProject.

  • Change the Bundle Identifier to anything in the xcode in Genral tab you can change it.

Launch Watson Assistint Tool

Import json file "WatsonEats.json" to your workspaces, you can find the json file in the project WatsonEats/

alt text

Set up Google API

You only need the API key for Google Places.

  • You can get Google Places API key from here, by creating project in google and following the instructions.
  • Place the API key on Xcode "Keys.swift"

alt text

Finally Run The App

You can now run the application on a simulator or physical device.

License

This package contains code licensed under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 and may also view the License in the LICENSE file within this package.

WatsonEats

About

WastonEats is a Mobile Application that helps you to find the nearest restaurant and coffeeshops with Watson Assistant and Google Places API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published