2013-05-08 32 views
1

我想在我的Windows 8應用程序中的瓷磚顯示徽章。我試過下面的代碼,並沒有得到瓷磚中的徽章。沒有錯誤顯示出來。我沒有得到什麼問題。我堅持了2個小時。徽章到我的窗戶中的瓷磚8應用程序

var notifications = Windows.UI.Notifications; 
var badgeType = notifications.BadgeTemplateType.badgeNumber; 
var badgeXml = notifications.BadgeUpdateManager.getTemplateContent(badgeType); 
var badgeAttributes = badgeXml.getElementsByTagName("badge");  
badgeAttributes[0].setAttribute("value", "7");  
var badgeNotification = new notifications.BadgeNotification(badgeXml); 
notifications.BadgeUpdateManager.createBadgeUpdaterForApplication().update(badgeNotification); 

更新

嗨上面的代碼爲我工作在Windows8的桌面,但是當我運行在模擬器它沒有顯示的徽章text.Can有人幫我這個

回答

0

不幸,所有通知API(烤麪包,圖塊,徽章和推送通知)都不能在Windows 8模擬器中使用。要測試和調試,請使用「本地計算機」作爲目標。

+0

謝謝你的回答。我會檢查本地機器。 – 2013-05-09 06:46:18

相關問題