Coder Social home page Coder Social logo

socialaccounts's Introduction

SocialAccounts

SocialAccounts is an iOS framework that provides an easy way to manage social network accounts

Requirements

  • Xcode 4.5 or higher
  • Apple LLVM compiler
  • iOS 5.0 or higher
  • ARC

Demo

Build and run the SocialAccountsExample project in Xcode to see SocialAccounts in action.

If you don't have CocoaPods installed, check section "Installation" below.

Installation

The recommended approach for installing SocialAccounts is via the CocoaPods package manager, as it provides flexible dependency management and dead simple installation.

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup

Edit your Podfile and add SocialAccounts:

$ edit Podfile
platform :ios, '5.0'
pod 'SocialAccounts', :head

Install into your Xcode project:

$ pod install

Add #include "SocialAccounts.h" to the top of classes that will use it.

Example Usage

Saving & Loading Accounts from the Account Store

    SOAccountStore* store = [[SOAccountStore alloc] init];
    
    SOAccountType* type = [store accountTypeWithAccountTypeIdentifier:SOAccountTypeIdentifierInstagram];
    
    SOAccount* account = [[SOAccount alloc] initWithAccountType:type];
    
    account.username = @"john";
    SOAccountCredential* credential = [[SOAccountCredential alloc] initWithOAuth2Token:@"2342341.b6fw422.b8f5ffs9sjqljq7a70e788884b67c" refreshToken:nil expiryDate:nil];
    credential.scope = @"relationships";
    account.credential = credential;
    
    [store saveAccount:account withCompletionHandler:^(BOOL success, NSError *error) {
        NSLog(@"Saved Account");
        NSLog(@"%@", [account description]);
    }];
    
    
    for (SOAccount* account in store.accounts) {
        NSLog(@"loaded account %@", account.credential.oauthToken);
    }

socialaccounts's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.