Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialArsene Lavaux
4,342 PointsGrabbing pictures of a user's "follows" profile pictures from Instagram
Based on Instagram's API documentation, I implemented this code to grab the profile pictures of the "follows" for the logged in Instagram user on my app:
NSString *urlString = [[NSString alloc] initWithFormat:@"https://api.instagram.com/v1/users/3/follows?count=99&access_token=%@", self.accessToken];
I do get profile pictures but they do not match the profile pictures of the "follows".
To double check, I logged in with another instagram user, and the pictures being returned are the same.
Any ideas how to fix this?
4 Answers
Stone Preston
42,016 Pointslooking at your string it looks like you are getting the follows of a static user with id = 3. use self instead of 3 to get the follows for the current user
NSString *urlString = [[NSString alloc] initWithFormat:@"https://api.instagram.com/v1/users/self/follows?count=99&access_token=%@", self.accessToken];
Arsene Lavaux
4,342 PointsHi Stone: Thank you very much. I wish Instagram's doc would be a bit more elaborate for not so savvy iOS learners like myself ;)
Stone Preston
42,016 Pointsyeah its pretty barebones it seems.
Arsene Lavaux
4,342 PointsStone: Another quick question for you. What are the advantages of working with this for Instagram: https://github.com/crino/instagram-ios-sdk
As opposed to what we are doing in the course material (rest api I guess?).
Stone Preston
42,016 Pointsnot sure really. that has not been updated in a year though, so it might not work well
Arsene Lavaux
4,342 PointsOk Stone. Thank you again :)