crino / instagram-ios-sdk

Instagram SDK for iOS
http://www.followgram.me
228 stars 63 forks source link

how to use it #1

Closed hiren443 closed 12 years ago

hiren443 commented 12 years ago

hello can you give some note to how it's implemented in app

crino commented 12 years ago

i'll add an example asap however just:

  1. inlcude the header/source files in your project
  2. set up the project and the application on instagram's website as described in readme
  3. create a new instance of Instagram object and set the delegates to process the responses
hiren443 commented 12 years ago

I have done your step but nothing working I am eagerly waiting for your example

hiren443 commented 12 years ago

I have create demo for instagram using your sdk

instagram = [[Instagram alloc] initWithClientId:@"052252e29cdb409bb985dce423b4ca4a" delegate:self];
[instagram authorize:nil];

Now I get the error like Cannot Open Page Safari cannot open the page because the address is invalid

when i track i get the Url https://instagram.com/oauth/authorize?response_type=token&redirect_uri=ig052252e29cdb409bb985dce423b4ca4a%3A%2F%2Fauthorize&client_id=052252e29cdb409bb985dce423b4ca4a

i have set redirect url path in instagram as ig052252e29cdb409bb985dce423b4ca4a://authorize and also add URL schema in xcode ig052252e29cdb409bb985dce423b4ca4a://authorize

crino commented 12 years ago

You probably forget to handle the schema in your application delegate ;) I've added an example and updated the readme file.

hiren443 commented 12 years ago

Hello Crino Thanx for example One more issue. can we post image on instagram using your sdk?

crino commented 12 years ago

No, Instagram doesn't expose any API for publish photos. You need to use 'iPhone hooks' (http://instagram.com/developer/iphone-hooks/)

sourish commented 11 years ago

Hello Crinco I have downloaded the instagram sample nad using that, i am able to login and logout, but when i am trying to relogin than its taking the old Credentials its not asking for the New Credentials, Can u Please help me out , I am struck with problem for a Long time

crino commented 11 years ago

https://github.com/crino/instagram-ios-sdk/issues/4

nitin0805 commented 11 years ago

Hello Crinco i have downloaded a sample and used it but while connecting it is showing message unauthorized and when i debug it i get message on log that i am getting the url is null.

when i hit the url on browser it redirects me to my redirect url please help

Nitin Gupta

crino commented 11 years ago

Did you change something? I just tried the example and works

supportkaira commented 10 years ago

Hi Crino, I stuck in very strange problem. I am constantly getting error "Redirect URI does not match registered redirect URI". I have set Redirect URI as : "https://igfdabfbdacdd14f908a456195445a7e38://authorize"

Set URL Schema in .plist file as : "igfdabfbdacdd14f908a456195445a7e38://authorize"

And when i try to login i get URL like : "https://instagram.com/oauth/authorize?response_type=token&redirect_uri=igfdabfbdacdd14f908a456195445a7e38%3A%2F%2Fauthorize&scope=comments+likes&client_id=fdabfbdacdd14f908a456195445a7e38"

Can you help me out what i am doing wrong?

Any help is appreciated.

Thank you.

crino commented 10 years ago

Remove ://authorize from schema in plist ;)

supportkaira commented 10 years ago

Thanks for the prompt response. I have removed it but still the error is same.

supportkaira commented 10 years ago

My application info is something like this:

WEBSITE URL : https://igfdabfbdacdd14f908a456195445a7e38://authorize REDIRECT URI: https://igfdabfbdacdd14f908a456195445a7e38://authorize

crino commented 10 years ago

Try with http

supportkaira commented 10 years ago

Hi,

By unchecking "Enforce signed header" and removing "https://" from the redirect URL have solve my problem. But now i am not able to call delegate methods of the IGSessionDelegate.

sparkspill commented 10 years ago

Hi, I'm trying to create an application where it opens instagram after editing the picture in my app. I wanted it to include a hashtag on the description when it goes to instagram but I seem to get lost on how to implement that. The iphone hooks states to use the tag line but I don't know where to place that. below is my code appreciate any help. Thank you.

NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"]; if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {

    docInteraction.delegate = self;

    //Saves the edited Image to directory
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];

    NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"instaFilterx.jpg"];

    UIImage *image = combinedImage;
    NSData *imageData = UIImagePNGRepresentation(image);
    [imageData writeToFile:savedImagePath atomically:NO];

    //Loads the edited Image
    NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:@"instaFilterx.jpg"];
    UIImage *tempImage = [UIImage imageWithContentsOfFile:getImagePath];

    //Hooks the edited Image with Instagram
    NSString  *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/instaFilterx.igo"];
    [UIImageJPEGRepresentation(tempImage, 1.0) writeToFile:jpgPath atomically:YES];

    // Prepares the DocumentInteraction with the .igo image for Instagram
    NSURL *instagramImageURL = [[NSURL alloc] initFileURLWithPath:jpgPath];
    docInteraction = [UIDocumentInteractionController interactionControllerWithURL:instagramImageURL];
    [docInteraction setUTI:@"com.instagram.exclusivegram"];