Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Get Pinterest Images into an iOS app

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 293
    Comment on it

    Simply to get User uploaded images from Pinterest we need to do following things first:-

    1. Install Pinterest native app on iOS device.
    2. Get logged in with any user credential.
    3. Now Hit the Pinterest API with passing .
    4. In json response you will get all images.
    -(void)getImages:(id)sender{
        NSURL *url = [NSURL URLWithString:@"https://api.pinterest.com/v3/pidgets/users//pins/"];
        NSData *postData = [@"" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
        NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:300];
        [request setHTTPMethod:@"GET"];
        [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
        [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
        [request setHTTPBody:postData];
        NSError *error = [[NSError alloc] init];
        NSHTTPURLResponse *response = nil;
        NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
    
        if (urlData) {
            NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:urlData options:0 error:nil];
            NSLog(@"%@",jsonArray);
        }
    
    
    }

    Happy Coding :)**

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: