How to register for Win8 periodic tile notifications?

馋奶兔 提交于 2019-12-09 06:39:49

问题


I am working on a Win8-UI-App (previously called Metro...) and trying to implement Periodic (Documentation for different methods) Tile Updates (Live Tiles) for the first time.

I found a couple of very good resources on the internet and was able to do it. Unfortunately the question of where I should register for the notifications remained unsolved:

Do I have to register for Notifications every time the app starts (e.g. in the App.xaml.cs OnLaunched() Method)? - Or is there an other, more professional way to do so? (I could imagine to save if I already registered for the service or is there a variable I can access to see whether notifications are registered?)

thank you!

PS: For everyone who is also new to this see this StackOverflow post, this example, the tile template types and the Dev Center for quick starting :)


回答1:


Periodic updates will continue until they are explicitly stopped or your app is uninstalled. Technically, you only have to do that once. But, the Guidelines and checklist for periodic updates states

Call the StartPeriodicUpdate or StartPeriodicUpdateBatch method each time your app is launched or brought into focus. This ensures that the tile content will be updated each time the user launches or switches to the app.

According to that, App launch and App resume are good candidates for a call to StartPeriodicUpdate.



来源:https://stackoverflow.com/questions/11900579/how-to-register-for-win8-periodic-tile-notifications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!