ProximityDevice.PublishBinaryMessage | publishBinaryMessage methods
Overload list
| Method | Description |
|---|---|
| PublishBinaryMessage(String, IBuffer) | Publishes a message that contains binary data to subscribers of the specified message type. |
| PublishBinaryMessage(String, IBuffer, MessageTransmittedHandler) | 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. |
Remarks
You can subscribe to published messages using the SubscribeForMessage method.
Messages continue to be published until the StopPublishingMessage method is called or the ProximityDevice is released.
Examples
var proximityDevice; function publishLaunchApp() { proximityDevice = Windows.Networking.Proximity.ProximityDevice.GetDefault(); if (proximityDevice) { // The format of the app launch string is: "<args>\tWindows\t<AppName>". // The string is tab or null delimited. // The <args> string can be an empty string (""). var launchArgs = "user=default"; // The format of the AppName is: PackageFamilyName!PRAID. var praid = "MyAppId"; // The Application Id value from your package.appxmanifest. var appName = Windows.ApplicationModel.Package.current.id.familyName + "!" + praid; var launchAppMessage = launchArgs + "\tWindows\t" + appName; var dataWriter = new Windows.Storage.Streams.DataWriter(); dataWriter.unicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.utf16LE; dataWriter.writeString(launchAppMessage); var launchAppPubId = proximityDevice.publishBinaryMessage( "LaunchApp:WriteTag", dataWriter.detachBuffer()); } }
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
|
Capabilities |
|
See also
- ProximityDevice
- Proximity and Tapping (JavaScript)
- Proximity and Tapping (C#/VB/C++)
- Samples
- Proximity sample
Build date: 2/25/2013
