mpclarkson / StravaSwift

A Swift wrapper for the Strava API v3
MIT License
104 stars 45 forks source link

Please update for swift 3 #2

Closed danieltigse closed 7 years ago

mpclarkson commented 8 years ago

@danieltigse I've just pushed a quick refactor to the swift-3.0 branch but I'm getting504 timeout errors from Strava. No idea what is causing that.

This is only a side project for me and I don't have any production apps using this library so any help debugging/maintaining would be much appreciated.

The library really needs a proper refactor to align better with Swift 3 conventions, accommodate the major changes to the Alamofire api and handle errors better. Again, input would be appreciated :)

danieltigse commented 8 years ago

Thanks a lot man!! I was trying to update the code to swift 3 just right now haha.

agonzalezjr commented 7 years ago

First of all, @mpclarkson this is some wicked cool Swift-AlamoFire code 👌 Learned a lot just from looking at it.

Authentication flow worked fine, and the current athlete data is returned ok together with the access token. It is after that that all requests fail ... Trying the requests manually after that works fine, so Strava API seems to be OK.

I am not that familiar with AlamoFire, but changing the encoding in the URLRequestConvertible::asURLRequest() implementation seems to fix the issue for simple queries and for POSTs too.

Going to clean-up a bit and work on a PR ...

EDIT: Ignore this, the other encoding after the new API changes works just fine. Still submitted PR for changes to the Sample App.

mpclarkson commented 7 years ago

Thanks - merged.