Medium SDK - Swift alternatives and similar libraries
Based on the "Unofficial" category.
Alternatively, view Medium SDK - Swift alternatives based on common mentions on social networks and blogs.
-
STTwitter
A stable, mature and comprehensive Objective-C library for Twitter REST API 1.1 -
objectiveflickr
ObjectiveFlickr, a Flickr API framework for Objective-C -
das-quadrat
A Swift wrapper for Foursquare API. iOS and OSX. -
CloudRail SI
Unified API Library for: Cloud Storage, Social Log-In, Social Interaction, Payment, Email, SMS, POIs, Video & Messaging. Included services are Dropbox, Google Drive, OneDrive, OneDrive for Business, Box, Egnyte, PayPal, Stripe, Google Places, Foursquare, Yelp, YouTube, Vimeo, Twitch, Facebook Messenger, Telegram, Line, Viber, Facebook, GitHub, Google+, LinkedIn, Slack, Twitter, Windows Live, Yahoo, Mailjet, Sendgrid, Twilio, Nexmo, Twizo. -
Github.swift
:octocat: Unofficial GitHub API client in Swift -
Easy Social
The Easiest and Simplest iOS library for Twitter and Facebook. Just Drop in and Use! -
UberKit
An easy-to-use Objective-C wrapper for the Uber API (no longer supported) -
DribbbleSDK
Unofficial Dribbble iOS wrapper allows you to integrate Dribble API into iOS application (Designer, Shot, Comment, User Story, Like, Follow) -
TJDropbox
A Dropbox v2 client library written in Objective-C -
SocialLib
SocialLib handles sharing message to multiple social media.
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Medium SDK - Swift or a related project?
README
Medium SDK - Swift
A library to allow access to Medium API for any Swift iOS application.
Features
- [x] Medium.com authorization & token handling
- [x] Login state saved in user defaults
- [x] Supported scopes: basicProfile, listPublications, publishPost
- [x] Implemented all the related requests from the Medium API docs
- [ ] Support Safari View Controller
Compatibility
- iOS 9.0+ ~- osx 10.10~
Installation
pod 'MediumSDKSwift'
and run pod install
in the directory to load dependencies.
Configuration
Add your MEDIUM_CLIENT_ID
, MEDIUM_CLIENT_SECRET
, MEDIUM_CALLBACK_URL
in Build settings
-> User-Define
In the project right click on your Info.plist
file,
choose "Open As" - "Source code" and add these lines :
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleURLSchemes</key>
<array>
<string>mediumswift</string>
</array>
</dict>
</array>
<key>MediumCallbackURL</key>
<string>$(MEDIUM_CALLBACK_URL)</string>
<key>MediumClientID</key>
<string>$(MEDIUM_CLIENT_ID)</string>
<key>MediumClientSecret</key>
<string>$(MEDIUM_CLIENT_SECRET)</string>
right before the tag.
Handle the callback in App Delegate:
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
if (url.host == "mediumswift-callback") {
OAuthSwift.handleOpenURL(url)
}
return true
}
Note 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 (courtesy of the original 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.
You are all set!
Usage
MediumSDKManager
class is designed as a singleton, you can access all it's methods by calling a shared instance:
let mediumSession = MediumSDKManager.sharedInstance
List of methods of the MediumSDKManager
class:
Authorize, completion handler returns state: success/failure and user's medium token or error string:
doOAuthMedium(completionHandler: (String, String) -> Void)
Check login credentials, completion handler returns state: success/failure and medium token or error string:
checkCred(completionHandler: (String, String) -> Void)
Get current user ID, completion handler returns state: success/failure and user ID or error string:
getUserID(completionHandler: (String, String) -> Void)
Get current Medium token, completion handler returns state: success/failure and medium token or error string:
getToken(completionHandler: (String, String) -> Void)
Sign out, completion handler returns state: success/failure, and message or error string:
signOutMedium(completionHandler: (String, String) -> Void)
Get current user's credentials, completion handler returns state: success/failure, and user ID as or error string:
ownCredentialsRequest(completionHandler: (String, String) -> Void)
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:
userPublicationsListRequest(completionHandler: (String, String, JSON) -> Void)
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:
getListOfContributors(publicationId: String, completionHandler: (String, String, JSON) -> Void)
Create new post, completion handler returns state: success/failure, and message or error string:
createPost(title: String, contentFormat: String, content: String, canonicalUrl: String?=nil, tags: [String]?=nil, publishStatus: MediumPublishStatus?=nil, license: MediumLicense?=nil, completionHandler: (String, String) -> Void)
Create a post under existing publication, completion handler returns state: success/failure, and message or error string:
createPostUnderPublication(rootPublication: String, title: String, contentFormat: String, content: String, canonicalUrl: String?=nil, tags: [String]?=nil, publishStatus: MediumPublishStatus?=nil, license: MediumLicense?=nil, completionHandler: (String, String) -> Void)
Note 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.
Release History
- 0.1.1
- Remove OSX
- 0.1.0
- Update syntax for Swift 3.0
- Drop support <= iOS 9.0
- Update dependencies
- 0.0.4
- add User-defnie variables
- current version
- 0.0.3
- bug fixies
- 0.0.2
- update dependencies
- 0.0.1
- The first release
Contribute
We would love for you to contribute to Medium SDK - Swift, check the LICENSE
file for more info.
Meta
Original author:
- Alexander Telegin – @drinkius – [email protected]
Maintained:
- Fernando Bass = @ferbass
Contributions by
- Reejo Samuel - @reejosamuel
Created as a part of development internship, distributed under the MIT license. See LICENSE
for more information.
*Note that all licence references and agreements mentioned in the Medium SDK - Swift README section above
are relevant to that project's source code only.