View the sample code
- Clone the swift library repo: git clone email@example.com:jiborobot/apptoolkit-swift-library.git
- In Xcode, open AppToolkit.xcworkspace from the apptoolkit-swift-library repo you cloned.
- Expand AppToolkitSampleApp in the left sidebar.
- Explore the code in the sample app.
You need to add your ClientID to the app in order to run it on your robot.
- In the sidebar, open AppToolkitSampleApp/AppToolkitSampleApp/Metadata/Info.plist
- Click the JiboSDK expand triangle.
- Double-click the Value box for ClientID and replace the entry with your client ID.
- Double-click the Value box for ClientSecret and replace the entry with your passcode.
- Make sure AppToolkitSampleApp is in the dropdown next to the Play and Stop buttons on the top-left Xcode toolbar. (It will likely be AppToolkit by default, so check this carefully.)
- Click the Play button on the toolbar. This will launch the app in the iPhone simulator on your computer. The simulator might open behind other windows on your screen.
* Note: if you experience any errors, you might need to close the project, open terminal, run the following from the root of the apptoolkit-swift-library project, and then reopen the project:
Code: Select all
pod repo update pod install
- When the simulator opens (this could take a few seconds), click Authenticate.
- Type your Jibo App email address and password, then click Sign in.
- When asked if you want to allow the app to connect to your robot, click Yes.
- A list of all the robots associated with your account will appear onscreen. It may take a few seconds for them to appear. Click the one you want to connect to. (This can take quite while for the list to appear)
- Wait for robotName: followed by your four-word robot name to appear in the xcode console. It may take a few minutes.
- Click Connect in the iPhone simulator. The app should connect to Jibo. Jibo's light ring will turn magenta, and a small magenta dot will appear on the bottom-right of his screen. (Note: the magenta light ring and dot may not appear depending on your permission level.)
- After connecting, the iPhone simulator will show a list of commands. Click Say. (If the window with the list of commands doesnt appear, you may have to quit the program and re-run)
- Type hello world in the Content: box and click Say. Jibo should say "hello world."
- Now type Let me put on my dancing shoes <anim cat='dance' filter='&(music),!(beat-box,house,short)' endNeutral='true'/>., click Say, and watch Jibo dance! Check out the ESML page for more examples and instructions on how to create expressive speech with Jibo.
- Try out the other commands in the app. See the Known Issues section below for commands we know might not work as expected.
- In the test app, tap the "back" button on the top-left until you get back to the initial screen with 2 blue buttons.
- Tap the Disconnect button to disconnect from the robot. Jibo returns to his normal state.
- Tap the Invalidate button to remove access to remotely control the robot that is currently authenticated.
- Click the Stop button on the Xcode toolbar to close the iPhone simulator.
- For additional security, you can go to the Jibo app and toggle off the Enable remote control switch that you turned on when setting up your robot.
Though we have commands for Get Face Entity and LookAt Entity, they are not implemented yet. Using those commands won’t fail, but they also will not produce any action on Jibo’s part. We will let you know when those are implemented in the near future.
(The simulator is pretty buggy, and can cause the app to not work correctly. I have had to run the app multiple times before getting it to work and get to the list of commands window)