retrive image to my iOS app

Discussion in 'iOS Programming' started by preiostd, Jul 14, 2013.

  1. preiostd macrumors newbie

    Joined:
    Oct 27, 2012
    #1
    Hi
    I would like to retrive images from my web or my flicker account or instgram account or my blog to my ios app

    can anybody help me with the code
    thanks
    :)
     
  2. harrys1590 macrumors newbie

    Joined:
    Jul 14, 2013
    #2
    The answer to this is not exactly straight forward. If you just want to get images efficiently on a background thread then I suggest you use EGOImageLoader which can be found with code examples here. It's an easy to use library that will download images from a URL to a UIImageView.

    The part where you get images from social networks like Flicker or Instagram is not as simple. You will have to look into each companies API's. It will require a basic understanding of HTTP requests. You will have to use an OAuth authentication point which brings the user from your app to the other website for them to sign in and then sends them back to your app with a token to use in all further HTTP requests. A good library for easily sending HTTP requests is AFNetworking (found here with code examples). After getting the token you will need to make API calls using it to get the images you need.
     
  3. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
  4. harrys1590 macrumors newbie

    Joined:
    Jul 14, 2013
    #4
    As I assume you've found during your research there are almost no native iOS API's and even the ones that exist are only for posting data, not for getting nearly as deep as I assume the OP is looking to go.
     
  5. preiostd, Jul 15, 2013
    Last edited: Jul 15, 2013

    preiostd thread starter macrumors newbie

    Joined:
    Oct 27, 2012
    #5
    Mr harrys1590 and Mr ArtOfWarfare thanks 4 ur replay:)

    first for EGOImageLoader i download the example and try it
    but it is not working:(

    2- for the AFNetworking did u mean that i have to:

    1-download AFNetworking
    2-use this code to download image to my app

    Code:
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 100.0f)];
    [imageView setImageWithURL:[NSURL URLWithString:@"http://i.imgur.com/r4uwx.jpg"] placeholderImage:[UIImage imageNamed:@"placeholder-avatar"]];
    
    but i think this code will download only specific image from URL
    and what i want to download pictures in my website i will have it in my app
    and when ever i have new image in my website it will be download to my app


    Mr ArtOfWarfare
    i will try to Build iOS Flickr App but are you sure that it will work because
    i find it hard little bit:eek:
     

Share This Page