Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.
/ BufferSwiftKit Public archive

Swift based SDK to access the Buffer API. The main goal is to provide a simple and easy interface to use Buffer in your iOS apps.

License

Notifications You must be signed in to change notification settings

bufferapp/BufferSwiftKit

Repository files navigation

BufferSwiftKit is a Swift based SDK to access the Buffer API. The main goal is to provide a simple and easy interface to use Buffer in your iOS apps.

Carthage compatible Cocoapods compatible Platforms GitHub release License

Sample code

// Can get the token from https://buffer.com/developers/api
// Or use OAuth 2.0. See the demo project for a sample

let token = "...."

let bufferClient = MoyaBufferClient(token: token)

bufferClient.getProfiles({ (profiles) -> Void in
    print("All right! You have \(profiles.count) profiles!")
}, failure: { (error) -> Void in
    print(error)
})

Project status

This project is actively under development. Currently, we support Xcode 7 and Swift 2.

How to get started

  1. Install BufferSwiftkit in your project
  2. Create a Buffer developer account
  3. Setup the client and start using the Kit

1. Install

Cocoapods

Add the following line into your Podfile:

pod BufferSwiftKit

Then run pod install

Carthage

Add the following line to your Cartfile:

github bufferapp/BufferSwiftKit

Run carthage

carthage update BufferSwiftKit

Then just import the framework Carthage/Build depending on the platform of your app.

2. Buffer developer account

Go to https://buffer.com/developers/api and create an app.

After completing the the process you receive the Client secret in your email. You'll need it configure OAuth 2.0 👍.

The rest of the app information is located here. Your application should look similar to this:

image

3. Setup client

BufferKitClient just needs a token to interact with the API. So, you could use the provided access token listed in the app's description for simple apps. Or, you can use OAuth 2.0 to request for a token associated with a particular user.

  • Single token method: Is simpler and is preferred while prototyping your awesome app 🎉📱😄!
  • OAuth 2.0 token method: This is the recommended approach for production apps. Libraries like OAuthSwift and OAuth2 are recommended if you use this method.

Demo project

To use the demo project you just have to open:

open Demo/BufferSwiftKit\ Demo.xcworkspace

And run it with cmd+r. The app will prompt for the Buffer API token once.

In case you want to provide the API token programmatically you can do that inside the AppDelegate file. The line to change will look like this:

 AuthManager.sharedManager.accessToken = "Insert token here"

Features

  • Callback based API support for iOS
  • Swift 2 support
  • OSX support
  • tvOS support
  • Carthage support
  • Linux support
  • RXSwift support

Coding style

We adhere to the Raywenderlich Swift coding style.

ChangeLog

Please visit the CHANGELOG.md file.

Going Forward

We are always happy to talk shop, so feel free to give us a shout on Twitter:

Or, hey - Wanna come join us!? We're hiring!

License

BufferSwiftKit is released under the MIT license. See LICENSE for details.

About

Swift based SDK to access the Buffer API. The main goal is to provide a simple and easy interface to use Buffer in your iOS apps.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •