2013-12-18 74 views
0

我不太明白當向WP通知服務器發送XML時Action =「Clear」的目標。Action =「清除」在Windows手機推送通知

例子:

<?xml version="1.0" encoding="utf-8"?> 
<wp:Notification xmlns:wp="WPNotification" Version="2.0"> 
    <wp:Tile Id="[Tile ID]" Template="IconicTile"> 
    <wp:SmallIconImage [Action="Clear"]>[small Tile size URI]</wp:SmallIconImage> 
    <wp:IconImage Action="Clear">[medium/wide Tile size URI]</wp:IconImage> 
    <wp:WideContent1 Action="Clear">[1st row of content]</wp:WideContent1> 
    <wp:WideContent2 Action="Clear">[2nd row of content]</wp:WideContent2> 
    <wp:WideContent3 Action="Clear">[3rd row of content]</wp:WideContent3> 
    <wp:Count Action="Clear">[count]</wp:Count> 
    <wp:Title Action="Clear">[title]</wp:Title> 
    <wp:BackgroundColor Action="Clear">[hex ARGB format color]</wp:BackgroundColor> 
    </wp:Tile> 
</wp:Notification> 

我要推裝置磚每天一次用一個簡單的標題和圖像,所以我應該把行動=「清除」的每個屬性?

如果不放呢?

回答

1

您不需要使用Action="Clear",除非如名稱所示,您需要清除屬性的值。

基本上,當您從通知中忽略一個值時,它會保留舊值。例如,如果您決定從瓦片中刪除計數併發送:

<wp:Count></wp:Count> 

然後它不會實際刪除計數但保留舊值。這很方便,因爲這意味着您只需將您想要更新的值發送給您的通知。而當你想要什麼是真正清除財產,而不是保留以前的值,你只需要添加Action="Clear"部分:

<wp:Count Action="Clear"></wp:Count> 
+0

啊!我知道了,謝謝 –