How to query an activity feed in the iOS sdk?

Not applicable

I've been trying to query the retrieval of an activity feed with these lines:

[query addRequiredContains:@"verb" value:@"picture"];

[query addRequirement:@"select * where verb='picture'"];

For some reason, I keep getting an error saying that the query can't be parsed.

0 3 505
3 REPLIES 3

Not applicable

@Brandon or @Robert Walsh can you answer this one?

Not applicable

Hi Kenneth,

Most likely you are getting the error about it not being able to be parsed because of this line

[query addRequirement:@"select * where verb='picture'"];

The way that the Query object in the SDK works is that it gathers every requirement specified using the classes methods and then combines them together to end up with one combined ql string.

Hence the ql string that will be created by what you are inputing will end up looking something like

"verb contains 'picture' and select * where verb = 'picture'"  

This is not correct and will end up with an error parsing it. What you want to end up with is something along the lines of

"verb contains 'picture' and verb = 'picture'"

To get this I would suggest using the following lines

[query addRequiredContains:@"verb" value:@"picture"];    

[query addRequiredOperation:@"verb" op:kApigeeQueryOperationEquals valueStr:@"picture"];

Let me know if you have any other questions.

Robert

Not applicable

Hi @Robert Walsh, thanks for the response.

I tried both of those lines both together and separately and I'm still getting the same error.

Here's a picture of the response without the query:

1084-screenshot-005.png

Am I missing something?