StravaSwift
This is a Swift wrapper for the Strava v3 API.
As this is a passion project, I only work on it when I have time. So, if you are interested in contributing, feel free to submit PRs.
Example
To run the example project, clone the repo, and run pod install from the Example directory first.
Installation
Swift Package Manager
Cocoapods
To install it, simply add the following line to your Podfile:
Quick Start
The full library documentation is available here.
First, you must register your app with Strava and get an OAuth client id and client secret .
Initialize the Strava Client as follows, preferably in your AppDelegate.swift to ensure it is configured before you call it:
Note, by default the OAuth token is only available while the app is running, which means you need to request a new token. You can implement custom token storage and retrieval behaviour by overriding the default token delegate in the StravaConfig initializer which must implement the TokenDelegate protocol.
Register your redirect URL scheme in your info.plist file.
The authentication will use the Strava app be default if it is installed on the device. If the user does not have Strava installed, it will fallback on SFAuthenticationSession or ASWebAuthenticationSession depending on the iOS version. If your app is linked on or after iOS 9.0, you must add strava in you app’s info.plist file. It should be added as an entry fo the array under the LSApplicationQueriesSchemes key. Failure to do this will result in a crash when calling canOpenUrl: .
- Implement the following method in your AppDelegate.swift to handle the OAuth redirection from Strava:
- After authorizing, you can start requesting resources:
- Requesting resources:
The Router implementation is based on this Alamofire example:
Todos
- 100% API coverage (about 90% now)
- Documentation
- Tests
- Better example app
Author
License
StravaSwift is available under the MIT license. See the LICENSE file for more info.
Swift strava как подключить
Reddit and its partners use cookies and similar technologies to provide you with a better experience.
By accepting all cookies, you agree to our use of cookies to deliver and maintain our services and site, improve the quality of Reddit, personalize Reddit content and advertising, and measure the effectiveness of advertising.
By rejecting non-essential cookies, Reddit may still use certain cookies to ensure the proper functionality of our platform.
For more information, please see our Cookie Notice and our Privacy Policy .
Get the Reddit app
Discussion of everything bicycle related. bikeit! bike bikes bicycle bicycles bicycling cycling
I pre-orded the Suito and wanted to get the rest set up.
How do you sync between Zwift , Garmin and Strava. I have an Edge 530, hr strap and a Fenix 5 plus.
Is there an automatic way to get sync Garmin with Zwift or is manual still the only way? Can you use Garmin training workouts in Zwift theoretically? I guess smart trainers don't dual connect, right? So it's either one connection via Bluetooth to the laptop/iPad/appletv or one to the edge?
I just want ftp, training effect, calories be displayed in garmin connect, so I can have all excercises in one place.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
A Swift wrapper for the Strava API v3
License
mpclarkson/StravaSwift
Name already in use
- Local
- Codespaces
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
This is a Swift wrapper for the Strava v3 API.
As this is a passion project, I only work on it when I have time. So, if you are interested in contributing, feel free to submit PRs.
To run the example project, clone the repo, and run pod install from the Example directory first.
Swift Package Manager
To install it, simply add the following line to your Podfile:
The full library documentation is available here.
First, you must register your app with Strava and get an OAuth client id and client secret .
Initialize the Strava Client as follows, preferably in your AppDelegate.swift to ensure it is configured before you call it:
Note, by default the OAuth token is only available while the app is running, which means you need to request a new token. You can implement custom token storage and retrieval behaviour by overriding the default token delegate in the StravaConfig initializer which must implement the TokenDelegate protocol.
Register your redirect URL scheme in your info.plist file.
The authentication will use the Strava app be default if it is installed on the device. If the user does not have Strava installed, it will fallback on SFAuthenticationSession or ASWebAuthenticationSession depending on the iOS version. If your app is linked on or after iOS 9.0, you must add strava in you app’s info.plist file. It should be added as an entry fo the array under the LSApplicationQueriesSchemes key. Failure to do this will result in a crash when calling canOpenUrl: .
- Implement the following method in your AppDelegate.swift to handle the OAuth redirection from Strava:
- After authorizing, you can start requesting resources:
- Requesting resources:
The Router implementation is based on this Alamofire example:
How To Connect Zwift To Strava: Step By Step Guide
Maximize your Zwift experience with our step-by-step guide on how to connect Zwift to Strava. Track your progress and share with friends. Learn more now!

Welcome to the world of digital cycling!
Are you a cycling enthusiast looking to take your indoor training to the next level? Do you want to track your progress and share your accomplishments with the world? Look no further than Zwift, the virtual cycling platform that brings the outdoors indoors. But don’t stop there!
Please enable JavaScript
Connect your Zwift to Strava, the popular fitness-tracking app, to take your training to the next level.
In this step-by-step guide, I’ll show you exactly how to connect Zwift to Strava and start sharing your rides with the world. So put on your cycling shoes, grab your water bottle, and ride on!
Pre-requisites For Zwift To Strava Connection
I’m assuming you already have a Zwift and Strava account. If not, head over to the respective websites and sign up!
Before we get started, you’ll also need the Zwift Companion app on your mobile. You won’t be able to link Zwift and Strava via the main Zwift app.
Compatible Devices
To connect Zwift to Strava, you’ll need a compatible device. You can use iPhone, iPad, Apple TV, Android devices, Windows PC, or Mac. Check your device compatibility on the Zwift and Strava websites to ensure a seamless connection.
Connecting Zwift To Strava: A Step-By-Step Guide
Connecting via Zwift Companion App
- Open the Zwift Companion app and log into your account.
- Select “… More” on the bottom right of the interface
- Navigate to the “Settings” menu.
- Select “Connections” and you’ll find “Strava” listed there.
- Click on “Strava” and enter your Strava account details.

It’s that simple. A few clicks, and you’re connected! As you’ll see, you can also replicate the same for Garmin, Training Peaks, etc.
Connecting via the Zwift Website
- Log into your Zwift account
- Click on the burger menu icon in the upper right corner
- Click on your Profile picture (under Activity Feed)
- Select “Connections” on the right side of the page, then find and click on “Strava”

- Enter your Strava account details, authorize the connection and you’re all set!

Verifying The Connection
Once you’ve connected Zwift and Strava, you’ll want to confirm the connection is working correctly. You should be able to see Strava “Connected” on the Companion app and website.
The first time you complete a Zwift workout, you’ll be able to save your ride and upload it to Strava. See my connection page below after a ride.

It should automatically appear on your Strava feed, serving as an additional confirmation of a successful connection.
Sharing Zwift Workouts On Strava
Automatic Sharing
The beauty of connecting Zwift to Strava lies in the automatic sharing feature. Once connected, your Zwift workouts automatically upload to Strava.
Showcase your efforts to your followers and track your progress!
Manual Sharing
- Head over to your Zwift feed (login as needed)
- Click on “Just Me”
- Find the ride that you want to upload and click on it
- Click on Settings (“Gear Cog” symbol)
- Download the FIT File

- Back on your Strava account, up the top right, click on Upload activity, and upload the FIT file
Troubleshooting Connection Issues
As straightforward as the setup is, there are occasionally issues syncing between Zwift and Strava.
The first step I would do is just reset everything and restart the syncing process. If you’ve entered incorrect account details or are using an incompatible device, the connection might not work. Connectivity issues can also hinder the linking process.
If you’ve double-checked all these aspects and still can’t connect, check out the Zwift and Strava support pages.
Frequently Asked Questions
Is it possible to disconnect Zwift from Strava?
Yes, you can disconnect Zwift from Strava at any time. Simply go to the ‘Connections’ section in Zwift and deselect ‘Strava’, or visit the ‘Settings’ page on Strava and remove Zwift from your connected apps.
Do I need to pay for Zwift and Strava to connect them?
While both Zwift and Strava offer premium features with their respective subscription plans, you can still connect them with their basic, free accounts. However, certain advanced features might require a subscription to either or both platforms.