While working on my talks for next month's PalmSource European Developer Conference, I noticed a quick in how Exchange Manager works that you need to take into consideration if you're writing an application that registers for a URL scheme.
When a program calls ExgRequest with a URL, the system first tries to find an exchange library that's registered for that URL scheme. If it can't find a library, it looks for an application. If there is an application, it will get launched using SysAppLaunch and the sysAppLaunchCmdGoToURL launch code.
I had previously thought it would be using SysUIAppSwitch, but using SysAppLaunch makes more sense; you might want to setup URL schemes where a request causes some background or delayed action. This does mean more work on the part of the program that receives the URL request, however. If you're a web browser, for example, and you register for "http", then when receiving this launch code, you need to:
- Check to see if this is a real application launch or a sublaunch
- If it's a sublaunch, relaunch yourself using
SysUIAppSwitchand a system-owned copy of the URL string
If you go with the assumption that all sysAppLaunchCmdGoToURL launches will be full program switches, then you've set yourself up to crash and burn.
If this didn't make any sense to you, you should start doing research on Exchange Manager. It is playing a more important part in how Palm OS applications communicate with each other, being the core technology used for IR beaming, web-based file downloading, and email attachment handling.
