views:

263

answers:

1

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.

A: 

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];
vodkhang
I tried your query.NSString* fql =[NSString stringWithFormat:@"SELECT cover_pid,name FROM album WHERE owner == %lld", session.uid];Still it return the empty array, But my account have 3 album named profile,NaturePhoto and Profile Pictures.
I will edit the answer to post the solution
vodkhang