简体   繁体   English

通过NFC启动未发布的WP8应用程序

[英]Launch Unpublished WP8 app via NFC

I am attempting to test launch my app that I am writting via NFC with windows phone 8. 我正试图测试启动我的应用程序,我正在通过NFC与Windows Phone 8写。

According to the documentation I have seen, in order to do this you need the app ID. 根据我看到的文档,为了做到这一点,您需要应用程序ID。

From my experience you only get an app ID after you publish an app. 根据我的经验,您只能在发布应用后获得应用ID。

So that brings me to the question. 这让我想到了这个问题。

How do I launch an app via NFC tag that I programmed without knowledge of the App ID before hand? 如何在不事先知道App ID的情况下通过NFC标签启动应用程序?

There is another way to launch apps with NFC via URI association. 还有另一种通过URI关联启动NFC应用程序的方法。 You can register your app for an URI association, and it will be launched when receives a message with a URI of the registered protocol. 您可以为URI关联注册您的应用程序,并在收到带有已注册协议的URI的消息时启动它。

For example you can register the protocol myapp , by adding following code to the WMAppManifest.xml file: 例如,您可以通过向WMAppManifest.xml文件添加以下代码来注册协议myapp

<Extensions>
  <Protocol Name="myapp" NavUriFragment="encodedLaunchUri=%s" TaskID="_default" />
</Extensions>

That way, if the device receives a message with the URI myapp:something , the app will be started. 这样,如果设备收到带有myapp:something的消息,则应用程序将启动。 This also allows the app to be launched from other app. 这也允许从其他应用程序启动该应用程序。

Find more information here . 在此处查找更多信息。

If you still prefer the appID approach, for testing purposes you can use the Product ID property from WMAppManifest.xml , but note that it will replaced by other ID when published. 如果您仍然喜欢appID方法,出于测试目的,您可以使用WMAppManifest.xml中Product ID属性,但请注意,它在发布时将替换为其他ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM