Home

Awesome

InstagramSimpleOAuth Bitrise Cocoapod Version Carthage Compatible Cocoapod Platform License

A quick and simple way to authenticate an Instagram user in your iPhone or iPad app.

<p align="center"> <img src="https://github.com/rbaumbach/InstagramSimpleOAuth/blob/master/Snapshots/iPhone7Screenshot.jpg?raw=true" alt="iPhone 7 Screenshot" width="250" height="510"/> <img src="https://github.com/rbaumbach/InstagramSimpleOAuth/blob/master/Snapshots/iPadPro9_7Screenshot.jpg?raw=true" alt="iPad Pro 9.7 Screenshot" width="360" height="510"/> </p>

Adding InstagramSimpleOAuth to your project

CocoaPods

CocoaPods is the recommended way to add InstagramSimpleOAuth to your project.

  1. Add InstagramSimpleOAuth to your Podfile pod 'InstagramSimpleOAuth'.
  2. Install the pod(s) by running pod install.
  3. Add InstagramSimpleOAuth to your files with #import <InstagramSimpleOAuth/InstagramSimpleOAuth.h>.

Carthage

  1. Add github "rbaumbach/InstagramSimpleOAuth" to your Cartfile.
  2. Follow the directions to add the dynamic framework to your target.

Clone from Github

  1. Clone repository from github and copy files directly, or add it as a git submodule.
  2. Add all files from 'Source' directory to your project (as well as the dependencies listed in the Podfile).

How To

Example Usage

// Simplest Example:

InstagramSimpleOAuthViewController
    *viewController = [[InstagramSimpleOAuthViewController alloc] initWithClientID:@"123I_am_a_client_id_567890"
                                                                      clientSecret:@"shhhhhh, I'm a secret"
                                                                       callbackURL:[NSURL URLWithString:@"http://your.fancy.site"]
                                                                        completion:^(InstagramLoginResponse *response, NSError *error) {
                                                                            NSLog(@"My Access Token is: %@", response.accessToken);
                                                                        }];
[self.navigationController pushViewController:viewController
                                     animated:YES];

// Authenticate with all scope permissions and disable error UIAlertViews Example:

InstagramSimpleOAuthViewController
    *viewController = [[InstagramSimpleOAuthViewController alloc] initWithClientID:@"clients_r_us"
                                                                      clientSecret:@"shhhhhh, don't tell"
                                                                       callbackURL:[NSURL URLWithString:@"http://your.non.fancy.site"]
                                                                        completion:^(InstagramLoginResponse *response, NSError *error) {
                                                                            NSLog(@"My Username is: %@", response.user.username);
                                                                        }];
viewController.shouldShowErrorAlert = NO;
viewController.permissionScope = @[@"basic", @"comments", @"relationships", @"likes"];

[self.navigationController pushViewController:viewController
                                     animated:YES];

Testing

This project has been setup to use fastlane to run the specs.

First, run the setup.sh script to bundle required gems and Cocoapods when in the project directory:

$ ./setup.sh

And then use fastlane to run all the specs on the command line:

$ bundle exec fastlane specs

Version History

Version history can be found on releases page.

Suggestions, requests, and feedback

Thanks for checking out InstagramSimpleOAuth for your in-app Instagram Authentication. Any feedback can be can be sent to: github@ryan.codes.