SDL provides two example apps: one written in Objective-C and one in Swift. Both implement the same features.
The example apps are located in the sdl_ios repository. To try them, you can download the repository and run the example app targets, or you can use
pod try SmartDeviceLink with CocoaPods installed on your Mac.
If you download or clone the SDL repository in order to run the example apps, you must first obtain the BSON submodule. You can do so by running
git submodule init and
git submodule update in your terminal when in the main directory of the cloned repository.
The example apps implement soft buttons, template text and images, a main menu and submenu, vehicle data, popup menus, voice commands, and capturing in-car audio.
You can use a simulated or a real device to connect the example app to an emulator. To connect the example app to Manticore or another emulator, make sure you are on the
TCP Debug tab of the example app. Then type in the IP address and port number and press the "Connect" button. The button will turn green when you are connected. Please check the Connecting to an Infotainment System guide for more detailed instructions on how to get the emulator's IP address and port number.
You need a real device to connect the example app to production or debug hardware. After building the running the app, make sure you are on the
iAP tab of the example app and press "Connect". The button will turn green when you are connected.
If using the Bluetooth (BT) transport, make sure to first pair your phone to the hardware before attempting to connect your SDL app. If using the USB transport, you will need to connect your phone to the hardware using a USB cord.
If the hardware supports both BT and USB transports, only one transport will be supported at once. If your phone is connected via BT and you then connect the phone to the head unit via a USB cord, the library will close the BT session and open a new session over USB. Likewise, when the USB cord is disconnected, the library will close the USB session and open session over BT.
If your app compiles and but does not show up on the HMI, there are a few things you should check:
12345on the machine or VM running the SDL Core emulator. Also make sure your firewall allows that outgoing port.
For more examples go to the SmartDeviceLink Examples GitHub organization. Download or clone any of these projects.
The example weather app uses the OpenWeather API to implement a basic connected weather app with SDL UI. This example showcases changing screen template items for certain weather forecasts, displaying hourly and daily weather in popup menus, and showing weather alerts with SDL Alerts.
The example navigation app utilizes the MapBox API to create a basic video streaming map app. The example navigation app can be used as a reference for developers who want to create their own navigation app.
Some examples require obtaining API tokens from third parties for data and services. For all of these examples follow the setup instructions as outlined in their README.md.