-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dummy API #6
Comments
Do you have some more information about this? |
There is a "mock" api included in the example https://origincache.facebook.com/developers/resources/?id=tic-tac-toe.zip It returns dummy values to all function calls. Could detect if the domain is localhost, and then load the dummy api instead. That way building Instant Game apps with Defold would be easier doing Project -> Build HTML in the editor. |
Ah, I see. Ok, so that mocks the fbinstant js api. That might be useful. I actually also provide a mock version of the fbinstant.* namespace for rapid testing on desktop, without the need to build/bundle to HTML5. It's a pure-Lua implementation of the fbinstant.* functions with static responses (no backend or anything like that involved). I'm not sure if I want to document it since I'm not sure of its usefulness yet. The mock version is in
|
Desktop builds are faster than HTML5 so it would be useful too. The problem I see is needing to update so many things as the API changes. I'm going to go all in on making some big Facebook Instant Games (and port some in progress projects to it) so anything to help productivity will be useful and I bet others will appreciate it too! Another thing which may be useful would be a chrome extension or js include which can detect new builds somehow and autoreload the web page... I've used something like that with other tools before. Another way to do it would be to make the build script open a fresh page but have a for example Chrome extension auto close other tabs of the specified name... |
I can't imagine that Facebook would make many API changes now that the API is public. Sure, they may deprecate functions and add new ones, but the ones that are documented now are not likely to change. It would be quite useful if Facebook provided this mock API somewhere more accessible, instead of hidden away inside a zip. Or if they provided an API definition in a parsable format so that something like my mock.lua file could be autogenerated much in the same way as Amazon provides API definitions for the AWS SDK. |
There's a version of the API which returns dummy results, not require connection to Facebook for testing, may be useful to support somehow
The text was updated successfully, but these errors were encountered: