cancel
Showing results for 
Search instead for 
Did you mean: 

api gpx upload

bijory
Mt. Kenya

I am making an app for the ios environment.
The app supports Strava upload in gpx format.
Most of the items you want are uploaded normally.
However, Strava's Sport items will not be sent as desired.
Below is an example.
let params = [
"name": StravaGPX_TitleName,
"type": "\(Sport[userData.Sport_Name])",
"sport_type": Sport[userData.Sport_Name].trimmingCharacters(in: .whitespaces),
"description": "Uploaded from Masil-Tracker",
"data_type": "gpx"
]

Among the above
"type": "Mountain Bike Ride"
"type": "MountainBikeRide"
"sport_type": "Mountain Bike Ride"
"sport_type": "MountainBikeRide"

Even if you specify each one
The Sport item on the Strava is saved as "Ride".

Which code should I use to upload Strava gpx
Will the items you want be designated in Strava's Sport items?

3 REPLIES 3

bijory
Mt. Kenya

let params = [

            "name": StravaGPX_TitleName,

            "type": Sport[userData.Sport_Name],

            "sport_type": Sport[userData.Sport_Name].trimmingCharacters(in: .whitespaces),

            "description":"Uploaded from Masil-Tracker",

            "data_type":"gpx"

        ] 

The code above is exactly what I use.
Sport[userData.Sport_Name] 변수는
String "Mountain Bike Ride".

When uploading the Strava, it is still Ride in the Sport item.

Jan_Mantau
Denali

There is a weird character at the start of your values. The correct values should be:

"type" : "Ride", "sport_type" : "MountainBikeRide"

let params = [

            "name": StravaGPX_TitleName,

            "type": Sport[userData.Sport_Name],

            "sport_type": Sport[userData.Sport_Name].trimmingCharacters(in: .whitespaces),

            "description":"Uploaded from Masil-Tracker",

            "data_type":"gpx"

        ] 

The code above is exactly what I use.
Sport[userData.Sport_Name] 변수는
String "Mountain Bike Ride".

When uploading the Strava, it is still Ride in the Sport item.