Microsoft Screwed Up Activities API Docs – It's addService NOT AddService

UPDATE: jst ROCKS! – I was able to do exactly what he said and I now have both cases of APIs working in my extension.

OK, this is really starting to bother me because Activities are starting to show up and they don’t work on Firefox because Microsoft screwed up the documentation.

The correct syntax for adding an Activity (per my conversation with Microsoft) is:

window.external.addService('FindInWikipedia.xml');
as documented here
NOT

window.external.AddService('FindInWikipedia.xml');
as documented here. (I have no idea what the whitepaper says – I can’t agree to the license agreement.

Note the lowercase a at the beginning. Even though both work on IE, USE THE LOWERCASE addService!

You would think people would have just cut and paste the code from the Activity Providers site and got it right.

Incidentally, if anyone knows how to create an API in Firefox that will work with either case, that would be great. Then I could work like Internet Explorer.

8 Responses to “Microsoft Screwed Up Activities API Docs – It's addService NOT AddService”

  1. asdf March 26, 2008 at 2:09 pm #

    window.external.IsServiceInstalled
    window.external.AddService

    that’s what in the whitepaper, but you probably knew that already ;)

  2. Albert March 26, 2008 at 2:44 pm #

    The whitepaper mentions both addService and AddService, even on the same page. Looks like a quick & dirty job to me…

  3. Johnny Stenback March 26, 2008 at 4:49 pm #

    If you’re implementing this using XPCOM interfaces it would seem to me that you could create two unrelated interfaces (no inheritance relationship between the two), one defining “addService”, the other defining “AddService” and you advertise both these interfaces through an nsIClassInfo implementation callers should be able to call either function.

  4. Mitch Denny March 30, 2008 at 12:23 am #

    Hi mate,

    I’ve updated my samples.

  5. Bob March 31, 2008 at 1:23 pm #

    Deep breath, man. Bugs happen. It’s a Beta (heck, it’s a Developer Preview).

  6. Thomy Kay April 7, 2008 at 3:01 am #

    I created an activity xml according to a href=”http://msdn2.microsoft.com/en-us/library/cc289775(VS.85).aspx”>http://msdn2.microsoft.com/en-us/library/cc289775(VS.85).aspx.

    IE is able to deal with namespaces correctly (os:* elements), your implementation is not. One reason is that it searches for element names without namespaces.

    Would be good to support namespaces correctly in your plugin.

Trackbacks/Pingbacks:

  1. My first “Activity” « Coenwulf.0 - April 3, 2008

    [...] figure out how to get the information I wanted to put into the post to del.icio.us. Also, thanks to this post for causing me to think that it’s time to write [...]

  2. Mike’s Musings » Update on Activities, Microformats and Operator - April 29, 2008

    [...] is much better, and I was able to support both the uppercase and lower case version of the API (which I complained about earlier). In addition, the code has been substantially rewritten so that it doesn’t affect the global [...]

Leave a Reply:

Gravatar Image