I noticed that
someone had written a plugin for Mobile Safari to install apps over the web. This opened up some interesting possibilities for integrating our existing iPhone Web application to the "native" features of the iPhone, namely WiFi signal strength. It turned out to be fairly straightforward. My plugin class derives from UIView (mine has no UI, so I basically just draw black). Your plugin class has to implement a special class selector "plugInViewWithArguments" which gets any arguments stated in the embed tag on the page. In order to interact with Javascript on the page, you must implement "objectForWebScript" and associated selectors.
I had some problem getting Mobile Safari to call different methods on my object, and so in the end I could only expose one method to script. This wasn't a problem for me because I'm just returning a list of WiFi access points, but I'd still like to solve it.
The header file for our plugin is
here and the implementation
here.
Lastly, you need a special
property list, and the build files should go in
/System/Library/Internet Plug-Ins/YourPlugin.webplugin.
Thank you for your contribution. You've taken a huge step to making Povo the "word on the street,"
and we appreciate it very much. Because of the complexity of the "wiki text" and code that can be used
on Povo, in order to edit this section in the future you must click the "edit" button to the right of the section
heading (or for the whole page).