OAuth Tutorial for Vinli iOS SDK

The first thing that any iOS app needs to to when building with Vinli is install the SDK, and then set up OAuth... so that your app can actually access a Vinli user's data. Thankfully, this is super easy... so just sit back, open up Xcode, and follow along as we walk you through the process.

Installing the SDK

The Vinli SDK is easily deployed through CocoaPods. cd into your project directory and run pod init to create a podfile. If you already have a file, you can skip pod init.

Open the pod file in a text editor and add pod VinliNet. The result should look something like...

target 'Vinli-Auth-Example' do
pod 'VinliNet'
end
target 'Vinli-Auth-ExampleTests' do
end
target 'Vinli-Auth-ExampleUITests' do
end

Now go back to your terminal and run pod install and wait for the Pod intallation to complete.

Make sure to close out of your Xcode project. Once the pod installs, a new Project.xcworkspace file will appear in your directory. Open that bad boy up in Xcode.

Congrats! You've installed the Vinli SDK!

OAuth

Before we build any flashy, cool features, we first need to ask the user if it's okay for our app to access their Vinli data. We use the industry standard OAuth2 Protocol and bake Authentication into the SDK so you don't have to worry about it.

Create a Client

Login to the developer portal and create a Client for your app. Make sure it's an iOS client (duh) and enter in a redirect URI. The redirect URI can be whatever you want as long as it follows the http://something.something format.

My Vinli (SUPER IMPORTANT)

You should be good to go! Now, all you need is a My Vinli account to try it out with. REMEMBER your Vinli developer credentials are NOT the same as My Vinli consumer credentials. No worries though, just head over to my.vin.li to spin up an account.