tags:

views:

354

answers:

2

I'm trying to build a feature into my framework wrapper that automates registering template bundles. I've gotten to the point where it seems like I can do so successfully using the Feed.registerTemplateBundle API method - I don't get an error, and I do get a template id back. However, the template doesn't show up in the "Registered Templates Console", and if I try to publish a story using the id, it gives me an "invalid template bundle id" error.

Any suggestions?

A: 

I had this problem in Facebook's official example application (TheRunAround)

it was registering template but when it tried to get an id it was using sprintf (like: sprintf('%d', ))

current template ID's are out of the 32bit range so it was returning wrong id.

May it be the cause?

bakytn
I'm not using their example, or php for that matter, and I'm getting the return value as a 64-bit integer.
Daniel Schaffer
A: 

Turns out there were two problems:

  • I was erroneously double-json-encoding the short story template
  • Facebook was accepting the erroneously-formatting calls and returning an id, thus resulting in the creation of "phantom" template bundles that weren't showing up in their console.

I've fixed my code, and the bug has been reported (and I believe since fixed).

Daniel Schaffer

related questions