Rezmason
Rezmason

Reputation: 115

Can an AIR app be programmed to handle a URL protocol?

I'm writing what is essentially a browser in Adobe AIR (ActionScript, not AJAX). A great bit of functionality to implement would be protocol handling. iTunes, for instance, handles itms protocols; when your friend sends you a link beginning with "itms://", it's going to launch iTunes as long as it's installed. Is there a way to write an AIR app (requiring AIR 2 would be fine) that can be the "handler" for a protocol in this way?

Upvotes: 1

Views: 1050

Answers (4)

nephtes
nephtes

Reputation: 1319

There is no way, programatically speaking, to specifically handle a particular protocol. However, there is InvokeEvent. InvokeEvent will be fired when the application is "invoked", either when it's explictly launched or if an associated file or URL is activated.

The process of associating your app with a particular file type or protocol scheme is separate and application-dependant. In iOS, for example, you would need to specify the protocol in Info.plist under CFBundleURLTypes/CFBundleURLSchemes.

Upvotes: 1

Kimonoki
Kimonoki

Reputation: 1

Check out this page. I am trying to find out the same thing, but I haven't found any solution to do it with just Air yet. Seems like you might need a custom installer to setup the correct registry entries, and a proxy application to "wash" the input to a correct format that then can start your application with the correct command line parameters. Hope this can be of any assistance.

Upvotes: 0

Jay Paroline
Jay Paroline

Reputation: 2527

http://www.patrick-heinzelmann.de/labs/lastfm/

I'm not sure exactly how it works and I don't see a way to download the app, so I can't even test it, but maybe it will help...

Upvotes: 0

dirkgently
dirkgently

Reputation: 111130

Yes. You can use the URLLoader class to download data in binary form (URLLoader.BINARY) and then parse this as appropriate. See this CS3 documentation on working with external data.

Upvotes: 0

Related Questions