1

I am trying to fetch any album of facebook user in an IPhone app. Here is the fql query i am using

NSString *query = [NSString stringWithFormat:@"SELECT aid,object_id,owner FROM album WHERE owner=%d",fid];

where fid is a valid facebook uid stored in an int variable

the result I get is a NSArray class with 0 count

what am I doing wrong?

Following what suggested in the first answer I am now trying the graph api this way:

query = [NSString stringWithFormat:@"/%d/albums",fid];
[_facebook requestWithGraphPath:query andDelegate:self];

this time the result is a NSDictionary with a "data" key returning an empty NSArray. Anyway after three times I try to retrieve the albums list this way I also get an error which I print out (both the local than the error description) in the console:

localized error : The operation couldn’t be completed. (facebookErrDomain error 10000.) 
rror : Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed.   (facebookErrDomain error 10000.)" UserInfo=0x18b5b0 {error=<CFBasicHash 0x176050 [0x3e2169fc]>{type = mutable dict, count = 2,
entries => 
    2 : <CFString 0x18ccc0 [0x3e2169fc]>{contents = "type"} = <CFString 0x18c990 [0x3e2169fc]>{contents = "OAuthException"}
3 : <CFString 0x190a90 [0x3e2169fc]>{contents = "message"} = <CFString 0x18c0d0 [0x3e2169fc]>{contents = "(#803) Some of the aliases you requested do not exist: 2147483647"}
}
} 

Any idea?

prashant
  • 1,920
  • 14
  • 26
Andrea Sindico
  • 7,358
  • 6
  • 47
  • 84

1 Answers1

3

Does your auth token have permission to view that user's albums? Otherwise I'm not certain.

You might consider using the Graph API instead of FQL. On iOS you can use Facebook's library (available here).

This provides the method requestWithGraphPath:andDelegate:. The graph path you need is {user_id}/albums.

Your result is returned to the delegate method request:didLoad:, but the main advantage that may help you solve your problem is the optional delegate method request:didFailWithError:. When there's an error, this provides a lot more information than just an empty array.

sho
  • 759
  • 5
  • 16