Skip to content
ZineImage:Povo Staff

Povo Staff/Povo iPhone Plugin

This page is part of a zine. You can join this Zine
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.