{"id":1903,"url":"https://github.com/96-problems/medium-sdk-swift","last_synced_at":"2026-02-22T00:03:16.264Z","repository":{"id":62447679,"uuid":"57541879","full_name":"96-problems/medium-sdk-swift","owner":"96-problems","description":"A swift SDK for Medium's OAuth2 API https://medium.com","archived":false,"fork":false,"pushed_at":"2017-03-09T19:07:28.000Z","size":72,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-23T09:13:44.494Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/96-problems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-01T06:03:47.000Z","updated_at":"2022-01-22T09:24:00.000Z","dependencies_parsed_at":"2022-11-01T23:06:39.788Z","dependency_job_id":null,"html_url":"https://github.com/96-problems/medium-sdk-swift","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/96-problems/medium-sdk-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/96-problems%2Fmedium-sdk-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/96-problems%2Fmedium-sdk-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/96-problems%2Fmedium-sdk-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/96-problems%2Fmedium-sdk-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/96-problems","download_url":"https://codeload.github.com/96-problems/medium-sdk-swift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/96-problems%2Fmedium-sdk-swift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29699342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"ssl_error","status_checked_at":"2026-02-21T23:35:03.832Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:15:58.605Z","updated_at":"2026-02-22T00:03:12.225Z","avatar_url":"https://github.com/96-problems.png","language":"Swift","funding_links":[],"categories":["SDK"],"sub_categories":["Unofficial","Other free courses"],"readme":"Medium SDK - Swift\n===============\n\u003e A library to allow access to Medium API for any Swift iOS application.\n\n[![Swift Version][swift-image]][swift-url]\n[![License][license-image]][license-url]\n[![Platform][platform-image]][platform-url]\n\n## Features\n\n- [x] Medium.com authorization \u0026 token handling\n- [x] Login state saved in user defaults\n- [x] Supported scopes: basicProfile, listPublications, publishPost\n- [x] Implemented all the related requests from the [Medium API docs](https://github.com/Medium/medium-api-docs)\n- [ ] Support Safari View Controller\n\n## Compatibility\n\n- iOS 9.0+\n~- osx 10.10~\n\n## Installation\n\n```\n  pod 'MediumSDKSwift'\n```\n\nand run `pod install` in the directory to load dependencies.\n\n## Configuration\n\nAdd your `MEDIUM_CLIENT_ID`, `MEDIUM_CLIENT_SECRET`, `MEDIUM_CALLBACK_URL`\nin `Build settings ` -\u003e `User-Define`\n\nIn the project right click on your `Info.plist` file,\nchoose \"Open As\" - \"Source code\" and add these lines :\n\n```\n\u003ckey\u003eCFBundleURLTypes\u003c/key\u003e\n\u003carray\u003e\n    \u003cdict\u003e\n        \u003ckey\u003eCFBundleURLName\u003c/key\u003e\n        \u003cstring\u003e$(PRODUCT_BUNDLE_IDENTIFIER)\u003c/string\u003e\n        \u003ckey\u003eCFBundleURLSchemes\u003c/key\u003e\n        \u003carray\u003e\n            \u003cstring\u003emediumswift\u003c/string\u003e\n        \u003c/array\u003e\n    \u003c/dict\u003e\n\u003c/array\u003e\n\n\u003ckey\u003eMediumCallbackURL\u003c/key\u003e\n\u003cstring\u003e$(MEDIUM_CALLBACK_URL)\u003c/string\u003e\n\n\u003ckey\u003eMediumClientID\u003c/key\u003e\n\u003cstring\u003e$(MEDIUM_CLIENT_ID)\u003c/string\u003e\n\n\u003ckey\u003eMediumClientSecret\u003c/key\u003e\n\u003cstring\u003e$(MEDIUM_CLIENT_SECRET)\u003c/string\u003e\n\n```\n\nright before the \u003c/dict\u003e tag.\n\nHandle the callback in App Delegate:\n\n```\nfunc application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -\u003e Bool {\n        if (url.host == \"mediumswift-callback\") {\n            OAuthSwift.handleOpenURL(url)\n        }\n        return true\n    }\n```\n\nNote that the redirect is done via a free Heroku app and it's highly recommended to setup your own redirect service by cloning and running [this repo](https://github.com/drinkius/mediumswift.herokuapp.com) (courtesy of the original [oauthswift.herokuapp.com](https://github.com/dongri/oauthswift.herokuapp.com) repo). Change all the `mediumswift` strings in the repo to the name of your app and make related changes in `Info.plist` and `App Delegate` files. The deployment with Heroku is easy - just link your GitHub repo and the app is built automatically.\n\nYou are all set!\n\n## Usage\n\n``MediumSDKManager`` class is designed as a singleton, you can access all it's methods by calling a shared instance:\n\n```\nlet mediumSession = MediumSDKManager.sharedInstance\n```\n\nList of methods of the ``MediumSDKManager`` class:\n\n* **Authorize**, completion handler returns state: success/failure and user's medium token or error string:\n```\ndoOAuthMedium(completionHandler: (String, String) -\u003e Void)\n```\n\n* **Check login credentials**, completion handler returns state: success/failure and medium token or error string:\n```\ncheckCred(completionHandler: (String, String) -\u003e Void)\n```\n\n* **Get current user ID**, completion handler returns state: success/failure and user ID or error string:\n```\ngetUserID(completionHandler: (String, String) -\u003e Void)\n```\n\n* **Get current Medium token**, completion handler returns state: success/failure and medium token or error string:\n```\ngetToken(completionHandler: (String, String) -\u003e Void)\n```\n\n* **Sign out**, completion handler returns state: success/failure, and message or error string:\n```\nsignOutMedium(completionHandler: (String, String) -\u003e Void)\n```\n\n* **Get current user's credentials**, completion handler returns state: success/failure, and user ID as or error string:\n```\nownCredentialsRequest(completionHandler: (String, String) -\u003e Void)\n```\n\n* **Get list of current user's publications**, completion handler returns state: success/failure, number of users publications or error string and publications JSON if present:\n```\nuserPublicationsListRequest(completionHandler: (String, String, JSON) -\u003e Void)\n```\n\n* **Get list of a publication's contributors**, completion handler returns state: success/failure, number of users publications or error string and publications JSON if present:\n```\ngetListOfContributors(publicationId: String, completionHandler: (String, String, JSON) -\u003e Void)\n```\n\n* **Create new post**, completion handler returns state: success/failure, and message or error string:\n```\ncreatePost(title: String, contentFormat: String, content: String, canonicalUrl: String?=nil, tags: [String]?=nil,  publishStatus: MediumPublishStatus?=nil, license: MediumLicense?=nil, completionHandler: (String, String) -\u003e Void)\n```\n\n* **Create a post under existing publication**, completion handler returns state: success/failure, and message or error string:\n```\ncreatePostUnderPublication(rootPublication: String, title: String, contentFormat: String, content: String, canonicalUrl: String?=nil, tags: [String]?=nil, publishStatus: MediumPublishStatus?=nil, license: MediumLicense?=nil, completionHandler: (String, String) -\u003e Void)\n```\n\nNote that publish status and licence fields are coded as enums with all the possible states of these parameters, when creating a publication just use the proper values.\n\n## Release History\n* 0.1.1\n    * Remove OSX\n* 0.1.0\n    * Update syntax for Swift 3.0\n    * Drop support \u003c= iOS 9.0\n    * Update dependencies\n* 0.0.4\n    * add User-defnie variables\n    * current version\n* 0.0.3\n    * bug fixies\n* 0.0.2\n    * update dependencies\n* 0.0.1\n    * The first release\n\n## Contribute\n\nWe would love for you to contribute to **Medium SDK - Swift**, check the ``LICENSE`` file for more info.\n\n## Meta\n\nOriginal author:\n- Alexander Telegin – [@drinkius](https://github.com/drinkius) – telegin.alexander@gmail.com\n\nMaintained:\n- Fernando Bass = [@ferbass](https://github.com/ferbass)\n\nContributions by\n- Reejo Samuel - [@reejosamuel](https://github.com/reejosamuel)\n\nCreated as a part of development internship, distributed under the MIT license. See ``LICENSE`` for more information.\n\nhttps://github.com/96-problems/medium-sdk-swift\n\n[swift-image]:https://img.shields.io/badge/swift-2.2-orange.svg\n[swift-url]: https://swift.org/\n[license-image]: https://img.shields.io/badge/License-MIT-blue.svg\n[license-url]: LICENSE\n[platform-image]: https://img.shields.io/badge/platform-ios-green.svg\n[platform-url]: http://www.apple.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F96-problems%2Fmedium-sdk-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F96-problems%2Fmedium-sdk-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F96-problems%2Fmedium-sdk-swift/lists"}