[jdev] GEOLOC Support
Stephen Pendleton
stephenpendleton at hotmail.com
Tue Sep 9 11:24:35 CDT 2008
Hi, I thought I would put together a simple "cookbook" on how to add GEOLOC XEP-0080 support to a client. Hopefully it will help someone else out. If anyone sees any problems with the steps below, please let me know. BTW, I am not sure why Step 1 is needed since Step 2 advertises the same capabilities.
STEPS TO ADD GEOLOC SUPPORT:
1) Client should respond to iq query http://jabber.org/protocol/disco#info with a stanza like: <iq type='result'...><<query xmlns='http://jabber.org/protocol/disco#info'><feature var='http://jabber.org/geoloc'/><feature var='http://jabber.org/geoloc+notify'/>
2) Client should add <c> stanza to presence stanza with the proper "ver" attribute indicating geoloc support. The "ver" attribute is a SHA-1 hash of a string like:"client/pc//fooclient 1.0<http://jabber.org/protcol/geoloc<http://jabber.org/protcol/geoloc+notify<"
The stanza looks something like:
<presence from='romeo at montague.lit/orchard'> <c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.chatopus.com' ver='zHyEOgxTrkpSdGcQKH8EFPLsriY='/></presence>
3) When location changes the client publishes its new location:
<iq type='set' from='portia at merchantofvenice.lit/pda' id='publish1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <publish node='http://jabber.org/protocol/geoloc'> <item> <geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'> <country>Italy</country> <lat>45.44</lat> <locality>Venice</locality> <lon>12.33</lon> </geoloc> </item> </publish> </pubsub></iq>
4) Subscribers will receive:<message from='portia at merchantofvenice.lit' to='bassanio at merchantofvenice.lit'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='http://jabber.org/protocol/geoloc'> <item id='d81a52b8-0f9c-11dc-9bc8-001143d5d5db'> <geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'> <country>Italy</country> <lat>45.44</lat> <locality>Venice</locality> <lon>12.33</lon> </geoloc> </item> </items> </event></message>
_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20080909/65844e5a/attachment-0002.htm>
More information about the JDev
mailing list