CloudServices/Sync/FxSync/Developer/ClientAPI: Difference between revisions

Line 272: Line 272:
== Installing your classes into Sync ==
== Installing your classes into Sync ==


You can register your engine in an "weave:service:ready" observer using the Weave.Engines.register() function. Note that the parameter you passed should be the name of your engine, such as Weave.Engines.register(FooEngine) and not new FooEngine().
You can register your engine in an "weave:service:ready" observer using the <tt>Weave.Engines.register(FooEngine)</tt> function. However, "weave:service:ready" is issued after the "weave:engine:start-tracking" observer notification. If your tracker observes "weave:engine:start-tracking", it's best to have the Sync service register your engine. Stick your engine class on to the Weave object:
 
Also note that "weave:service:ready" is issued after the "weave:engine:start-tracking" observer notification. If your tracker observes "weave:engine:start-tracking", it's best to have the Sync service register your engine. Stick your engine class on to the Weave object:


<pre>
<pre>
Line 280: Line 278:
</pre>
</pre>


and add "Foo" to the services.sync.registerEngines preference (it's a comma separated list of engine names).
and add "Foo" to the <tt>services.sync.registerEngines</tt> preference (it's a comma separated list of engine names).


== Testing and Debugging your Engine ==
== Testing and Debugging your Engine ==


TODO
TODO
canmove, Confirmed users
725

edits