Latest 1.0.1
Homepage https://github.com/pisces/InstagramSDK
License MIT
Platforms ios 7.0, requires ARC
Dependencies PSFoundation, w3action
Authors

InstagramSDK

CI Status
Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.


AppDelegate

#import "DemoAppDelegate.h"

NSString *const clientId = @"Your client id";
NSString *const clientSecret = @"Your client secret";
NSString *const redirectURL = @"Your redirect url";

@implementation DemoAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[InstagramAppCenter defaultCenter] setUpWithClientId:clientId
                                                     clientSecret:clientSecret
                                                      redirectURL:redirectURL];
    return YES;
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    if ([[InstagramAppCenter defaultCenter] matchedURL:url])
        return [[InstagramAppCenter defaultCenter] application:application
                                                               openURL:url
                                                     sourceApplication:sourceApplication
                                                            annotation:annotation];
    return YES;
}

@end

Example for API Call

- (void)viewDidLoad {
    [super viewDidLoad];

    if ([InstagramAppCenter defaultCenter].hasSession) {
        [self loadUserProfile];
    } else {
        [[InstagramAppCenter defaultCenter] loginWithCompletion:^(id result, NSError *error) {
            if (!error) {
                [self loadUserProfile];
            }
        }];
    }
}

- (void)loadUserProfile {
    [[InstagramAppCenter defaultCenter] apiCallWithPath:IGApiPathUsersSelf param:nil completion:^(id result, NSError *error) {
        NSLog(@"result, error -> %@, %@", result, error);
    }];
}

API Paths

IGApiPathUsersSelf
IGApiPathUsersUserId
IGApiPathUsersSelfMediaRecent
IGApiPathUsersUserIdMediaRecent
IGApiPathUsersSelfMediaLiked
IGApiPathUsersSearch
IGApiPathUsersSelfFollows
IGApiPathUsersSelfFollowedBy
IGApiPathUsersSelfRequestedBy
IGApiPathUsersUserIdRelationship
IGApiPathUsersUserIdRelationshipPost
IGApiPathMediaMediaId
IGApiPathMediaShortcodeShortcode
IGApiPathMediaSearch
IGApiPathMediaMediaIdComments
IGApiPathMediaMediaIdCommentsPost
IGApiPathMediaMediaIdCommentsCommentId
IGApiPathMediaMediaIdLikes
IGApiPathMediaMediaIdLikesPost
IGApiPathMediaMediaIdLikesDel
IGApiPathTagsTagname
IGApiPathTagsTagnameMediaRecent
IGApiPathTagsSearch
IGApiPathLocationsLocationId
IGApiPathLocationsLocationIdMediaRecent
IGApiPathLocationsSearch

Parameter example for Path

You don’t need include oauth2 property as parameter, it will add automatically in sdk.

// Path contains 'user-id'
@{@"user-id": @(1574083)}

// Path contains 'media-id'
@{@"media-id": @(3)}

// Path contains 'shortcode'
@{@"shortcode": @(3)}

// Path contains 'tag-name'
@{@"tag-name": @"tagname"}

// Path contains 'location-id'
@{@"location-id": @(3)}

// Path IGApiPathUsersSearch or IGApiPathTagsSearch
@{@"q": @"query"}

// Path IGApiPathMediaSearch or IGApiPathLocationsSearch
@{@"lat": @(48.858844), @"lng": @(2.294351)};

Requirements

iOS Deployment Target 7.0 higher

Installation

InstagramSDK is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "InstagramSDK-Pod"

Author

pisces, [email protected]

License

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

Latest podspec

{
    "name": "InstagramSDK-Pod",
    "version": "1.0.1",
    "summary": "InstagramSDK.",
    "description": "InstagramSDK is open source to use instagram apis.",
    "homepage": "https://github.com/pisces/InstagramSDK",
    "license": "MIT",
    "authors": {
        "pisces": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pisces/InstagramSDK.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "InstagramSDK/Classes/*.{m,h}",
    "dependencies": {
        "PSFoundation": [],
        "w3action": []
    },
    "resource_bundles": {
        "InstagramSDK": [
            "InstagramSDK/Assets/*.*"
        ]
    }
}

Pin It on Pinterest

Share This