views:

257

answers:

3

Not sure if this is the right place to post this but I have tried other places with no luck.

I am getting the error: "The template data provided doesn't cover the entire token set needed to publish the story"

My template is: "{*actor*} just scored {*points*} points."

My code is:

NSMutableDictionary* feedStoryParams = [[[NSMutableDictionary alloc] init] autorelease];
[feedStoryParams setObject:<MyBundle ID> forKey:@"template_bundle_id"];
[feedStoryParams setObject:[NSString stringWithFormat:@"\"points\":\"42\""] forKey:@"template_data"]; 

[[FBRequest requestWithDelegate:self] call:@"Feed.publishUserAction" params:feedStoryParams];

This is after the user logs into facebook in my iphone app (and I checked to make sure the session ID is there).

I have tested also tested it by removing the "points" entry from the dictionary, and it then gives me the correct error saying that the {points} entry is missing and is required by the template "{*actor*} just scored {*points*} points." So I also know that the template bundle ID is correct.

If anyone has any ideas why this doesn't work, please let me know. I'm totally stuck :( Please help.

Thanks!!

A: 

Should 'actor' appear somewhere in the template_data?

aem
No, it is filled in automatically by Facebook based on the session info
Joel
A: 

I do have the exact same problem in respect with getting the error below:

"The template data provided doesn't cover the entire token set needed to publish the story"

Joel, did you ever resolve it?

Thanks

Franky
No, unfortunately I didn't. The workaround that I used was to push this processing to the server side and do the send to facebook from there. I never did get it working from the iPhone.
Joel
A: 

I had the same problem. Putting everything in an explicit JSON hash fixed it. Try replacing

[feedStoryParams setObject:[NSString stringWithFormat:@"\"points\":\"42\""] forKey:@"template_data"];

with

[feedStoryParams setObject:[NSString stringWithFormat:@"{\"points\":\"42\"}"] forKey:@"template_data"];
Thanks!! It is always something simple, eh?
Joel