ProximityDevice.PublishMessage(String, String) | publishMessage(String, String) method
Publishes a message to subscribers of the specified message type.
The type of message to deliver to subscribers.
The message to deliver to subscribers.
A unique publication ID for the published message. Pass this value to the StopPublishingMessage method to stop publishing the message.
You can subscribe to published messages by using the SubscribeForMessage method.
Messages are delivered to all applications that have subscribed to the message type (as indicated by the messageType parameter). Message type values are case-sensitive strings that consist of two parts: the protocol and the subtype. The protocol is first, followed by a dot (.) and then the subtype. For the PublishMessage method, the protocol must always be "Windows.". The subtype is a string of alphanumeric characters and the following additional characters: . ( ) + , - : = @ ; $ _ ! * ’. The subtype cannot exceed a length of 250 characters.
To publish messages by using another message type, like “WindowsMime.” or “NDEF:WriteTag”, you must use the PublishBinaryMessage method.
You can use the PublishUriMessage method to publish a Uniform Resource Identifier (URI) to a proximate computer.
Messages are converted to UTF-8 characters before they're transmitted.
For Windows Store apps, publications and subscriptions are active only if the calling app is in the foreground.
The proximity APIs do not provide authentication, encryption, or message integrity. Do not use proximity to exchange user sensitive information such as passwords, financial data, text messages, email, photographs, or government id numbers.
Minimum supported client
Minimum supported server
|Windows Server 2012|
Minimum supported phone
|Windows Phone 8|
- PublishMessage(String, String, MessageTransmittedHandler)
- Proximity and Tapping (C#/VB/C++)
- Proximity sample