Skip to content

vinli/ios-net

Repository files navigation

Vinli Net SDK

A framework for accessing Vinli services.

Documentation

http://cocoadocs.org/docsets/VinliNet

Installation

Install With CocoaPods

pod 'VinliNet'

Install manually, go to your project's General tab and add the VinliSDK.framework file as an Embedded Binary

OAuth Tutorial

Example project that implements Vinli Auth http://bit.ly/vl-ios-auth

Usage

Create a VLLoginViewController object and assign it your Client ID and Redirect URI.

VLLoginViewController *viewController = [[VLLoginViewController alloc] init];
viewController.clientId = @"96e9f8e4-0cqq-4528-9040-956e9edz446a";
viewController.redirectUri = @"myApp://";
viewController.delegate = self;

Then present the view controller. The VLLoginViewController will dismiss itself and call the function below once the user has authenticated:

- (void) vlLoginViewController:(VLLoginViewController *)loginController didLoginWithSession:(VLSession *)session

Once the user has a valid VLSession, create a VLService:

VLService *vlService = [[VLService alloc] init];
[vlService useSession:session];

Use VLService to interact with the Vinli services:

[vlService getDevicesOnSuccess:^(VLDevicePager *devicePager, NSHTTPURLResponse *response) {

    } onFailure:^(NSError *error, NSHTTPURLResponse *response, NSString *bodyString) {
        
    }];