GithubHelp home page GithubHelp logo

nextroot / nrgramkit Goto Github PK

View Code? Open in Web Editor NEW
69.0 9.0 23.0 389 KB

An Objective-C block-based, ARC, API wrapper for the complete Instagram API for iOS

License: MIT License

Objective-C 99.21% Ruby 0.79%

nrgramkit's Introduction

NRGramKit

An Objective-C block-based, ARC, API wrapper for the complete Instagram API for iOS

Usage

This project installs as a cocoapods pod in your project by pasting this line in your Podfile:

pod 'NRGramKit'

Optionally to make sure you are using the latest version you can specify the podfile linked directly from the official NRGramKit repository:

pod 'NRGramKit', :podspec => 'https://raw.github.com/NextRoot/NRGramKit/master/NRGramKit.podspec'

Create an application at http://intagr.am/developer and create a new plist file in your project called NRGramKitConfigs.plist with the following keys:

InstagramClientId
InstagramClientSecret
InstagramClientCallbackURL

Use the provided class methods to make instagram calls and receive the data using the provided blocks, asynchronously.

###Authentication

Just provide NRGramKit with a webview that you display where you want and when you want so it can handle the login process. NRGramKit remembers everything it needs after the process is finished.

[NRGramKit loginInWebView:self.webView 			loginLoadingCallback:^(BOOL loading){
    //you can show a spinner while the webview is loading
     }
     finishedCallback:^(IGUser* user,NSString* error)     {
     // yay - you are now authenticated, NRGramKit remembers the credentials
     }];

You can check if you're authenticated using

[NGGramKit isLoggedIn];

Or get info about the current user using

[NGGramKit loggedInUser];

###Unauthenticated calls

All the calls to the service are done asynchronously and are block-based

[NRGramKit getMediaPopularWithCallback:^(NSArray* popularMedia,IGPagination* pagination)
         {
             self.media = popularMedia;
         }];

Authenticated calls

Authenticated calls will simply fail if you don't login first

[NRGramKit getMediaInUserLikedCount:25 withCallback:^(NSArray* likedFeed, IGPagination* pagination)
         {
             self.media = likedFeed;
             callback(YES);
         }];

License

NRGramKit is available under the MIT license. See the LICENSE file for more info.

nrgramkit's People

Contributors

raulandrisan avatar wfettich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nrgramkit's Issues

AFNetworking error does not trickle all the way back through the callbacks.

(I'm using NRGramKit 1.4)
My app makes a call to log in, and AFNetworking (1.3.4) comes back with an error. The error trickles up to NRGramKit.m:219, where the error data is no longer used in the callback chain. Following the chain from there, we pass through NRGramKit.m:145 (which gets nil parameters as well) before hitting NRGramKit.m:241, where an IGUser is created using the nil dictionary.

By the time the callback chain makes it back to the original call to +loginInWebView:loginLoadingCallback:finishedCallback: we have lost track of the fact that there was an error, and instead we have an empty user object.

Issue setting up

I just installed and I get this error, I'm not sure what's wrong. Any help would be appreciated.

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods is not an object file (not allowed in a library)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1

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.