A simple iOS app for tracking walking and running activities with Strava integration.
- Track your walking and running activities
- Export activities as GPX files
- Sync activities with Strava
- Background location tracking
- Xcode 14.0 or later
- iOS 16.0 or later
- A Strava API account
- Create a Strava API application at https://www.strava.com/settings/api
- Set the following in your Strava API application settings:
- Authorization Callback Domain: The domain name of your
redirect_uri. For example, if yourredirect_uriishttps://subdomain.example.com/strava/callback, then the Authorization Callback Domain should besubdomain.example.com.
- Authorization Callback Domain: The domain name of your
Instead of setting environment variables directly in Xcode, use the Secrets.xcconfig file for better security and maintainability. Follow these steps:
- Duplicate the
Secrets.xcconfig.examplefile and rename it toSecrets.xcconfig. - Open the
Secrets.xcconfigfile and set the following values:STRAVA_CLIENT_ID = your_strava_client_id STRAVA_CLIENT_SECRET = your_strava_client_secret STRAVA_REDIRECT_URI = your_strava_redirect_uri - Ensure
Secrets.xcconfigis excluded from version control (already handled in.gitignore). - The app will automatically load these values from
Secrets.xcconfigviaInfo.plist.
- Clone the repository
- Open
WalkRun.xcodeprojin Xcode - Set up the environment variables as described above
- Build and run the app
- Tap "Start Tracking" to begin recording your activity.
- Your location will be tracked in the background while the activity is ongoing.
- Tap "Stop Tracking" when you finish your activity.
- Export your activity as a GPX file for external use or backup.
- Sync your activity with Strava by tapping "Sync with Strava" to upload it directly.
If you encounter issues with the redirect_uri, ensure the following:
- The
STRAVA_REDIRECT_URIin yourSecrets.xcconfigmatches the value registered in the Strava Developer Portal. - The
redirect_uriis correctly encoded in the app. You can debug this by printing the resolved value in the app logs.
- "invalid redirect_uri":
- Ensure the
redirect_uriin the Strava Developer Portal matches the value sent by the app. - Double-check the encoding of the
redirect_uriin the app. - Verify that the
STRAVA_REDIRECT_URIis correctly set inSecrets.xcconfigand referenced inInfo.plist.
- Ensure the
WalkRun requires location access to track your activities. Your location data is stored locally on your device and is only shared with Strava if you choose to sync your activities.
This project is licensed under the MIT License - see the LICENSE file for details.