Code Monkey home page Code Monkey logo

stravakit's Introduction

StravaKit

MIT Licence CocoaPods Compatible Carthage Compatible Platform BuddyBuild

API client for Strava written in Swift.

See Change Log and To Do List for completed features and future plans.

CocoaPods

StravaKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'StravaKit', '~> 0.9'

Carthage

StravaKit can also be built using Carthage.

Add the following line to your Cartfile:

github "StravaKit/StravaKit" ~> 0.9

Beta Status

While the StravaKit version is less than 1.0.0 it is considered beta. Breaking changes will follow Semantic Versioning standards with some exceptions while it is still in beta. All versions in the 0.5.x series will be compatible while a bump to 0.6 or 0.7 may include breaking changes in model properties as those details are worked out. Once the version has reached 1.0.0 strict Semantic Versioning will be followed.

Docs

Strava Labs provides an API Reference. It includes specifications for working with OAuth and the various REST endpoints. Discussions on the API can be found in the Developer Forum.

Contributions

Assistance with adding new functionality, fixing a bug or reporting a bug is welcome. For new functionality you can browse the To Do List for missing features and once you've decided what you'd like to add you can create a new issue to let others know you are going to be preparing an update. Fork the repository, prepare your update with tests and submit a Pull Request. For bugs, if you plan on fixing them yourself, please also fork the repository, include tests and submit a Pull Request. If you've discovered a bug please create a new issue and label it as a bug. It is possible the issue has already been logged so look before adding a new issue.

If there is a feature that you feel is important and would like it implemented sooner you can create an issue and invite others to comment on it and use the reactions feature to indicate that they also are interested in that feature. The feature requests with more positive reactions will get priority.

Purpose and Goals

The StravaKit framework is intended to be a Swift implementation of a Strava API client. The goal is to make it fully functional so that it can be used to build any iOS or potentially Mac, Apple TV or watchOS app. Dependencies will be kept at a minimum. While StravaKit will be made available via CocoaPods and Carthage, it will not have any dependencies itself. It will also not load in UIKit so that it will be possible to use for developing a Mac app.

StravaKit will also track with the current version of Swift once 3.0 is released without any priority for older versions of Swift or Objective-C and iOS releases. If an app requires older versions of iOS or Objective-C it is recommended to use FRDStravaClient which is built with Objective-C and will be more appropriate for backward compatibility.

Architecture

The response returned while authorizing access to the Strava API includes the access token and the athlete profile. While these values are stored in the Keychain, this framework does not provide other data store solutions. Either another entirely separate framework will be built on top of StravaKit or optional features will be defined as submodules. With CocoaPods it is possible to define subspecs. For Carthage and SwiftPM submodules may not be supported currently. It may make most sense to create extension frameworks which work with StravaKit. A data store solution would use StravaKit and wrap all interactions with the API so the app and view controllers would not directly interact with the API and would instead submit requests to the data store for what is needed and get a deferred result when the data is ready, either from locally stored data which is still fresh or after pulling a fresh copy from the API.

License

MIT

Author

Brennan Stehling - 2016-2017

Examples

A demo application is included with StravaKit along with a comprehensive collection of tests which demonstrate how StravaKit can be used. You can also browse the documentation which is generated using Jazzy.

Note: Not all endpoints have been implemented in StravaKit. See Contributions.


stravakit's People

Contributors

brennanmke avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stravakit's Issues

Unable to find a specification for `StravaKit`

I'm trying to get StravaKit from CocoaPods, but it can't find the specification. I've confirmed that I'm able to load other dependencies, so I'm not sure why yours isn't working. Should this be working right now?

Review using Sourcery for code generation models

See Sourcery.

The models first require a list of properties with various types and some are optional. The init function must then know the keys and structure of the JSON file in order to process it properly and also handle the non-optional and optional properties. It may not be an easy task to generate this code but if it is possible it would greatly simplify development for an API client.

A model like Map shows how the properties and init function handle non-optional and optional values when parsing the JSON.

Activity Upload

Has anyone attempted to build out the StravaUpload extension? I've successfully implemented that particular Strava API endpoint in my own code, but using a different Model that involves AlamoFire SessionManager, multipart form upload protocols, and p2.OAuth2.

I'd be willing to give it a go with some guidance.

From a first glance it appears that DefaultRequestor will take a .POST or .PUT and convert the params parameter by JSONSerializing that parameter, which would break for a Data object (containing the .fit file.)

Would I want to create a different type of Requestor?

Prepare 0.9.3 release

  • Update Info.plist and StravaKit and app
  • Update README.md
  • Update TODO.md
  • Update CHANGELOG.md
  • Update Podspec
  • Update Jazzy docs
  • Commit changes
  • Create and push tag
  • Lint spec
  • Push trunk

Prepare 0.9.2 release

  • Update Info.plist and StravaKit and app
  • Update README.md
  • Update TODO.md
  • Update CHANGELOG.md
  • Update Podspec
  • Update Jazzy docs
  • Commit changes
  • Create and push tag
  • Lint spec
  • Push trunk

Prepare 0.9.1 release

  • Update Info.plist and StravaKit and app
  • Update README.md
  • Update TODO.md
  • Update CHANGELOG.md
  • Update Podspec
  • Update Jazzy docs

Prepare 0.9.5 release

  • Update Info.plist and StravaKit and app
  • Update README.md
  • Update TODO.md
  • Update CHANGELOG.md
  • Update Podspec
  • Update Jazzy docs
  • Commit changes
  • Create and push tag
  • Lint spec
  • Push trunk

Pod install error

I am getting following error.


- `StravaKit` required by `Podfile`

Specs satisfying the `StravaKit` dependency were found, but they required a higher minimum deployment target.

Although, I am using 9.0 as minimum version for iOS. Is there any workaround for this ?

Strava authentication is causing assertion failure

Hi,

When I attempt to authenticate to Strava using my client ID and client secret using the following:

Strava.set(clientId: clientID, clientSecret: clientSecret, redirectURI: redirectURI)
        
 if let URL = Strava.userLogin(scope: .PrivateWrite) {
            let vc = SFSafariViewController(url: URL, entersReaderIfAvailable: false)
            present(vc, animated: true, completion: nil)
            safariViewController = vc
        }

I get the following assertion failure: assert(sharedInstance.athlete != nil, "Athlete is required")

I am building for iOS 10.3 and testing on the iPhone 7 Plus simulator.

Is this an issue with iOS 10.3 or am I authenticating incorrectly?

Thanks,

James

Prepare 0.9.4 release

  • Update Info.plist and StravaKit and app
  • Update README.md
  • Update TODO.md
  • Update CHANGELOG.md
  • Update Podspec
  • Update Jazzy docs
  • Commit changes
  • Create and push tag
  • Lint spec
  • Push trunk

Migrate to Swift 3

  • Run migration task on StravaKit
  • Run migration task on StravaDemo
  • Run migration task on StravaKitTests
  • Review and clean up code
  • Enable more linting rules and handle warnings

See also: #7

Prepare 0.9.0 release

  • Update Info.plist and StravaKit and app
  • Update README.md
  • Update TODO.md
  • Update CHANGELOG.md
  • Update Podspec
  • Update Jazzy docs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.