Samsung Electronics logo

Message Port: Communicating through Message Ports



Samsung Web API Web applications can communicate with other Web or native applications using the MessagePort API. The message data type for the communication is map data, which consists of a string key and value pair.

You can send and receive messages through 2 types of message ports:

You can retrieve the instances of the LocalMessagePort and RemoteMessagePort interfaces with the requestLocalMessagePort() and requestRemoteMessagePort() methods of the webapis.messageport object.

A message port supports sending and receiving methods:

Figure: Message port communication

Message port communication

You can communicate only with a trusted application that is signed with the same certificate as your application, using the instances of the LocalMessagePort and RemoteMessagePort interfaces that are retrieved by the requestTrustedLocalMessagePort() and requestTrustedRemoteMessagePort() methods of the webapis.messageport object.

Figure: Trusted message ports

Trusted message ports