简体   繁体   中英

iPhone facebook connect FQL Query to get Profile URL

Hai.

I am using Face book Connect FQL Queries to extract my profile photo url that is src_big,src_small URL.

But i am always getting the empty array in below delegate

  • (void)request:(FBRequest*)request didLoad:(id)result

My FQL query is.

NSString* fql = [NSString stringWithFormat:@"SELECT src_big,src_small FROM photo WHERE pid IN (SELECT cover_pid FROM album WHERE owner =%lld AND name ='Profile Pictures')", session.uid]; NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"]; [[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];

But - (void)request:(FBRequest*)request didLoad:(id)result always return the empty result.

Can any one please correct me if there any mistake.

Ok, I was wrong, I thought that you need a multiquery + JSON presentation for that. Here is my code

    NSString *albumFql = [NSString stringWithFormat:@"SELECT cover_pid, name FROM album WHERE owner =%lld", self.session.uid];
    NSDictionary *fqlsDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
                                    albumFql, @"album",
                                    nil];   
    NSDictionary *params = [NSDictionary dictionaryWithObject:[fqlsDictionary JSONRepresentation] forKey:@"queries"];
    [[FBRequest requestWithDelegate:self] call:@"facebook.fql.multiquery" params:params];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM