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.
// 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)
})
This project is actively under development. Currently, we support Xcode 7 and Swift 2.
- Install BufferSwiftkit in your project
- Create a Buffer developer account
- Setup the client and start using the Kit
Add the following line into your Podfile
:
pod BufferSwiftKit
Then run pod install
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.
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:
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.
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"
- Callback based API support for iOS
- Swift 2 support
- OSX support
- tvOS support
- Carthage support
- Linux support
- RXSwift support
We adhere to the Raywenderlich Swift coding style.
Please visit the CHANGELOG.md file.
We are always happy to talk shop, so feel free to give us a shout on Twitter:
- Andy - @ay8s
- Jordan - @jordanmorgan10
- Humber - @goku2
Or, hey - Wanna come join us!? We're hiring!
BufferSwiftKit is released under the MIT license. See LICENSE for details.