Inter-application communication

The LocalConnection class enables communications between Adobe® AIR® applications, as well as among AIR applications and SWF content running in the browser.

The connect() and send() methods of the LocalConnection class use a connectionName parameter to identify the other endpoint of the connection. To communicate with content running in the AIR application security sandbox (content installed with the AIR application), you must prefix the connection name with a superdomain identifying the AIR application. The superdomain string starts with app# followed by the application ID followed by a dot (.) character, followed by the publisher ID (if defined). For example, the proper superdomain to use in the connectionName parameter for an application with the application ID, com.example.air.MyApp, and no publisher ID is: "app#com.example.air.MyApp". Thus, if the base connection name is “appConnection,” then the entire string to use in the connectionName parameter is: "app#com.example.air.MyApp:appConnection". If the application has the publisher ID, then the that ID must also be included in the superdomain string: "app#com.example.air.MyApp.B146A943FBD637B68C334022D304CEA226D129B4.1". (For more information, see Defining the basic application information and Getting the application and publisher identifiers.)

When you allow another AIR application to communicate with your application through the local connection, you must call the allowDomain() of the LocalConnection object, passing in the local connection domain name. For an AIR application, this domain name is formed from the application and publisher IDs in the same fashion as the connection string. For example, if the sending AIR application has an application ID of com.example.air.FriendlyApp and a publisher ID of 214649436BD677B62C33D02233043EA236D13934.1, then the domain string that you would use to allow this application to connect is: app#com.example.air.FriendlyApp.214649436BD677B62C33D02233043EA236D13934.1. (As of AIR 1.5.3, not all AIR applications have publisher IDs.)