积极答复者
磁贴更新

问题
-
就一个简单的 磁贴网络轮询功能
List<Uri> tileUriList = new List<Uri>();
tileUriList.Add(new Uri("http://www.testPage.com/tile/TileFile1.xml"));
tileUriList.Add(new Uri("http://www.testPage.com/tile/TileFile2.xml"));
tileUriList.Add(new Uri("http://www.testPage.com/tile/TileFile3.xml"));
tileUriList.Add(new Uri("http://www.testPage.com/tile/TileFile4.xml"));
tileUriList.Add(new Uri("http://www.testPage.com/tile/TileFile5.xml"));
TileUpdateManager.CreateTileUpdaterForApplication().StartPeriodicUpdateBatch(tileUriList, PeriodicUpdateRecurrence.HalfHour);本机运行,OK。测试机OK,挪到Surface上,死活不行,磁贴半天才动一下,根本不像是5个磁贴在轮转,反而像是一个磁贴显示10分钟(甚至更长),再换一个。有人能给我解释一下吗!!!烦躁啊!
(注:轮询连接地址在surface的IE中打开是可以访问的,包括图像文件也是可以访问的)
别紧张,我不是什么好人。。。
答案
-
To retrieve up to five notifications from an array of up to five unique Uniform Resource Identifiers (URIs) to populate the tile's notification queue, you must first enable the tile's notification queue by calling EnableNotificationQueue. 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.
Adding Live tiles to the desktop using c# code:
List<Uri> StoryUrls = new List<Uri>(); StoryUrls .Add(new Uri("tiles.xml")); TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true); TileUpdateManager.CreateTileUpdaterForApplication().Clear(); TileUpdateManager.CreateTileUpdaterForApplication().StartPeriodicUpdateBatch(StoryUrls, PeriodicUpdateRecurrence.HalfHour);
tiles.xml should follow microsoft format show in step 5 Here
here are some good posts for refference, http://mikaelkoskinen.net/winrt-example-of-using-periodic-notifications-for-live-tiles/, http://code.msdn.microsoft.com/windowsapps/push-and-periodic-de225603
Hope this helps
-Jenny
- 已标记为答案 刀刀入梦 2013年1月31日 7:47
全部回复
-
Hi,
因为这里没有Surface测试我会让更多的微软专家帮助你。
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
To retrieve up to five notifications from an array of up to five unique Uniform Resource Identifiers (URIs) to populate the tile's notification queue, you must first enable the tile's notification queue by calling EnableNotificationQueue. 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.
Adding Live tiles to the desktop using c# code:
List<Uri> StoryUrls = new List<Uri>(); StoryUrls .Add(new Uri("tiles.xml")); TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true); TileUpdateManager.CreateTileUpdaterForApplication().Clear(); TileUpdateManager.CreateTileUpdaterForApplication().StartPeriodicUpdateBatch(StoryUrls, PeriodicUpdateRecurrence.HalfHour);
tiles.xml should follow microsoft format show in step 5 Here
here are some good posts for refference, http://mikaelkoskinen.net/winrt-example-of-using-periodic-notifications-for-live-tiles/, http://code.msdn.microsoft.com/windowsapps/push-and-periodic-de225603
Hope this helps
-Jenny
- 已标记为答案 刀刀入梦 2013年1月31日 7:47