Message Port
Tizen applications can communicate with each other using message ports. Applications can send and receive messages through message port communication. The message data type for communication is a map data which consists of a bundle (key and value pair).
You can communicate between applications using 2 types of message port:
- Local port is used to register your message port and prepare to receive messages from another application.
To receive messages from the another application, set the callback from the local message port.
- Remote port is used to send messages to other applications. The local message port information can be sent to the other application for bi-directional communication.
A message port supports 2 communication methods:
- Uni-directional communication
- Check whether the message port of a remote application is registered with the message_port_check_remote_port() function.
- A Tizen application can send messages to another application using the message_port_send_message() function.
- Another application can receive the messages using the message_port_register_local_port() function.
Figure: Uni-directional communication
- Bi-directional communication
- Check whether the trusted message port of a remote application is registered with the message_port_check_remote_port() function.
- A Tizen application can send messages and local message port information to another application using the message_port_send_message_with_local_port() function. This local message port information can be used to send the response messages from the other application which receives these messages.
- Another application can receive the messages using the message_port_register_local_port() function. The remote message port information can be used to send response messages to the application which sends the messages.
Figure: Bi-directional communication
Trusted Communication
You can send and receive trusted messages through message port APIs. The trusted message port instance can be retrieved using the message_port_register_trusted_local_port() function. Communication over the trusted message port is allowed only if both applications are signed with a certificate that is uniquely assigned to its developer.
Figure: Trusted message port communication