Created
January 18, 2016 13:38
-
-
Save seviu/be2ba68febf0facdf816 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I do not know if this still works, but I used to use this to get friends and their photos in one of iPhonso past apps | |
- (void)getMyFriends { | |
[FBSession setSession:self.fbSession]; | |
NSString* fql1 = @"SELECT uid, first_name, last_name, pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = %qi) order by first_name"; | |
NSString* fql2 = @"SELECT owner, size FROM album WHERE owner IN (SELECT uid FROM #friend)"; | |
NSString *fql1WithId = [NSString stringWithFormat:fql1, _uid]; | |
NSString *fqlWithId = [NSString stringWithFormat:@"{\"friend\":\"%@\",\"album\":\"%@\",}", fql1WithId, fql2]; | |
NSDictionary* params = [NSDictionary dictionaryWithObject:fqlWithId forKey:@"queries"]; | |
[self.fbconnection cancel]; | |
self.fbconnection = nil; | |
self.fbconnection = [FBRequest requestWithDelegate:self]; | |
[self.fbconnection call:@"facebook.fql.multiquery" params:params]; | |
} | |
- (void)getOwnPhotos { | |
[FBSession setSession:self.fbSession]; | |
//We get them all... | |
NSString* fql = @"SELECT pid, src_big, caption, created FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner=%qi ) "; | |
NSString *fqlWithId = [NSString stringWithFormat:fql, _uid]; | |
NSDictionary* params = [NSDictionary dictionaryWithObject:fqlWithId forKey:@"query"]; | |
[self.fbconnection cancel]; | |
self.fbconnection = nil; | |
self.fbconnection = [FBRequest requestWithDelegate:self]; | |
[self.fbconnection call:@"facebook.fql.query" params:params]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment