ProximityDevice.PublishBinaryMessage(String, IBuffer, MessageTransmittedHandler) | publishBinaryMessage(String, IBuffer, MessageTransmittedHandler) method

Publishes a message that contains binary data to subscribers of the specified message type. The specified handler is called when the message has been transmitted.

Syntax


public:
long long PublishBinaryMessage(
  String^ messageType, 
  IBuffer^ message, 
  MessageTransmittedHandler^ messageTransmittedHandler
)

Parameters

messageType

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The type of message to deliver to subscribers.

message

Type: IBuffer

The binary message data to deliver to subscribers.

messageTransmittedHandler

Type: MessageTransmittedHandler

The handler to call when the message has been transmitted.

Return value

Type: Number [JavaScript] | System.Int64 [.NET] | int64 [C++]

A unique publication ID for the published message.

Remarks

You can publish multiple messages of the same message type and each publication will have a unique ID associated with it.

You can stop publishing a message by passing the publication ID returned by the PublishBinaryMessage method to the StopPublishingMessage method.

Messages continue to be published until the StopPublishingMessage method is called or the ProximityDevice is released.

You can subscribe to published messages using the SubscribeForMessage method.

For details on the types of messages that you can publish with the PublishBinaryMessage(String, IBuffer, MessageTransmittedHandler) method, see the remarks in the PublishBinaryMessage(String, IBuffer) reference topic.

You can use the PublishMessage method to publish a text message to a proximate computer. You can use the PublishUriMessage method to publish a Uniform Resource Identifier (URI) to a proximate computer.

Important  

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.

Examples

No code example is currently available or this language may not be supported.

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Proximity
Windows::Networking::Proximity [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Capabilities

proximity
ID_CAP_PROXIMITY [Windows Phone]

Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Networking.Proximity
Windows::Networking::Proximity [C++]

Metadata

Windows.winmd

Capabilities

proximity
ID_CAP_PROXIMITY [Windows Phone]

See also

ProximityDevice
PublishBinaryMessage(String, IBuffer)
Proximity and Tapping (JavaScript)
Proximity and Tapping (C#/VB/C++)
Samples
Proximity sample

 

 

Show:
© 2015 Microsoft