|
|
Inter-application communicationThe LocalConnection class enables communications between AdobeĀ® AIRĀ® applications, as well as among AIR applications and SWF content running in the browser. The connect() method of the LocalConnection class uses a connectionName parameter to identify applications. In content running in the AIR application security sandbox (content installed with the AIR application), AIR uses the string app# followed by the application ID followed by a dot (.) character, followed by the publisher ID for the AIR application (defined in the application descriptor file) in place of the domain used by SWF content running in the browser. For example, a connectionName for an application with the application ID com.example.air.MyApp, the connectionName and the publisher ID B146A943FBD637B68C334022D304CEA226D129B4 resolves to "app#com.example.air.MyApp.B146A943FBD637B68C334022D304CEA226D129B4:connectionName". (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, then the domain string that you would use to allow this application to connect is: app#com.example.air.FriendlyApp.214649436BD677B62C33D02233043EA236D13934. Note: When
you run your application with ADL (or with a development tool such
as Flash CS3, Flex Builder, or Dreamweaver), the publisher ID is
null and must be omitted from the domain string. When you install and
run your application, the publisher ID must be included in the domain
string. You can assign a temporary publisher ID using the ADL command
line arguments. Use a temporary publisher ID to test that the connection
string and domain name are properly formatted.
|