Windows Phone 8 近场通信 NFC / Bluetooth Proximity(2)

 

Windows.Networking.Proximity.ProximityDevice proximityDevice; private void PublishLaunchApp() { proximityDevice = Windows.Networking.Proximity.ProximityDevice.GetDefault(); if (proximityDevice != null) { // 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 (""). string launchArgs = "user=default"; // The format of the AppName is: PackageFamilyName!PRAID. string praid = "MyAppId"; // The Application Id value from your package.appxmanifest. string appName = Windows.ApplicationModel.Package.Current.Id.FamilyName + "!" + praid; string 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()); } }

 

如果你使用Nokia的NDEF 请参考

Windows Phone 8 近场通信 NFC / Bluetooth Proximity

其中包含了 配对请求,Tag信息的写入,以及设备间交互

其中交互功能可以使用连接deeplink的形式打开应用传入参数或者打开应用或者应用商店。参考我之前的帖子:Windows Phone 8 中的应用间通信 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/a32742b1165e186f66302b004a1cc5bf.html