these days I was trying to make use of the argument passing to SIP Communicator which Emil recently committed. I was trying to register sip and feed protocol url handlers. But I faced some problems.
At first I started using some JNI and catching Apple Events. But a problem came : for example the application is not started and you click sip link in the browser which starts the application - apple events are not delivered. It seems that as java is running on second thread the event is missed while starting.
My second approach was creating a simple native application which is registered for those events and when it receive such, it starts SIP Communicator by passing command line arguments. But here came up more problems
When SC is installed from dmg package the second application is not in /Application folder, but in subfolder of SC resources and it seems the OS doesn't read and doesn't register the protocol url handlers. (Registering those handlers maybe forced if you open the application yourself).
The second problem is that if the application is not started and again you start it from browser the events and arguments passed to SC are ok, but if you try clicking on a link in the browser for second time nothing happens as the application receives the apple events and tries to start SC for second time but on Mac java applications are single instance and so nothing happens.
I just came up with a third approach. But with this one all current dmg structure must be changed. The thing is to switch the places of the applications the main one to be the URLHandler and the inner one to be current SC. This way the application will be in /Applications and will register for url handler after install. The application will start SC every time (will be as a launcher ) but when event is received will communicate with SC through Socket (as currently arguments are handled in SC on a second run of the application).
Any ideas and suggestions are really welcome
P.S. By the way URLHandler is committed.