是否有 API 允许我以编程方式从商店中提取最新更新并刷新用户正在使用的当前版本?如果没有,当前应用程序是否有可能以编程方式知道有新版本可用?
任何样本/示例将不胜感激。
是否有 API 允许我以编程方式从商店中提取最新更新并刷新用户正在使用的当前版本?如果没有,当前应用程序是否有可能以编程方式知道有新版本可用?
任何样本/示例将不胜感激。
You can't programmatically install any Store software. But you can programmatically open the Store to let it do the user manually.
That said, there's no official Store API which you could ask about app versions (you might be able to parse the Store's HTML pages, but I recommend against this approach).
What you can do: Put a small XML file on your website which contains the latest app version number. Your app then can read this file and compare this desired version against the running app's version. If the app is outdated, the app can show a message box to the user.
我最终使用 WNS 和 Azure 通知中心在应用启动时向应用发送推送通知。该通知采用 toast 消息的形式,基本上表明有新版本可用。但如果您在 xx/xx/xxxx 之后更新/下载了应用程序,则无需更新。
我知道这有点笨拙,但至少用户现在知道他们正在使用的应用程序版本可能已经过时了。我通过 Azure 移动服务(最多 10 个应用程序免费)控制通知,并且可以完全修改实际脚本。