01st Mar 2007

How-to: Create an Adium Plugin

Creating a Plugin for Adium is actually really easy. Here’s a quick guide through the proper set up to help get you started. There is even a skeleton project at the end.

  1. Create a new Xcode project, choose Bundle -> Cocoa Bundle.
  2. Add the following frameworks to your project:
    • Adium.framework
    • AIUtilities.framework
    • FriBidi.framework

    These are necessary if you plan on using or changing any part of Adium, which you will likely be doing.

  3. Create your main class. It should be named something like ABMyTestPlugin. Your class should inherit from AIPlugin, found in Adium/AIPlugin. So you will need to import that.
  4. Override the -installPlugin and (if necessary) -uninstallPlugin methods. The meat of your code goes there.
  5. Override -pluginAuthor, -pluginVersion, -pluginDescription, and -pluginURL as well, to all return appropriate NSStrings. This isn’t required, but is good practice, so do it anyways.
  6. Get info on the build target (your bundle). Change the build settings to add the following:
    • Other Linker Flags: -undefined dynamic_lookup
    • Wrapper Extension: AdiumPlugin

    Also, under the Properties tab change the Creator to “AdiM” and the set the Principal class to the name of your main class (ABMyTestPlugin).

  7. Build your bundle, drag and drop it onto the Adium icon and test it out.

That’s pretty much all there is to it. More information on what you can do once you hook into adium can be found at the Map of Adium. It’s not really complete, but if you poke around inside the Adium.framework headers you will find that most of the methods are “self-documenting” and not to difficult to figure out. I’d also suggest looking at some existing plugins, like my Time Zone Plugin and the ones included within Adium itself.

If you’d like a skeleton of the Xcode project, grab it right here: AdiumTestPlugin.zip

You might want to also grab the Adium Source and compile your own frameworks since the ones included may be out of date.

Update: luapffuh pointed me to Toby’s guide to creating an Adium Plugin. Although mostly the same, his has bit more detail and is definitely worth checking out.

3 Responses to “How-to: Create an Adium Plugin”

  1. Evan Schoenberg Says:

    I just added a link to this post to ContributingToAdium. :)

  2. Daniel Reeves Says:

    To contribute to Adium itself it says you need Leopard. Is that the case for plugins as well? Thanks!

  3. Mark Welch Says:

    I’m using Xcode 3.1.2 to create an Adium plugin, and there is no obvious reference to the Properties tab, creator code, or principal class. Any insight as to where I change these in this version of Xcode?

    Other than that, this page has been very helpful. Thanks for posting it.

Leave a Reply