This is just a really quick app I made to play with the Smartcar API and SwiftUI for iOS 17. You log in, it displays a list of test cars, you pick one, and it gives a map view and the odometer reading for it.
As mentioned before, this is an iOS 17 app. I'm still learning Swift and SwiftUI, so it may not be done in the best of ways, but it does run in the simulator.
Perform the following steps:
- Install Cocoapods
- Change to the project directory and install the pods (
pod install) - Set your Smartcar Client ID in the
Config.swiftfile. - Make sure the backend is running (see below).
- Run the app using the play button on an iOS Simulator that supports iOS 17.
Super quick Python script to handle the server side aspects of the Cars iOS app. Only handles exchanging an access code for an access token and a couple of GET requests.
Perform the following steps:
- Set your environment variables:
export SMARTCAR\_CLIENT\_ID=your-client-idexport SMARTCAR\_CLIENT\_SECRET=your-client-secretexport SMARTCAR\_REDIRECT\_URI=your-redirect-uri- (Note: Your redirect URI should match your iOS redirect URI, which
should be
sc{your-client-id}://exchange)
- Create a virtual environment (
python3 -m venv env) - Source the virtual environment (
source env/bin/activate) - Install the requirements (
pip install -r requirements.txt) - Run the script (
uvicorn main:app --reload)
The server should be running on localhost:8000.



